The better_parent.menu.js file is not attached to the page

Created on 30 May 2023, over 1 year ago

Problem/Motivation

After installing the module the link on the Menu field is not displayed. The better_parent.menu.js file is not on the page.

Steps to reproduce

Install the module using Drupal 9. Version tested: 9.5.5

Proposed resolution

Investigate the attachment of the library on the Node edit page to make sure it will be included properly.
The hook better_parent_form_alter() is called, but the line below is not working.
$form['scheduler_settings']['#attached']['library'][] = 'better_parent/better_parent';

🐛 Bug report
Status

Needs review

Version

9.4

Component

Code

Created by

🇧🇷Brazil adrianopulz Florianópolis

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

Comments & Activities

  • Issue created by @adrianopulz
  • 🇧🇷Brazil adrianopulz Florianópolis
  • 🇧🇷Brazil adrianopulz Florianópolis

    I've created this patch changing the way the module adds the library to the form. I also changed the hook to a more specific one that will include the script only for Node forms instead of any form. Adding the library to the main's form ['#attached'] value make the trick. It worked for me and the "(browse)" link start to be displayed in the Menu field.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇧🇷Brazil adrianopulz Florianópolis
Production build 0.71.5 2024