Bug #45384

Persisted entity object in widget-configuration cannot be deserialized (after reload)

Added by Benno Weinzierl almost 9 years ago. Updated over 8 years ago.

Must have
Start date:
Due date:
% Done:


Estimated time:
Has patch:


I have a widget with a persisted entity object (e.g. MyNamespace\SpecialProduct derived from MyNamespace\Product) in its widget-configuration.

The object gets serialized in the session and is accessable in a ajax-request (everything works).

When i reload the page with the widget, the ajax calls fail with the following error:

Fatal error: ... The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "MyEntity" of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in "my widget ajax action controller" on line 65

I noticed that in Data/Temporary/Development/SubContextMyContext/Cache/Data/Flow_Session_Storage the entity is serialized. After reload the file contains the serialized entity two times. That seemes strange.


Updated by Christian Müller almost 9 years ago

I am not sure it is a good idea to try to add an entity to the widget context.
it should probably be represented only by it's identifier.
Generally I think it is a problem we should solve in the future (if possible), but a workaround might be to give only the identifier to the viewhelper and then in the ajax controller getting that object from persistence again.


Updated by Christian Müller almost 9 years ago

In order to be able to give an object to the viewhelper but serialize only the identifier you would have to overwrite the getAjaxWidgetConfiguration() method in your viewhelper (this in turn calls getWidgetConfiguration which you wuold need to overwrite too).


Updated by Karsten Dambekalns over 8 years ago

  • Target version changed from 2.0 to 2.0.1

Also available in: Atom PDF