Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
The Collapsiblock doesn´t work out of the box with a Bootstrap subtheme for me, so I would like to force the CSS Selectors (btw link to appearance settings page is not working on admin/config/user-interface/collapsiblock page (links to /adadad )
The problem is that the values set on the appearance settings page fot the CSS Selectors are not saved. Is this a bug?
Btw. shouldn´t the default values be:
Block
div.block
Title
:header:first
Block content
div.content
or are the labels wrong?
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff-2-3.txt | 1.26 KB | tanc |
#3 | selectors_not_saved-2946105-3.patch | 2.87 KB | tanc |
#2 | selectors_not_saved-2946105-2.patch | 1.96 KB | tanc |
capColaps.jpg | 25.32 KB | bolecha |
Comments
Comment #2
tancThis should fix it. Not sure if there is a better way to let the form alter know which theme it is editing?
Comment #3
tancSome more incorrectly named variables fixed.
Comment #4
bolecha CreditAttribution: bolecha commented#3 works for me as far as saving the Collapsiblock Selectors! Thank you, tanc.
Unfortunately the collapsiblock is not working 100% correctly.
The selected block collapse behavior is not saved :(
Block collapse behavior
0 None.
0 Collapsible, expanded by default.
x Collapsible, collapsed by default.
0 Collapsible, collapsed all the time.
The block is collapsible but is always displayed expanded on loading the page.
En Chrome Console an error is displayed:
Uncaught TypeError: $(...).find(...).size is not a function
at HTMLElement. (collapsiblock.js:92:18)
at Function.each (jquery.min.js:2:2713)
at r.fn.init.each (jquery.min.js:2:1001)
at Object.attach (collapsiblock.js:23:7)
Drupal.attachBehaviors (drupal.js:25:11)
at (drupal.init.js:16:5)
at HTMLDocument.t (ready.min.js:4:381)
collapsiblock.js 92: if (!$(this).find('a.active').size() || activePages === 1) {
Should I open a new issue?
Thank you very much for your help, tanc!
Comment #5
bolecha CreditAttribution: bolecha commentedI have substituted the size() method by the length property in collapsiblock.js (92 and 97) and it seems that the collapsiblock is working ok now.
http://api.jquery.com/size/
The .size() method is deprecated as of jQuery 1.8. Use the .length property instead.
Comment #6
darvanen@bolecha, I have fixed those issues in the 8.x-2.x module, would you try that one out and open a separate issue if it persists?
Comment #8
darvanenThanks for the patch @tanc.
Comment #9
bolecha CreditAttribution: bolecha commentedThank you very much Darvanen.
The 8.x -2.0-beta 1 module is almost working.
When I am logged in it works fine!
When I access the web as anonymous user the block is not collapsible
En Chrome Console an error is displayed:
Uncaught TypeError: $(...).once is not a function
at Object.attach (collapsiblock.js?p7sv99:12)
at drupal.js?v=8.5.3:25
at Array.forEach ()
at Object.Drupal.attachBehaviors (drupal.js?v=8.5.3:22)
at drupal.init.js?v=8.5.3:16
at HTMLDocument.t (ready.min.js?v=1.0.8:4)
(collapsiblock.js?p7sv99:12): $('.collapsiblock').once('collapsiblock').each(function () {
Should I open a new issue?
Comment #10
darvanenYes please @bolecha, that is entirely unrelated to this issue.
Comment #11
bolecha CreditAttribution: bolecha commentedOk @Darvanen. Thank you very much for your help.
Opened new issue:
https://www.drupal.org/project/collapsiblock/issues/2966596