Problem/Motivation

Currently the route for cloning a node inherits the overridden value from the Template, but not every node may have been marked as a Template, which makes the indication "Create from template ..." confusing. Could we split up the labelling amongst the two?

Steps to reproduce

  1. Install the module and try to create a clone from a node.
  2. See "Create from teplate ..." label for cloning nodes

Proposed resolution

Do not override quick_node_clone func

Remaining tasks

Review and test.

User interface changes

Distinguished UI for cloning and template node creation

API changes

N/A

Data model changes

N/A

Command icon 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

baikho created an issue. See original summary.

baikho’s picture

Version: 1.2.0 » 1.0.x-dev
Assigned: baikho » Unassigned
Status: Active » Needs review
baikho’s picture

a.dmitriiev made their first commit to this issue’s fork.

a.dmitriiev’s picture

Status: Needs review » Needs work

I have opened the new MR from the same repo, but I have created the branch out of 1.0.x (of the fork repo), because it conflicts with the origin.

The branch was also rebased on the latest changes. Let's continue in that MR.

a.dmitriiev’s picture

Status: Needs work » Needs review

I have also added update hook to restore quick node clone setting to its default value and make sure that 'Clone of' is not added to the title for content template form.

hanan alasari’s picture

Assigned: Unassigned » hanan alasari
hanan alasari’s picture

StatusFileSize
new466.5 KB

Tested MR !11 on Drupal 11.x (DXP profile, D11.1.x, PHP 8.3)

Automated tests (7/7 pass):
- Template list page shows all templates
- Template tab appears on source node
- /template/{node}/quick_clone shows "Create from template [title]" — no "Clone of" prefix
- /clone/{node}/quick_clone still shows "Clone of [title]" — default behavior preserved
- Template picker links now use /template/{node}/quick_clone (not the old quick_node_clone route)
- "Created from" link visible on node edit form
- Delete warning when deleting a source node with templates

One observation: hook_menu_local_tasks_alter hides tabs for quick_node_clone.node.quick_clone but not for the new
content_templates.node.quick_clone route — tabs may appear when creating from a template. Worth checking if this is
intentional.

Video attached.

hanan alasari’s picture

Status: Needs review » Reviewed & tested by the community
hanan alasari’s picture

Assigned: hanan alasari » Unassigned
hanan alasari’s picture

Assigned: Unassigned » hanan alasari
hanan alasari’s picture

Also fixed hook_menu_local_tasks_alter to hide tabs for the new content_templates.node.quick_clone route as well — pushed to
the same branch.

hanan alasari’s picture

Assigned: hanan alasari » Unassigned

a.dmitriiev’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.