Make backlog and sprint areas sortable.

Created on 10 July 2023, over 1 year ago
Updated 20 July 2023, over 1 year ago

Problem/Motivation

On Project Backlog pages I get the following error that prevents task to be sorted (Drag and Dropped)

Uncaught ReferenceError: TRUE is not defined
    attach /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:30
    jQuery 2
    attach /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:9
    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
    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
burndown.backlog.js:30:13

/modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:30

        // Make the backlog list sortable.
        for (var i = 0; i < backlogSortables.length; i++) {
          new Sortable(backlogSortables[i], {
            filter: '.filtered', // i.e. for sprint card
            group: 'swimlane',
            animation: 150,
            fallbackOnBody: TRUE, <--Uncaught ReferenceError: TRUE is not defined

Steps to reproduce

Visit /burndown/backlog/(project)

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇿🇦South Africa vlooi vlerke

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

Comments & Activities

  • Issue created by @vlooi vlerke
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India shailja179 India

    @Vlooi Vlerke,

    This patch will fix the issue.Please try this.

  • 🇨🇦Canada jeremylichtman

    Hi @shailja179, if you make this a PR, I'll happily merge it and add a new version.

  • 🇿🇦South Africa vlooi vlerke

    The patch fix the sort issue but it does not save the sort weights after a set time.


    Uncaught ReferenceError: NULL is not defined
    later /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:233
    setTimeout handler*attach/debounce/< /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:239
    onSort /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:33
    W /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    U /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    _onDrop /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    handleEvent /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    h /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    _onDragStart /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    h /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    _triggerDragStart /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    o /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    _prepareDragStart /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    _onTapStart /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    h /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    Bt /core/assets/vendor/sortable/Sortable.min.js?v=1.15.0:2
    attach /modules/contrib/burndown/js/burndown.backlog.js?v=10.0.7:26
    jQuery 2
    attach /contrib/burndown/js/burndown.backlog.js?v=10.0.7:9
    attachBehaviors /core/misc/drupal.js?v=10.0.7:166
    attachBehaviors /core/misc/drupal.js?v=10.0.7:162
    /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
    /core/misc/drupal.init.js?v=10.0.7:31
    /core/misc/drupal.init.js?v=10.0.7:34

    The same bug is in burndown.board.js

    fallbackOnBody: TRUE,

    and

    Uncaught ReferenceError: NULL is not defined

  • @shailja179 opened merge request.
  • @shailja179 opened merge request.
  • 🇮🇳India shailja179 India

    Added merge request.Plz check

  • 🇨🇦Canada jeremylichtman

    I've merged the PR, but haven't yet created a new release.

    @vlooi-vlerke do you still see the sort issue after clearing browser cache? The old js could be cached still.

  • 🇿🇦South Africa vlooi vlerke

    The patch fix the sort issue but it does not save the sort weights after a set time.

    Error message: Uncaught ReferenceError: NULL is not defined

    see comment #5 🐛 Make backlog and sprint areas sortable. Needs review

  • 🇨🇦Canada jeremylichtman

    The debounce function is failing on your end, but I'm not sure why. I haven't seen that happen before.

    What browser / version are you using?

  • 🇿🇦South Africa vlooi vlerke

    I use the latest Firefox 115.0.2 (64-bit)

    I tested Microsoft Edge Version 114.0.1823.82 (Official build) (64-bit) and got the same error message in the console.

    Uncaught ReferenceError: NULL is not defined at later (burndown.backlog.js?v=10.1.1:233:13)
    later @ burndown.backlog.js?v=10.1.1:233
    setTimeout (async) (anonymous) @ burndown.backlog.js?v=10.1.1:239
    onSort @ burndown.backlog.js?v=10.1.1:33
    W @ Sortable.min.js?v=1.15.0:2
    U @ Sortable.min.js?v=1.15.0:2
    _onDrop @ Sortable.min.js?v=1.15.0:2
    
  • 🇨🇦Canada jeremylichtman

    Another issue has just been added for this: #3375705.

    I suspect something has changed with how "each" works. Alternatively could be this change to "once": https://www.drupal.org/project/drupal/issues/3183149

    Hoping one of the other maintainers can take a look. Swamped right now.

  • 🇨🇦Canada jeremylichtman

    Actually #3375705 is a different problem, and I have added a fix for it.

  • 🇨🇦Canada jeremylichtman

    And...

    Right after saying I was swamped, I found the bug.

    Code had "NULL" rather than "null".

    Added 1.0.37 with the fix. @vlooi-vlerke, hope this helps.

Production build 0.71.5 2024