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

Added support to create variants on object creation #375

Merged
merged 18 commits into from
Apr 16, 2024

Conversation

turbo-ele
Copy link
Contributor

@turbo-ele turbo-ele commented Nov 6, 2023

Allows the import of variants on Element Creation and Element Location Update, when using the findParent location strategy.

The type of the element will then be set to variant if all of the following conditions apply:

  • Newly added As Variant checkbox is checked
  • Element needs to be of the same class as the parent
  • The class needs to allow the creation of variants
  • Element is not allowed to have children

Additionally two more variant related checks were added:

  • at the findParent strategy only parents can be set that are not of type variant
  • generally, the parent of a variant cannot be changed anymore

@turbo-ele turbo-ele force-pushed the feature/support-variants branch 3 times, most recently from d594549 to 91b9ff6 Compare November 6, 2023 13:31
Copy link
Contributor

@blankse blankse left a comment

Choose a reason for hiding this comment

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

Small improvements

src/Resolver/Location/FindParentStrategy.php Outdated Show resolved Hide resolved
src/Resolver/Location/FindParentStrategy.php Outdated Show resolved Hide resolved
@dvesh3 dvesh3 added this to the 1.9.0 milestone Nov 7, 2023
@turbo-ele turbo-ele force-pushed the feature/support-variants branch 4 times, most recently from 2ac1474 to 5a33deb Compare November 9, 2023 14:18
@fashxp
Copy link
Member

fashxp commented Jan 24, 2024

can you please just add the english translation. all others are maintained via poeditor. thx very much.

turbo-ele and others added 3 commits January 30, 2024 14:19
As the parent can be changed for variants this is now catched, as a variant cannot change its
parent anymore.
Copy link

github-actions bot commented Jan 30, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Copy link

github-actions bot commented Jan 30, 2024

Qodana for PHP

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

As the parent can be changed for variants this is now catched, as a variant cannot change its
parent anymore.
src/Resolver/Resolver.php Show resolved Hide resolved
Copy link
Member

@fashxp fashxp left a comment

Choose a reason for hiding this comment

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

I would do one minor adaption, besides that it looks good to me 👍

src/Resolver/Location/FindParentStrategy.php Outdated Show resolved Hide resolved
@fashxp fashxp self-assigned this Mar 28, 2024
Copy link
Member

@fashxp fashxp left a comment

Choose a reason for hiding this comment

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

finally it looks good. thank you so much for your support! this is a great addition.

@fashxp fashxp merged commit c43691a into pimcore:1.x Apr 16, 2024
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2024
@turbo-ele turbo-ele deleted the feature/support-variants branch April 16, 2024 09:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants