Doesn't work with Gin admin theme

Created on 23 January 2023, over 1 year ago
Updated 20 June 2024, 11 days ago

Problem/Motivation

As reported in โœจ Switch to Drupal once, Drupal 10 readiness Fixed Sadly it's not working with the Gin admin theme๐Ÿฅฒ
the submit button '.form-submit' is outside the main form that's the issue here. working fine with the Claro theme.

Proposed resolution

var $submit = $('.form-actions', context).find('.form-submit');
the submit selector works if we select the .form-actions' with the Gin theme.

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

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

Merge Requests

Comments & Activities

  • Issue created by @mandclu
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Worth noting that the fix was suggested by @vishnukumar in the original issue.

    Personally, I'm a little skeptical about indiscriminately selecting all form actions, which might not even be related to the form where the widget exists.

  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom psebborn

    I've created a patch and MR for this, following a similar line @vishnukumar's original suggestion.
    It is a bit heavy-handed, and I'm not a fan of having gin-specific code in the multiselect module, but needs must and I have a pressing to have *some* fix, which I'll share with you all :)

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom psebborn
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom psebborn

    Added an updated patch without IDE-specific cruft

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom aaron.ferris

    Had a look at this.

    Setup
    Drupal: 10.2.4
    Gin: 8.x-3.0-rc10
    Multiselect: 2.0.0-beta4 r
    Admin theme: Gin

    1. Basic page content type
    2. Add list type field
    3. Have several options
    4. Change the field widget to multiselect
    5. Add a basic page
    6. Interact with the multiselect, add some options
    7. Save the node

    With the patch applied, the multi select doesn't seem to save any value. With Olivero it does. Could be my local setup.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States ljwilson

    Looks like multiselect 2.0.0-beta4 r changed some var variables to constants. For the error above, try changing the const to let for the $submit in line 11 of multiselect.js (with the patch already applied, of course).

    That worked for me.

    I've attached a re-rolled version of #6 which includes this one-word change.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi, I've applied the MR !4 provided by @psebborn. The patch has been applied with no errors but it has not fixed the issue for multiselect. After applying the patch I'm unable to select any option from the select list and getting some console errors for the changes made on the /multiselect/js/multiselect.js file. If the list field is required then after applying the MR!4 patch the node is not being saved.
    I've attached the console errors screenshot for reference.

    I've also applied the patch provided by @ljwilson in comment #9 ๐Ÿ› Doesn't work with Gin admin theme Needs review . This patch has also applied with no errors but it has also not resolved the issue. After applying this patch the multiselect is not working as expected. Multiple list values are being added on Selected options field but on saving the node getting warning for the required field value if Required field option has been checked while creating field. After selecting multiple option from the select list, I have to click on any select list item to make the node save and the selected list item is only being saved for the field.

    Test on:
    Drupal: 10.2.5
    Gin: 8.x-3.0-rc11
    Admin Theme: Gin

  • Assigned to Tirupati_Singh
  • Status changed to Needs work 11 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hence, changing the status to Needs Work

  • Issue was unassigned.
  • Status changed to Needs review 11 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi, I've fixed the multiple-value selection in multiselect field widget for Gin theme. Please review the changes.

Production build 0.69.0 2024