Doesn't work with Gin admin theme

Created on 23 January 2023, almost 2 years ago
Updated 29 August 2024, 4 months 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.

Steps to reproduce issue:

  1. Install the module and enable it by visiting the URL /admin/modules.
  2. Add a field of type list in a content type by visiting the URL /admin/structure/types/manage/{content_type}/fields and allow Unlimited value to be saved.
  3. Now visit the Manage form display of the content type.
  4. Now under the Widget column for the previously created field select Multiselect from the dropdown list.
  5. Go to node add page /node/add/{content_type} and select multiple values from the list for the above field

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

RTBC

Version

2.0

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

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 about 1 year 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 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hence, changing the status to Needs Work

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

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

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

    Hi, there seems to be a regression with this patch after some recent updates:

    Drupal: 10.3.0
    Gin: 8.x-3.0-rc12
    Admin Theme: Gin
    Multiselect: 2.0.0-beta3 or 2.0.0-beta4

    I tested the patch in #9 but it also didn't resolve the original issue. No console errors, however, I'm not using Big Pipe on my site.

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

    +1 for #11. I applied the MR as a patch and it fixed the issue saving multi-select values using the Gin admin theme.

    Drupal: 10.3.0
    Admin Theme: Gin 8.x-3.0-rc12
    Multiselect: 2.0.0-beta4

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    I'd be OK saying any BigPipe issues could be handled separately. Anyone ready to stand up and mark this as RTBC?

  • Status changed to Needs work 5 months ago
  • Hi @Tirupati_Singh,
    I've successfully reproduced the issue on my local setup. I'm running a D10.3.1 instance, and tested the same with latest version of the gin theme(3.0.0-rc13). Though the patch got applied cleanly, but unfortunately seems like its also not resolving the issue, rather its coming up with a lot of console errors! Before applying the patch, at least we were able to see the list of selected items on the "Selected Options" area, but after applying patch as the console errors are occurring, hence its preventing that functionality also. Apart from that, there seems to be some rendering issue with this widget. When using multiselect widget, the field is not even getting rendered, so I think we've to fix that also over here!
    I'm attaching a before and after screenshots for quick reference!

    On a side note: I'll be great if you can update the issue summary with proper steps to reproduce, as it'll help future contributors to reproduce and test the issue easily!

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

    I reconfirmed patch #6 works, but only with gin:3.0-rc9 and multiselect:2.0.0-beta2. The latest patch wasn't working with gin:3.0-rc13 and multiselect:2.0.0-beta4, if that helps. FYI, I had to downgrade gin_lb in order to install gin rc9.

    Using Drupal 10.3.2

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi @sourojeetpaul, I've fixed the console errors issues and now multiselect field value is being rendered after saving the node. Attaching the after-fixes screenshots for your reference. I've also updated the issue summary. Please review the changes.

    Thanks

  • Hello there,
    I can see all the threads have been resolved now, and on checking out to the branch the issue is getting resolved.
    But I found some discrepancies on the forked repo. The forked repo which is showing up to date with remote upstream is containing only the 2.0.0-beta1 and 2.0.0-beta2 tags, whereas the actual repo has 2.0.0-beta4 tag as its latest, so on applying the patch with the composer installed module though the patch is getting applied cleanly, but the functionalities are not working at all. So I think first we have to sync the forked repo with the remote repo, to get the all latest changes which have already been made and released as a new version, and then on top of that this issue should be addressed, so as to fix the issue on the absolute latest version.
    As the changes made by @tirupati_singh is done on top this repo's commits hence its working fine on that, I'm attaching a screenshot of the same. Still keeping the issue at NW so that we can sync both of them as rework on the issue by updating the MR.

  • Status changed to Needs work 4 months ago
  • Pipeline finished with Success
    4 months ago
    Total: 164s
    #265979
  • Pipeline finished with Success
    4 months ago
    Total: 173s
    #265996
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi, I've synced the forked repo and fixed the console errors encountered after syncing the forked repo. I've attached the screenshots for your reference. Please review the MR changes.

  • Status changed to RTBC 4 months ago
  • Hi @tirupati_singh,
    Thanks for the quick action, I can confirm now the issue have been resolved properly with the provided MR. And on merger of the that the forked repo and its upstream will be synced. Hence moving this to RTBC++
    Attaching screenshot for your reference!

Production build 0.71.5 2024