Express Entry in Hook/Event not available
Permalink
As described inhttps://documentation.concrete5.org/developers/application-events/ho... I tried to hook into event on_express_entry_saved in file application/bootstrap/app.php. But I've got the same problem as "agencecoteo" (first comment/message).
Though I have access to the ID of the entry, I'm not able to call the other properties by their magic methods (e.g. $entry->getNom() ).
The main problem is, I cannot load the whole Express entry: $express = \Express::getEntry($entry->getId());
How can I access all of the properties?
Though I have access to the ID of the entry, I'm not able to call the other properties by their magic methods (e.g. $entry->getNom() ).
The main problem is, I cannot load the whole Express entry: $express = \Express::getEntry($entry->getId());
How can I access all of the properties?
Just ran into this myself, the solution I came up with is to use the Express::refresh() method, and then attributes / associations work.
Appears to be same as this bug report:
https://www.concrete5.org/developers/bugs/8-1-0/cant-getattributes-o...
Events::addListener('on_express_entry_saved', function($event) { $entry = \Express::refresh($event->getEntry()); dd($entry->getProductName()); });
Appears to be same as this bug report:
https://www.concrete5.org/developers/bugs/8-1-0/cant-getattributes-o...
Just ran into this myself, the solution I came up with is to use the Express::refresh() method, and then attributes / associations work.
Appears to be same as this bug report:
https://www.concrete5.org/developers/bugs/8-1-0/cant-getattributes-o...
Events::addListener('on_express_entry_saved', function($event) { $entry = \Express::refresh($event->getEntry()); dd($entry->getProductName()); });
Appears to be same as this bug report:
https://www.concrete5.org/developers/bugs/8-1-0/cant-getattributes-o...
------------------------------------------------------------------------------------
Original question from documentation that kfidel mentioned is:
------------------------------------------------------------------------------------
Hi, i'm not able to load Express Object Attributes Value either form the Package Controller nor from a call to a class method in packages/package_name/src/test.php directory. In my Package Controller on_start method i have add :
The Entry object is correctly loaded but impossible to get the Attribute Value by its Handle with the getAttributeHandle() function. However i'm able to call the Entry Obect ID with $entry->getID(). The getNom() method work from another Pages Controllers.