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

Validation of identifier #112

Closed Liquid2Sky closed 7 years ago

Liquid2Sky commented 7 years ago

Hi, I am not sure if this issue is a bug or an enhancement but I think it need to be documented ;)

I got some migration files, imported them and everything was fine... When I tried to edit the newly created ContentType I got an "form validation error" in the ez Backend.

Problem was that the field identifier contained dashes instead of underscores.

            type: ezstring
            name: Topbar-hover-color
            identifier:  topbar-hover-color
            description: Farbe des Topmenüs bei Mouseover..
            required: false
            searchable: false
            translatable: false
            category: Theme

Would be nice if migration Bundle could check if identifiers are valid :D

c-revillo commented 7 years ago

hmm, well, can be a nice to have, but i'd say this should be ez api responsability. i mean, ez publish api should avoid the creation of that fields if it can't work with them later... Does ez api allows the creation of fields with this kind of identifiers?

gggeek commented 7 years ago

Hello

I tend to agree with Carlos on this one: the Migration Bundle sticks to using the eZ Public API, and does not try to improve it / fix-it unless for cases where it is blatantly needed.

In this case, we could add a check for the unsupported characters, but what if in the future the eZ API changes, making the dashes valid characters? Then we would need to add version-specific checks inside the migration bundle, and code would become ugly and testing brittle.

I suggest that you open this as bug on bugs.ez.no.

On my side, I will add it as known snag in the FAQ section of the migration bundle.

Is that ok with you?

Liquid2Sky commented 7 years ago

Yeah, I got your point and I agree with it :D I will create an ez ticket. Thx for your feedback