Autocomplete URL and Label swapping does not work in Claro admin theme

Created on 26 June 2020, almost 5 years ago
Updated 6 February 2025, about 2 months ago

Core: 8.9.1
Theme: Claro
Distribution: Acquia Lightning 4.1.5

When using the Claro admin theme, the Javascript that handles swapping the 'label' and 'url' values from the JSON returned by the autocomplete controller does not load.

Thus where normally the Label field has a human-readable label, now the Label field has the URL and the URL field is empty.

After changing the admin theme to Bartik and re-loading the node add page, the Javascript gets loaded and the library works.

Interestingly, with Claro admin theme, the Javascript that runs on the admin/structure/linked_data_endpoint config entity pages works as normal, so it's just on the node edit page that the Javascript is not loading.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada alxp Charlottetown, PE

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada whikloj

    I am experiencing this behaviour on a new site with Drupal 10.4.1.
    Typing in the value field performs the autocomplete search, but clicking on an option puts the URL in the value field. The Definition URI field remains blank.

    I have only experienced this on the node edit page, and it only occurs until I add a second instance of the field (for a multi-valued field).

    Then both the original and the added fields behave properly.

    It appears that the included javascript (subject_autocomplete.js) is not run when the page is initially loaded. Once I click the "Add another item" button it then runs for the original and new fields.

    I have tried with both the Claro and Olivero as the admin field, it is the same for both. I'm trying to figure out why it doesn't run at the initial page load.

  • 🇨🇦Canada alxp Charlottetown, PE

    Hi Jared,

    I was also able to reproduce what you are experiencing in Drupal 10 and Drupal 11, this seems to be a new occurrence.

    I have looked further into how I was doing the swapping with JavaScript and on further reading I believe the correct way to do what I want is via AJAX.

    I'll push up a fix to the issue fork shortly.

    Thanks for catching this and reporting.

  • Merge request !4Resolve #3155210 "Autocomplete url and" → (Merged) created by Unnamed author
  • 🇨🇦Canada alxp Charlottetown, PE

    Cut release tag 1.1.1 with a fix for this and cleaning up how exceptions are handled.

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

Production build 0.71.5 2024