kaliop-uk / ezmigrationbundle

This bundle makes it easy to handle eZPlatform / eZPublish5 content upgrades/migrations
GNU General Public License v2.0
53 stars 81 forks source link

Cannot update content field `always_available` #209

Closed TFohrer closed 4 years ago

TFohrer commented 5 years ago

When trying to update the availability of a content item like this e.g.:

-
    type: content
    mode: update
    match:
        content_type_identifier: ['folder']
    always_available: false 

I'm always getting this error:

Migration failed! Reason: Error in execution of step 15: Missing values in file /var/www/html/project/ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Doctrine/UpdateDoctrineQuery.php line 112

Using version 5.9.4 of ezmigrationbundle and ezplatform version 2.4.1

TFohrer commented 5 years ago

Works when I add another field like 'modification_date'. So this updated statement works:

 -
    type: content
    mode: update
    match:
        content_type_identifier: ['folder']
    modification_date: 1553253910
    always_available: false 
gggeek commented 5 years ago

I've looked up the cause of the problem, and it sits within the way the method eZ\Publish\Core\Persistence\Legacy\Content\Gateway::updateContent() creates and runs sql queries out of a given ContentUpdateStruct. Of all the metadata fields that make up an object, the only one which is handled in a 'special' fashion is always_available. If you alter any other field in addition to it, the update will work.

I could in principle add a workaround for this case to the Migration Bundle, but tbh it feels out of place, as the workaround could turn out to be quite dirty and/or computationally expensive and the error lies in the kernel anyway so it would still trigger in other usages.

I will proceed to create a ticket with eZ support, hoping that it gets fixed there.

gggeek commented 5 years ago

Ticket created: https://jira.ez.no/browse/EZP-30754

alongosz commented 4 years ago

Hello. The issue has been fixed via ezsystems/ezpublish-kernel#2850. The fix will be available in the next eZ Platform releases: 1.13.6, 2.5.8, 3.0.0-beta4

gggeek commented 4 years ago

Closing this here then, thanks @alongosz