Select Parents Automatically Not Working with Node Form Using Bootstrap 5

Created on 26 August 2025, 24 days ago

Module works great with Claro, but we have some user roles that never see the admin theme. They're using the front-end Bootstrap theme to create nodes. However, the "Select parents automatically" function does not work with the Bootstrap 5 theme, it only works with Claro. In both themes, the .form-item parent DIV has .select-parents class.

Not seeing any errors in the logs. All other module functions work, including the cascade function. Any help appreciated!

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States yospyn

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

Merge Requests

Comments & Activities

  • Issue created by @yospyn
  • First commit to issue fork.
  • Pipeline finished with Failed
    23 days ago
    Total: 148s
    #582092
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    @yospyn, please try this MR. Make sure to clear your cache (including browser cache so the updated JS file loads). For me, this works on a Bootstrap Barrio-based subtheme and continues to work with Claro. Please let me know if the same goes for you.

    The failed code quality tests shown in the MR pipelines are from the existing codebase and are not related to my patch.

  • Pipeline finished with Failed
    23 days ago
    Total: 145s
    #582211
  • Pipeline finished with Failed
    23 days ago
    Total: 149s
    #582212
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    andileco β†’ changed the visibility of the branch 3543115-select-parents-automatically to hidden.

  • πŸ‡ΊπŸ‡ΈUnited States andileco

    For some reason, GitLab wanted to apply my patch to the 8.x branch versus the 2.x branch. The MR that's showing now is the one to use.

  • πŸ‡ΊπŸ‡ΈUnited States yospyn

    @andileco 42.patch worked for me, "Select parents automatically" function works now in both Claro and BS5. Thank you!

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    I do not understand this issue.

    To set "Select parents automatically" one has to be an admin as it has to be set on the form display widget and which will require an admin working with the admin theme unless the users were given the role to administer the content type. If they were given the role to administer the content type I wouldn't understand why they will use a front end Bootstrap 5 theme to work on the admin backend instead of all the wonderful options available for an admin theme.

    I am using Barrio Bootstrap 5 theme for the front end and Gin as admin theme and I do not see this issue. The only behaviour I see which should be more like a feature request, is that for one to set "Select parents automatically" on the form display, the cardinality of the field has to be unlimited. If not unlimited, one cannot set "Select parents automatically" on the field. In our case we are using a location field which we want users to set their state and city and not more than one city and its state. We want 'Leaves only' setting meaning users will only select city and the state will be auto selected. If we set the field to unlimited to be able to set "Select parents automatically", then users can abuse the field by setting multiple cities and state and if we limit field to accept 2 values we will not be able to set "Select parents automatically". This should qualify as a separate 'feature request' issue.

    How I got around this was: I set cardinality to unlimited then set "Leaves only" and "Select parents automatically", then I went back to change cardinality to 2. This way I sneaked in "Select parents automatically" with a limited cardinality.

  • πŸ‡ΊπŸ‡ΈUnited States andileco

    Hi @chike! For our use-case, we do have some user roles who create and edit certain types of nodes, and it's a less disruptive user experience if they are not switched between an admin and front-end theme. I believe this patch will work with Claro, Gin, and Bootstrap, as it uses a more generic selector. So, it might be worth it for the maintainers to incorporate.

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    Hi @andileco I think I understand better now. The issue you are having (unlike in my case) is not in setting widget to "Select parents automatically" but in actually creating the nodes.

Production build 0.71.5 2024