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.
Steps to reproduce
- Create some kind of block without label, fx a content block.
- Create a panel
- Try to use the search
- Observe a javascript error breaks the search (TypeError: attribute is null)
Desired outcome
It's possible to search in the blocks that has a label
Proposed resolution
Fix the JavaScript error so search isn't broken if block models doesn't have the attribute defined that is being search for.
Comment | File | Size | Author |
---|---|---|---|
#10 | 2938252-10.patch | 563 bytes | hchonov |
#2 | 2938252-1.patch | 543 bytes | googletorp |
|
Comments
Comment #2
googletorp CreditAttribution: googletorp as a volunteer and at Reveal IT commentedI have created a super simple patch, which changes null values into an empty string, ensuring the search works. The JavaScript looks to be built in a way, where it would be possible to search for any attribute defined in the JS model.
As search could be searching any attributes, making the default value "no label" seems like a poor option. Also this ensures search never breaks, as we know we that attributes is always a string. For me it also makes a lot of sense that you can't search for models missing the attribute being searched for.
Comment #3
MykolaVeryha CreditAttribution: MykolaVeryha commentedComment #4
MykolaVeryha CreditAttribution: MykolaVeryha commentedPatch for 4.4
Comment #5
MykolaVeryha CreditAttribution: MykolaVeryha commenteddfdf
Comment #6
MykolaVeryha CreditAttribution: MykolaVeryha commenteddfdf
Comment #7
MykolaVeryha CreditAttribution: MykolaVeryha commentedComment #8
berliner CreditAttribution: berliner commentedPatch in #2 applies properly and looks straight-forward enough to RTBC.
Comment #9
japerryComment #10
hchonov