User list widget : javascript error on other context than a node form

Created on 16 February 2025, 2 months ago

Problem/Motivation

When you use the user list widget, the javascript file included produces an error if you're not on a node edit page.

Steps to reproduce

  1. Install the tagify_user_list submodule
  2. Create an user entity reference field in an entity other than a node (for me is was on a private message thread for the private message module, which recommend the tagify module)
  3. Configure the field widget to use Tagify User List
  4. Navigate to the page with the entity form, you can see a console error (see attached image)

Proposed resolution

Test if $context.find('.node-form-author') is defined before calling a method on it.

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇫🇷France nishruu

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024