mugoweb / mugo_calendar

eZ Publish extension to add calendar functionality
2 stars 2 forks source link

Remove unnecessary storeObjectAttribute code #8

Closed peterkeung closed 6 months ago

peterkeung commented 6 months ago

Event data is stored in a separate table. The raw result from $contentObjectAttribute->content() (which is a wrapper for $dataType->objectAttributeContent() when the content has not already been set in the request) is incompatible with DB storage as it's an array, and we do not use the contents of "data_text" for anything -- it's currently containing redundant information. When it is trying to set an array, this produces an error on PHP 8.

pkamps commented 6 months ago

I believe it's ok not to store anything in the DB for the attribute context. As you say, the data is in different tables and the filtering/fetch functions are using those extra tables anyways. We can always come back to that if we think it would be good to store anything in the attribute context - like IDs of the entries in the extra tables for example (just making this up - not very useful).

carlosmauri commented 6 months ago

Confirming the issue I was facing has been solved with this code fix. Screenshot 2024-05-24 at 10 10 44 AM

Note that on library projects we also introduced some updates within the toFieldValue function located at bundles/Marigold/BaseBundle/Persistence/Legacy/Content/FieldValue/Converter/MugoRecurringEvent.php (adding this here just for reference)