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

netgen/tagsbundle subTreeLimit migration aborted #109

Closed volarname closed 6 years ago

volarname commented 7 years ago

when using "netgen/tagsbundle": "3.0.0-rc1" the following migration

-
    mode: update
    type: content_type
    lang: slk-SK
    identifier: article
    attributes:
        -
            identifier: keywords
            type: eztags
            validator-configuration:
                TagsValueValidator: { subTreeLimit: 2 }

will fail with error:

Processing 20170303111827_content_type_update-article-keywords-internal-tags.yml

Migration aborted! Reason: Error in execution of step 1: ContentType FieldDefinitions did not validate
Setting "%setting%" is unknown - array (
  '%setting%' => 'subTreeLimit',
)
Setting "%setting%" is unknown - array (
  '%setting%' => 'maxTags',
) in file /app/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/Helper/ContentTypeDomainMapper.php line 285
gggeek commented 7 years ago

Hello.

I tried to reproduce this, but I am at a loss for the moment:

gggeek commented 7 years ago

ps: I managed to reset the admin interface. But I still cant reproduce the error.

These are the 2 migrations I executed:

-
    mode: create
    type: content_type
    content_type_group: Content
    name_pattern: '<title>'
    identifier: testcontent
    name: TestContent
    attributes:
        -
            identifier: title
            type: ezstring
        -
            identifier: keywords
            type: eztags

-
    mode: update
    type: content_type
    match:
        identifier: testcontent
    attributes:
        -
            identifier: keywords
            type: eztags
            validator-configuration:
                TagsValueValidator: { subTreeLimit: 1 }
gggeek commented 7 years ago

Did you upgrade by any chance the version of the tagsbundle after having some content class with tag fields already defined?

emodric commented 7 years ago

Did you upgrade by any chance the version of the tagsbundle after having some content class with tag fields already defined?

@gggeek This should not cause any issues (I myself tested with fields which were already existing), because storage model did not change, only the API part of the field type.

One possible reason that comes to mind is that old representations of fields are being loaded from SPI cache and are used.

gggeek commented 6 years ago

Note: seems that this bug does happen when using ezplatform 2 - the recent Travis test runs confirm it. That will give me another chance to investigate...

gggeek commented 6 years ago

OK, so what we found out with ezplatform 2 is that validation problems do happen when you are loading the TagsBundle bundle before the eZ kernel bundles in appKernel.php. Switching to load the TagsBundle last solved the problems that we had with Travis tests...

gggeek commented 6 years ago

Ping any feedback ?

emodric commented 6 years ago

@gggeek What kind of feedback do you need? :)

yoyolepsy commented 6 years ago

Hello,

Sorry if my feedback is late. Here my last feedback. We have had a similar issue when we try to update from eZPlatform 1.10 to eZPltaform 2.2. When we have changed the order of TagsBundle in AppKernel.php as proposed by @gggeek , it has been good for us.

gggeek commented 6 years ago

Thx. Will then close the issue. If there are still problems, please open another one.