New burndown swimlane reordering ajax request not saving

Created on 30 November 2024, about 1 month ago

Problem/Motivation

When updating and reordering the swimlanes on a new project, the console was showing errors coming from both JavaScript and PHP. Please see the code changes I made locally to fix the issue.

API changes

I changed the JS code by commenting out fallbackOnbody. As my browser would not allow me to order the swim-lane list.

 web/modules/contrib/burndown/js/burndown.swimlanes.js

        // Make the swimlanes sortable.
        new Sortable(document.getElementById('board'), {
          animation: 150,
         // fallbackOnBody: TRUE, <------ I removed this as it's throwing an error
          swapThreshold: 0.65,
          onSort: function (/**Event*/evt) {
            // Reorder tasks (debounced).
            reorder();
          },

In the SwimlaneController, the reorderBoard method on a POST request was returning a 500 error. Once I used the ->all() method, it fixed the problem.

web/modules/contrib/burndown/src/Controller/SwimlaneController.php

  public function reorderBoard(Request $request) {
    // Get our new sort order.
    $sort = $request->request->all('sort'); <------ I change this from ->get to ->all
    $new_sort = [];

    if (!empty($sort)) {

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia purencool

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

Comments & Activities

Production build 0.71.5 2024