Hi and thank you for this great module!
Some configuration entities offer a "duplicate" link in their action dropdown, like for example views. This would also help a lot for pathauto patterns. We're having many cases where the patterns are nearly the same (but differ in path a bit) for multilang sites.
A copy functionality would save a lot of time.
I created a fake screen for that:
That "duplicate" action should prepopulate a new entry with the values from the "cloned" one. Perhaps there is already a general solution for something like that in ctools or other modules like views?
I'd like to get some feedback. And perhaps someone has an idea or snippet? Thank you.
Comment | File | Size | Author |
---|---|---|---|
#9 | duplicate_operation-3000788-8.patch | 4.06 KB | jefuri |
| |||
#7 | duplicate_operation-3000788-6.patch | 3.99 KB | jefuri |
pathauto-duplicate.PNG | 43.02 KB | Anybody |
Comments
Comment #2
AnybodyComment #3
AnybodyComment #4
jefuri CreditAttribution: jefuri commentedAdded the duplicate option now. The way this patch works is dat the PathautoDuplicateForm extends the PauthautoEditForm. The only difference is that the original entity is duplicated and forced as a new entity, resetting the entity keys. This provides an add form that is prefilled with all the information from the original entity, but saving it is a new entity.
This way you can immediately do your changes like setting the language as well before saving the form.
Comment #5
jefuri CreditAttribution: jefuri commentedComment #7
jefuri CreditAttribution: jefuri commentedSomehow provided an empty patch file, my bad. Uploaded the correct one now
Comment #9
jefuri CreditAttribution: jefuri commentedTest failed because the duplicated pattern was used in other tests, added a delete to make sure this is not happening.
Comment #10
jefuri CreditAttribution: jefuri commentedComment #11
NitebreedThis looks great!
Comment #12
AnybodyGreat work, thank you for your implementation. RTBC +1
Comment #13
BerdirThanks, even has tests, so can't complain. entity.module now has a built-in replicate feature I think, but I'm trying to keep dependencies as small as possible here, hopefully can get rid of ctools at some point..
Comment #15
AnybodyThanks, that's a great helper! :)