"Field" entries not filtering for selected "Bundle"

Created on 9 February 2023, almost 2 years ago
Updated 16 March 2023, over 1 year ago

Problem/Motivation

On the "Edit abr configurtion" form, the "Field" select should only show available fields for the selected "Bundle", but all fields are shown. The JavaScript that should hide fields for other bundles is not functioning correctly.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Comments & Activities

Not all content is available!

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

  • Issue created by @lostcarpark
  • 🇮🇪Ireland lostcarpark

    This turned out to be three separate issues:

    1. Classes for Extra Field and Rights Type have changed.

      JS was selecting for ".form-item-extra" and ".form-item-rights-type". The classes now on the fields are ".js-form-item-extra" and ".js-form-item-rights-type". Updated class selectors to correct.

    2. JQuery "once" method no longer supported.

      The JQuery "once" method is deprecated since Drupal 9.2, and removed in 10.0. There is a new core/once library to take its place. Updated to use this.

    3. Hiding optgroups not supported in Safari.

      The JS code was hiding all optgroups except the current bundle. This worked in Chrome and Firefox, but is not supported in Safari. I have changed the JS to move all optgroups into an array, and add the required optgroup back to the select as needed. This should work in all browsers. Tested in Chrome/Firefox/Safari.

    I have bundled all of these changes into the D10 fixes under 📌 Automated Drupal 10 compatibility fixes Fixed .

  • 🇳🇱Netherlands Marceldeb

    Thanks a lot, i will create a new release after i did some testing!

  • Status changed to Needs review almost 2 years ago
  • 🇳🇱Netherlands Marceldeb

    Changes are added to the new 8.x-3.x branch because these changes will no longer work with Drupal 8.

    I did some basic testing on Drupal 9 and all seems to work fine. Would be nice to have some more testing done.

  • Status changed to Fixed over 1 year ago
Production build 0.71.5 2024