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

Wrong format for empty field type description #148

Closed homarx closed 6 years ago

homarx commented 6 years ago

When generating yml for content types by this command php app/console kaliop:migration:generate --type=content_type --match-type=all AppBundle empty descriptions of field types get the value false.

When trying to migrate this yml following error is thrown:

Migration aborted! Reason: Error in execution of step 1: Argument '%argumentName%' is invalid: expected value to be of type 'string' in file /.../ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/Helper/DomainMapper.php line 513

Correct value for empty field type seems to be ''

gggeek commented 6 years ago

q1: which version of the migration bundle are you using ? q2: which version of eZ are you using ? q3: how many content languages have you set up in your site ?

I just tested executing the same command on an eZ 5.4 install, with mig. bundle 4.4.1, and I do not get 'false' for descriptions of either fieldtypes or fields: I get either an empty yml object, or an object with a member: key 'eng-GB', value ''. Both are good for being re-imported.

homarx commented 6 years ago

a1: 4.4.1 a2: 6.12.0.1 a3: 2 --> eng-GB, ger-DE

Only for the class 'folder' descriptions have the value false. Other empty descriptions get an (correct) empty yml object. In my database all empty descriptions have the value NULL except the folder class descriptions. For these the value is b:0; in the serialized_description_list field. I can't explain why there is an difference. Thought it was a clean db from install?!

gggeek commented 6 years ago

It might be that the 'clean install' db is not as speckle-free as one would expect. The reason being that it was originally developed for ezp4, which was more tolerant of weird data. A couple of months ago I know that there was a fix applied to the sql of the clean db, for a problem that was indeed found via the mig bundle. It migth be the case that it is the very same problem...

Could you try simply editing the folder class and republish it again, to see if it fixes your problem ?

homarx commented 6 years ago

Nothing changes in db field for descriptions when I edit the folder class (without changing anything) until I enter a string for description in admin ui. But then I can't change it back to an empty value?!

gggeek commented 6 years ago

I checked the 'cleandata.sql' file in both legacy kernel and eZ5 kernel. I think that the 'cleandata.sql' file in ez5 kernel has a bug, that was not present in its legacy version.

As you have noticed, there is a boolean "false" value stored in the serialized_description_list, whereas the other classes have NULL...

The docs for the API call that the mig bundle uses state: eZ\Publish\API\Repository\Values\ContentType\getDescriptions() : return string[]

I think that it is thus fair to say that you could open a bug in the ezplatform tracker

homarx commented 6 years ago

Just recognized that the issue is already tracked: https://jira.ez.no/browse/EZP-28020

And the fix is merged into ezsystems:6.7: https://github.com/ezsystems/ezpublish-kernel/pull/2099

Sorry for stealing your time Gaetano ...

gggeek commented 6 years ago

NP :-)