Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: set unique form element identifier after node copy #72

Merged
merged 4 commits into from
Jun 16, 2020

Conversation

ger4003
Copy link
Contributor

@ger4003 ger4003 commented Jun 12, 2020

When a form element with identifier propery is copied an exception is thrown.
@see https://github.com/neos/form/blob/3a6122db36ad2c9e6f06316653a35c80ff47dee1/Classes/Core/Model/FormDefinition.php#L553

This changes adds a signal slot for \Neos\ContentRepository\Domain\Model\Node
afterNodeCopy addedNode to make the form element identifier unique. This also works if a whole section having a form element with identifier is copied and inserted.

Fixes #44

When a form element with identifier propery is copied an exception is thrown.
@see https://github.com/neos/form/blob/3a6122db36ad2c9e6f06316653a35c80ff47dee1/Classes/Core/Model/FormDefinition.php#L553

This changes adds a signal slot for \Neos\ContentRepository\Domain\Model\Node "afterNodeCopy" to make the form element identifier unique.
If you copy and insert a whole section which includes a form element with identifier the exception is still thrown.
Therefore I use nodeAdded signal.
Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change, thanks for that!
I just added a couple of nitpick comments, but apart from those this can be merged IMO!

Classes/Package.php Outdated Show resolved Hide resolved
Classes/Package.php Outdated Show resolved Hide resolved
Classes/Package.php Outdated Show resolved Hide resolved
Classes/Package.php Outdated Show resolved Hide resolved
@bwaidelich
Copy link
Member

bwaidelich commented Jun 15, 2020

Ah one additional comment: I think this is a BUGFIX rather than a FEATURE (making it eligible for a patch level release)

@ger4003 ger4003 changed the title FEATURE: set unique form element identifier after node copy BUGFIX: set unique form element identifier after node copy Jun 15, 2020
@ger4003
Copy link
Contributor Author

ger4003 commented Jun 15, 2020

Thanks @bwaidelich for the review. I adjusted the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants