Problem/Motivation

When loading a page with colorbox, the following JS error appears in the browser console:

Uncaught TypeError: $(...).once is not a function
    at Object.attach (colorbox.js?v=9.4.8:30:10)
    at drupal.js?v=9.4.8:27:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=9.4.8:24:34)
    at drupal.init.js?v=9.4.8:29:12
    at HTMLDocument.listener (drupal.init.js?v=9.4.8:17:7)

inspecting the Object attach indicates that it comes from /modules/contrib/colorbox/js/colorbox.js?v=9.4.8

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 3322529-4.patch275 bytesadil_siddiqui

Issue fork colorbox-3322529

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kwfinken created an issue. See original summary.

anjaliprasannan’s picture

Hi kwfinken,
Please check the solution below.

Proposed solution:


Replaced core/jquery.once with core/once in colorbox.libraries.yml file and also make required changes in colorbox.js as per https://www.drupal.org/node/3158256

This should fix the issue.

Adil_Siddiqui made their first commit to this issue’s fork.

adil_siddiqui’s picture

Status: Active » Needs review
StatusFileSize
new275 bytes

Patch created

prashant.c’s picture

Status: Needs review » Needs work

Make all the required changes as per this change record https://www.drupal.org/node/3158256

arisen’s picture

Status: Needs work » Closed (cannot reproduce)

This issue seems outdated.
The js issue has been already handled in https://www.drupal.org/project/colorbox/issues/3286579 and added in 2.0.0 release. Functionality is working as expected.
Please re-open the issue incase if it's still reproducible.