Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Would be useful to also have an entity operation on e.g. admin/content that allows to duplicate an entity.
Comment | File | Size | Author |
---|---|---|---|
#18 | interdiff-18-16.txt | 803 bytes | mbovan |
#18 | 2900862-replicate-operation-18.patch | 3.54 KB | mbovan |
| |||
#16 | interdiff-16-14.txt | 2.42 KB | mbovan |
#16 | 2900862-replicate-operation-16.patch | 3.55 KB | mbovan |
#14 | interdiff-13-14.txt | 678 bytes | bucefal91 |
Comments
Comment #2
DiDebruSubscribe.
Comment #3
DiDebruI tried to put an operation link to the view but the Url::routeMatch(); give me
worked :)
Comment #4
casey CreditAttribution: casey at SWIS commentedComment #5
casey CreditAttribution: casey at SWIS commentedComment #6
slydevil CreditAttribution: slydevil commentedThis patch no longer applies cleanly...need to re-roll.
Comment #7
slydevil CreditAttribution: slydevil commentedComment #8
slydevil CreditAttribution: slydevil commentedThis patch requires the patch from #2904662 first.
Comment #9
slydevil CreditAttribution: slydevil commentedComment #10
slydevil CreditAttribution: slydevil commentedAll good!
Comment #11
Berdirdoes this really make sense? I don't want to be redirected back to the current page, I most likely want to edit the entity that I just duplicated like with the tab?
Should also have tests now that we have branch test enabled. And I'm not quite sure yet if this really makes sense to have by default everywhere.
Comment #12
BerdirComment #13
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedI addressed #11 and wrote a test.
Comment #14
bucefal91 CreditAttribution: bucefal91 at Ocelot commentedHello guys!
I am just willing to make a small adjustment in the latest patch related to UX. I think Berdir meant a bit different thing in his #12 comment (at least I understood it differently): We are not willing set up any destination at all so the replicate form in its submission handler naturally would redirect us to the just created (replicated) entity. If we place the destination and point it to the source of replication (like patch #13 does), it produces poor UX -- you see a message of successful replication but the entity you see on your screen is the old (without this " (copy)" prefix) and it creates a feeling of something going wrong.
So I am unsetting the 'destination' from the "replicate" operation. But there's one extra problem. If you just unset it and then use the "Operations" dropdown button in any view. Many admin views enable the "Include destination" checkbox so user is taken back to the view. I do not think this is the case for the "replicate" operation where the admin user is likely to need to further edit the replicated entity. So just to make sure the EntityOperations views field does not inject its undesired (in this specific case of "replicate" operation) destination, I am setting it to NULL.
In this adjusted patch I am attaching I do confirm replicating from an operation dropdown in a view still takes you to the replicated entity.
Oh, and there was a double new line in the patch #13, which I took care of too.
Comment #15
BerdirYes, that makes more sense, it shouldn't redirect to the entity that is being cloned.
We should also improve the test a bit and not just assert a 200 response but also that we're on the correct page and possibly also the confirmation message.
Comment #16
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedImproved tests and addressed #15.
Comment #18
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedFixed tests.
Comment #20
BerdirCommitted.