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.
I noticed an issue with Masonry where it was registering FALSE / NULL from PHP as empty, specifically for the isRTL js setting. On output that leaves a property that's undefined which breaks js as a syntax error --
isRTL:
});
Other items on output typecast as int and I'm not sure if they are doing this to solve this issue or not but it does. To be safe against other possible defaults (particularly from Views imports) I've typecasted everything in this patch for all outputs.
Comment | File | Size | Author |
---|---|---|---|
#1 | masonry-typecast-booleans-for-js-1942824-1.patch | 3.56 KB | btopro |
Comments
Comment #1
btopro CreditAttribution: btopro commentedComment #2
sluceroI was having this same issue and the patch fixed it perfectly. After reviewing the patch it looks like a straight-forward fix and a good solution.
Thanks @btopro!
Comment #3
davidfells81@gmail.com CreditAttribution: davidfells81@gmail.com commentedI just made these changes myself and came to check the issue queue to add an issue if there was not one. +1 to this, definitely fixes an issue breaking my site!
Comment #4
vzblk CreditAttribution: vzblk commentedI see javascript error when try to use this view as exported and imported. By default FALSE converted to empty. So I see
isResizable: ,
isFitWidth: ,
in the initiaization script.
Please apply this patch to the project.
Comment #5
BWPanda CreditAttribution: BWPanda commentedThanks all! Committed: http://drupalcode.org/project/masonry.git/commit/f753908