Problem/Motivation
When creating a new template it will already get the values from the default template, which is great.
But sometimes cloning another existing template would be very handy.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork swiper_formatter-3572749
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyGood idea for better sbx!
This should be quite simple to achieve, the functionality already exists in core and is used in many other contrib modules, e.g. pathauto:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
https://git.drupalcode.org/project/pathauto/-/blob/8.x-1.x/src/Form/Patt...
Comment #4
thomas.frobieterComment #5
thomas.frobieterDone. I tested the cloning regular and breakpoint templates, and everything seems to be working fine.
Comment #6
anybodyThanks @thomas.frobieter that looks and works great!
Still the path differs and should be unified with the existing paths.
Regarding the form and id change the maintainer should decide if it's okay like this. Great work!
Comment #7
bbu23Hey guys, thx for reporting this issue and proposing a solution!
We'll review as soon as we get the chance (when the status is ready).
Comment #8
nk_ commentedGreat idea, thank you! Also, at the first glance, code changes seem neat.
One consideration, I would say that the path shall be like this, same as the other entity crud paths:
duplicate-form = /admin/structure/swiper-formatter/{swiper_formatter}/duplicateIs there any particular reason to use
/admin/config/content/instead of/admin/structure/prefix?Comment #9
anybodyNo, I commented the same, see MR.
Comment #10
nk_ commentedYeah, I got that but rather double-check with Thomas too, otherwise definitely it should be canonical (same base route).
Comment #11
anybodySorry, @thomas.frobieter just told me that not the new path, but the other existing paths in
src/Entity/SwiperFormatter.phpare wrong and he's correct!Should be fixed in a separate bug report.
Comment #12
thomas.frobieterright, see:
https://git.drupalcode.org/project/swiper_formatter/-/blob/cb98ae857cc3121dcd710eba94d06f18af254511/swiper_formatter.routing.yml
So /admin/config/x is correct, /admin/structure is wrong.
Should I create another issue to fix the paths in the SwiperFormatter.php?
Comment #13
nk_ commentedOh, yes, yes! No new issue I'd say.
Comment #14
nk_ commentedMeaning, a new issue with path changes may be, but is also delicate at this moment *fo shur* so maybe after @bbu23 and I manage to make time to review. Plan?
Comment #15
thomas.frobieterSure, take your time, this definetly has no high priority - just a nice to have feature :)
Comment #16
bbu23Since this is a feature request, and the finding is a bug report + now that we're trying to stick to conventional commits and semver, pls create a separate issue for the paths, link it to this one and I'll review that first. Thanks
Comment #17
anybodyHere we go: #3573757: Fix wrong paths in entity definition (src/Entity/SwiperFormatter.php)
Comment #18
bbu23Cool, thx @anybody!
Comment #19
bbu23The related issue has been fixed. The work on this ticket can resume.
Comment #21
bbu23Comment #24
bbu23Ty for your contribution!
It will be available in version 2.1.0.
Comment #26
anybodyGreat @bbu23 thank you!