- 🇮🇳India sumit_saini
Rerolling patch for 2.x branch and 2.0.0-alpha1
- 🇮🇳India sumit_saini
Attaching interdiff for patches in #5 ✨ Add PRE_CLONE/POST_CLONE event dispatch handling to sub referenced entities Needs work
- 🇧🇪Belgium dieterholvoet Brussels
We're working with a MR here, no patches. I'll rebase the MR against 2.x.
- First commit to issue fork.
- last update
over 1 year ago Patch Failed to Apply - 🇮🇳India Nitin Shirole
Rerolling patch for 2.x branch and 2.0.0-beta2
- 🇧🇪Belgium dieterholvoet Brussels
We're working with a MR here, no patches.
- last update
over 1 year ago Patch Failed to Apply - 🇮🇳India Nitin Shirole
Patch rerolled for 2.x branch and 2.0.0-beta2
- 🇧🇪Belgium dieterholvoet Brussels
Did you not read the comment I just posted? We're working with a MR here, no patches. This is the third time I’ve had to say this in this issue, please stop re-rolling patches.
- Status changed to RTBC
over 1 year ago 5:46pm 26 April 2023 - 🇮🇳India sumit_saini
With this patch/fix, the hooks are firing for the cloned referenced entities also. Using this fix on a site without any issue so, changing status to RTBC.
- last update
over 1 year ago 1 pass, 50 fail - last update
over 1 year ago 1 pass, 50 fail - last update
over 1 year ago 1 pass, 50 fail - last update
over 1 year ago 1 pass, 50 fail 28:16 26:50 Running- last update
over 1 year ago 1 pass, 50 fail - last update
about 1 year ago Patch Failed to Apply - 🇮🇳India JaydipJD surat
We are waiting this changes to be release since long. We must have to upgrade the latest release of this module on our site. Hence created patch.
- last update
about 1 year ago 1 pass, 42 fail - last update
about 1 year ago 1 pass, 42 fail -
Rajeshreeputra →
committed 6d72caff on 2.x authored by
DieterHolvoet →
Issue #3058025 by DieterHolvoet, Rajeshreeputra, sumit_saini, Nitin...
-
Rajeshreeputra →
committed 6d72caff on 2.x authored by
DieterHolvoet →
- 🇮🇳India rajeshreeputra Pune
Merged, released to be followed shortly! Thanks for working on this!
- Status changed to Fixed
about 1 year ago 11:56am 17 October 2023 -
Rajeshreeputra →
committed 5cbfafdb on 2.x
Revert "Issue #3058025 by DieterHolvoet, Rajeshreeputra, sumit_saini,...
-
Rajeshreeputra →
committed 5cbfafdb on 2.x
- Status changed to RTBC
about 1 year ago 12:32pm 17 October 2023 - Status changed to Needs work
10 months ago 10:03am 1 February 2024 - 🇮🇳India sumit_saini
This issue seems to address same problem as #3089105: When cloneReferencedEntities is called it should dispatch events → (other issue patch also includes tests). Maybe we can close the other one (copying changes and credits from there) as this targets 2.x branch.
- First commit to issue fork.
- 🇬🇧United Kingdom jonathanshaw Stroud, UK
jonathanshaw → changed the visibility of the branch 3058025-2 to hidden.
- Status changed to Needs review
9 months ago 6:41pm 28 February 2024 - 🇬🇧United Kingdom jonathanshaw Stroud, UK
I believe the approach here is better than #3089105: When cloneReferencedEntities is called it should dispatch events → therefore I have closed that one as a duplicate.
What's better about the approach here is that is moves the events into the cloneEntity method, whereas the other approach keeps the events in the form, but also calls them when cloning child entities. The approach here avoids complicating the code base, and keeps in the direction of seperating the API from the UI.
I've moved the test across from #3089105: When cloneReferencedEntities is called it should dispatch events → and suggest maintainers credit contributors to that issue.
I think this MR may have caused tests to fail previously when it was committed becaue it was buggy: in the committed version the pre-clone event dispatching was both left in the form and moved into the handler, so the dispatch was duplicated.
- last update
9 months ago 16 pass, 12 fail - 🇬🇧United Kingdom jonathanshaw Stroud, UK
jonathanshaw → changed the visibility of the branch 3058025-add-preclonepostclone-event to hidden.
- last update
9 months ago 16 pass, 12 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 16 pass, 14 fail - last update
9 months ago 30 pass, 2 fail - last update
8 months ago 31 pass - 🇧🇪Belgium dieterholvoet Brussels
I squashed some commits to make it easier to rebase this branch. The branch now applies to 2.x again.
- 🇮🇳India ankitv18
Phpunit tests are failing: https://git.drupalcode.org/issue/entity_clone-3058025/-/jobs/2022248#L81
Also pipeline should be green for every job( along with phpcs and phpstan) except phpunit next major as per the latest change in 2.x-dev
- Status changed to Needs work
4 months ago 3:51am 9 July 2024 - 🇺🇦Ukraine rowen92
I think passing $already_cloned variable would be really useful for modifying.
What do you think?
At least for cases when some extra referenced entities might be cloned.
In the current implementation we aren't able to know if a referenced entity was already cloned or not. - 🇺🇦Ukraine rowen92
And you guys are breaking current implementation of users which already use existing implementation of event dispatching.
I think you have to implement another type of event if you really want to have it dispatched for references.
- 🇬🇧United Kingdom jonathanshaw Stroud, UK
I think passing $already_cloned variable would be really useful for modifying.
What do you think?
I think you might be right, but possibly this would be better done in a follow-up as it would presumably change the event for all invocations, references or not.
I don't really understand why cloneEntity() gets called on an already cloned entity in the first place.
And you guys are breaking current implementation of users which already use existing implementation of event dispatching.
I think you have to implement another type of event if you really want to have it dispatched for references.
You're right that is a risk. I think the natural pattern developers woud expect is single event, called in both circumstances. So maybe the thing to do is to create a new event and deprecate the old one, so we're not left with 2 forever.
I'd like to see what the maintainers say about this.
- 🇺🇦Ukraine rowen92
Regarding passing $already_cloned array to EntityCloneEvent
I think it's possible without breaking any functionality.
See an example with an optional parameter.
EntityCloneEvent::__construct(...)public function __construct(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = [], array $already_cloned = []) {
Adding getter and setter methods would be great as well.
- 🇬🇧United Kingdom jonathanshaw Stroud, UK
I think it's possible without breaking any functionality.
I agree my concern is more with DX, trying to explain to developers working with the event what this means, why it is set or not set in this or that circumstance.