Problem/Motivation

The Copy link menu item in the Social media menu carries an inline hx-on-click handler. Drupal core 11.4.10 strips hx* and on* attributes from rendered links, so the item renders without it and does nothing.

The functional test for the footer looks for a[hx-on-click], so "Footer is missing the copy page link control" fails 28 scenarios on every 1.0.x merge request, for example pipeline 1003253 on !84.

Steps to reproduce

  1. Install The Rightup on Drupal core 11.4.10.
  2. Click the chain link icon in the footer. Nothing is copied.
  3. Run tests/features/01-website-base-requirements/01-06-front-end-pages.feature.

Proposed resolution

  • The menu link keeps role: button and gains a copy-link class instead of the inline handler. Classes are kept by core.
  • The HTMX handler (hx-on:click) is added by the theme template to the link with that class: #3631079.
  • The footer step checks a.copy-link[hx-on\:click].
  • hx-on uses eval, so a strict Content Security Policy needs 'unsafe-eval' in script-src.

An existing site keeps its old menu link, because default content is not imported again. Update it once with:

drush php:eval '$l = \Drupal::service("entity.repository")->loadEntityByUuid("menu_link_content", "870f0549-cf5e-5a90-ac55-d68d3318fd19"); $o = $l->link->first()->options; unset($o["attributes"]["hx-on-click"]); $o["attributes"]["class"] = array_values(array_unique(array_merge((array) $o["attributes"]["class"], ["copy-link"]))); $l->link->first()->options = $o; $l->save();'
drush cr

No update hook: a recipe has none, and the change is one menu link.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ✅ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ❌ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ❌ Release

User interface changes

  • The footer Copy link copies the page address again, with the theme change.

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • The footer Copy link works on Drupal core 11.4.10 and later. Existing sites update the menu link once (see the issue).

AI-Generated: Yes. Drafted with Claude Code and reviewed before posting.

Issue fork rightup-3631078

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

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes

  • rajab natshah committed 2b6a3a75 on 1.0.x
    fix: #3631078 Mark the footer Copy link with the copy-link class for the...
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Status: Needs review » Fixed
Issue tags: +rightup-1.0.6

✅ Released rightup-1.0.6

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.