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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

googletorp created an issue. See original summary.

googletorp’s picture

Status: Active » Needs review
FileSize
543 bytes

I 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.

MykolaVeryha’s picture

MykolaVeryha’s picture

Patch for 4.4

MykolaVeryha’s picture

dfdf

MykolaVeryha’s picture

MykolaVeryha’s picture

berliner’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #2 applies properly and looks straight-forward enough to RTBC.

japerry’s picture

Status: Reviewed & tested by the community » Closed (outdated)
hchonov’s picture

Status: Closed (outdated) » Needs review
FileSize
563 bytes