Problem/Motivation

When on a project backlog page I get the following error...
TypeError: once is not a function

This prevents me from dragging tasks up or down and when I send the task to the board I get a post error.

Steps to reproduce

Add tasks to a project backlog and try to drag tasks or to post tasks
Visit the console in the code inspector and see the error message

/**
 * @file
 * Contains burndown.backlog.js.
 */
(function ($, Drupal, drupalSettings) {
  Drupal.behaviors.burndownBacklog = {
    attach: function (context, settings) {
      // Only do setup once.
      $('body').once('setupBacklog').each(function () {
        // Update sprint data on load.
        updateSprints();

        // We debounce the postback that saves the new sort
        // order, since users can change the order several
        // times in a row before getting it the way they want
        // it (and we only really need the final ordering).
        var reorder = debounce(function() {
          postSortOrder();
        }, 2000);

Line:9 burndown.backlog.js

$('body').once('setupBacklog').each(function () {
TypeError: once is not a function

TypeError: $(...).once is not a function
attac /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:9
Drupal.attachBehaviors/</core/misc/drupal.js?v=10.0.7:166
forEachself-hosted:203
Drupal.attachBehaviors/core/misc/drupal.js?v=10.0.7:162
<anonymous>/core/misc/drupal.init.js?v=10.0.7:32
listener/core/misc/drupal.init.js?v=10.0.7:20
domReady/core/misc/drupal.init.js?v=10.0.7:26
<anonymous>/core/misc/drupal.init.js?v=10.0.7:31
<anonymous>/core/misc/drupal.init.js?v=10.0.7:34

My Setup

Drupal Version
10.0.7
PHP Version
8.1.18
Database Version
5.7.36
Web Server
Apache/2.4.51 (Win64)

CommentFileSizeAuthor
#4 3366162.patch7.3 KBprabuela

Issue fork burndown-3366162

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

Vlooi Vlerke created an issue. See original summary.

vlooi vlerke’s picture

The same issue is on the project board page

Uncaught TypeError: $(...).once is not a function
    attach /modules/contrib/burndown/js/burndown.board.js?v=10.0.7:11
    attachBehaviors /core/misc/drupal.js?v=10.0.7:166
    attachBehaviors /core/misc/drupal.js?v=10.0.7:162
    <anonymous> /core/misc/drupal.init.js?v=10.0.7:32
    listener /core/misc/drupal.init.js?v=10.0.7:20
prabuela’s picture

Assigned: Unassigned » prabuela
prabuela’s picture

Assigned: prabuela » Unassigned
Status: Active » Needs review
StatusFileSize
new7.3 KB
prabuela’s picture

jeremylichtman’s picture

Hi @prabuEla, if you create the fix as a PR, I will merge it in.

Note that this will effect downwards compatibility. I will have to mark the project as 9.3 upwards as a result of this fix.

bharath-kondeti made their first commit to this issue’s fork.

bharath-kondeti’s picture

@jeremylichtman Updated the patch to PR. Please check.

jeremylichtman’s picture

Status: Needs review » Fixed

Merged the PR and created 1.0.32.

Note that this means the module is compatible with 9.3+ as a result.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.