Issue with Number settings for individual header. Uncaught RangeError: once ID must not be empty or contain spaces

Created on 13 December 2024, 9 days ago

Problem/Motivation

The list of headers at Numbering settings should populate accordingly when Header minimum level or Header maximum level is changed at Header settings.

Steps to reproduce

  1. Go to Table of contents types (admin/structure/toc).
  2. Then select any one of the TOC type to edit, Deafult for example(admin/structure/toc/manage/default).
  3. Try changing Header minimum level or Header maximum level and see if list of headers are populating accordingly at Numbering settings.
  4. Also, check the Console where we can see the JS Error:
    Uncaught RangeError: once ID must not be empty or contain spaces


Proposed resolution

The issue is caused by the missing ID in the once method. It can be resolved by adding any unique id to once. In toc_api/js/toc_type.js, change the following:
Before
$(once('.js-toc-type-options-header-min, .js-toc-type-options-header-max', context)).change(toggleHeaders);

After
$(once('ANY_UNIQUE_ID', '.js-toc-type-options-header-min, .js-toc-type-options-header-max', context)).change(toggleHeaders);

🐛 Bug report
Status

Active

Version

1.5

Component

Code

Created by

🇳🇵Nepal sandeshyadav Dhangadhi, Kailali

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