- πΊπΈUnited States scottsawyer Atlanta
I am running into this problem with exposed forms in blocks, but it only surfaced when I updated to D 9.5. I was using views_block_filter_block because my views were block displays and I needed the exposed filters in separate blocks. It seems like the D9 update superseded views_block_filter_block, changing where the attributes were attached.
I patched with the MR, but it doesn't seem to be working, exposed form class attributes are still being moved to the containing block. If you have a custom block template for blocks containing views exposed forms that don't output all of the attributes, it breaks the ajax as well as the CSS in my case.
I worked around the issue by refactoring my template structure, I was fortunate to find a relatively simple solution, unfortunate that it cost me half a day to discover the problem and fix it.
- πΊπΈUnited States dcam
Based on comment #10 I checked to see if this is still an issue in Drupal 11. It is. The same problem with the Search block form's
data-drupal-selector
attribute being applied to the block wrapper still exists.There was no need to make a new test for this. The test created for the related original issue, #2171269: Handle block rendering's #attributes correctly (fixes in-place editing of custom blocks) β , can be adapted to check the change.
MR 1402 was broken. I don't know why some of the additional changes in it were made because they aren't well documented. The change from
#atrributes
to#wrapper_attributes
was lost. I think that's the reason for the confusion in the more recent comments. I'm sure that it did stop doing anything to fix the issue. Since it's difficult or impossible to rebase MRs for old Core versions anyway, I hid the branch and created a new one for D11 restarting from the #5 patch. We'll see if this causes other tests to fail. - πΊπΈUnited States dcam
I didn't expect it to pass. I assumed that something else was probably relying on the attributes as they were. Oh well.
I made a change record: https://www.drupal.org/node/3525287 β .
- πΊπΈUnited States dcam
I worked on this issue over the weekend not realizing that I'd experience it first-hand two days later. I've been adding inline styles to the
.views-exposed-form
class. Then I navigated to a different page where the exposed form is in a separate block. The class was bubbled up to the block wrapper, causing the block heading to be displayed in-line with the form as shown in the image below. - πΊπΈUnited States smustgrave
This seems like it could be an immediate breaking change if I had css written for before.