When trying to sort the order is not saved.

I also noticed in the log the following:

Warning: array_search() expects parameter 2 to be array, null given in Drupal\bootstrap\Utility\Attributes->hasClass() (line 92 of /var/www/html/themes/bootstrap/src/Utility/Attributes.php).

Using Drupal 8.1.1.

Let me know if you need more info.

CommentFileSizeAuthor
#2 classes-defined-in-array-2729935-2.patch966 bytesthtas

Comments

magick93 created an issue. See original summary.

thtas’s picture

Title: Sort order not saved » Sort order not saved when using bootstrap theme
Status: Active » Needs review
StatusFileSize
new966 bytes

This is causes by the way classes are defined inside the #attribute arrays in DraggableViewsField.php

Bootstrap will throw an error, and the the classes never make it the output, meaning the weights/ids/parents don't get saved and it also cause javascript errors when trying to drag and drop items.

See https://www.drupal.org/node/2786771

Attached is a patch to fix this

visabhishek’s picture

Status: Needs review » Reviewed & tested by the community

Patch#2 Working fine for me with Bootstrap 8.x-3.0-rc2.

jeff veit’s picture

Patch works fine for me too.

David_Rothstein’s picture

Note: I have a Drupal 7 version of this fix in the linked issue, although it sounds like the practical effect of the problem is worse in Drupal 8.

stellarvisions’s picture

Testing this on a Pantheon site.
the patch in #2 cleared the errors but the order is still not saved.
Drupal 8.3.6 and module Version: 8.x-1.0

  • thtas authored 23ecef9 on 8.x-1.x
    Issue #2729935 by thtas: Sort order not saved when using bootstrap theme
    
istryker’s picture

Title: Sort order not saved when using bootstrap theme » Error when using bootstrap theme
Status: Reviewed & tested by the community » Fixed

Title is confusing. The problem is the error message. Patch #2 fixes this. Confirmed by 3 people. Committed.

@stellarvisions please open a new issue.

Status: Fixed » Closed (fixed)

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