In my setup the attributes array already contained some classes.
ctools updates the attributes array, assuming that it does not yet hold any classes.

A small patch merges defined classes from the attributes array into the classes array, before any processing begins.

Comments

thierry.beeckmans created an issue. See original summary.

davemybes’s picture

Status: Needs review » Reviewed & tested by the community

Just ran into the same issue when updating to 1.10. In my case, my main menu block lost the block-main-menu class and broke my menu. The patch above works great.

spuky’s picture

Is this a Duplicate of https://www.drupal.org/node/2645612 ??? Patch merges classes at a diffrent location ???

thierry.beeckmans’s picture

It certainly looks like it. Because you've pointed that issue out, I've took the opportunity to test both those patches from issue https://www.drupal.org/node/2645612, but they still address some issues.

Function ctools_process runs logic to add and / or remove classes, in their patches the logic is still executed before the attributes array classes merges with the classes array. It is possible that classes are removed from the classes array, but in case they are also set in the attributes_array class, these classes stay in the game.

It certainly makes sense to merge both arrays, but it must happen early, before any other logic is executed.
This patch is quite simple and happens early enough.

thierry.beeckmans’s picture

StatusFileSize
new547 bytes

Updated the patch according to the standards.

yazzbe’s picture

I've applied the patch #5, but in views the custom classes on a row are only applied to the first row, instead of all the rows.

This patch did not have that issue.
https://www.drupal.org/node/2645612#comment-11523703

PS: Im using D7.5 and Omega theme 3.1

thierry.beeckmans’s picture

@yazzbe I Just installed the specific theme (omega-7.x-3.1) on a brand new test site and added a view with a custom row class.
I wasn't able to reproduce the problem you had, the custom row class showed up on all of the rows.

banoodle’s picture

I experienced this problem after upgrading to ctools 7.x-1.10.

I first tried applying the patch for the related/duplicate issue, but it failed to apply (https://www.drupal.org/node/2645612#comment-11523703).

UPDATE: I was confused about local ctools version. It turns out this other patch DOES apply cleanly and it also fixes this problem.

So I applied patch in #5 above instead and it worked great for me. THANK YOU!

I don't think I have the "first row" issue yazzbe mentioned, but it's possible I don't have any mission-critical row classes on this site.

I may find out shortly when I run the automated visual regression test suite on the site.

I haven't had this issue on the other sites I've upgraded to ctools 7.x-1.10. This site has an Omega5 subtheme while the other sites (where I didn't have this problem) did not.

rivimey’s picture

I'm trying to help japerry get ctools-1.11 out the door.

Patch applies cleanly to 7.x-1.x.

It would appear this patch is really a duplicate of that in https://www.drupal.org/node/2645612.

It is not clear to me which of these should 'win' but I would be against committing them both. On the basis of some posts on this thread preferring the other patch, I have proposed 2645612 for the next release.

Are there arguments in favour of the committing this one and rejecting 2645612?

japerry’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Marking as a duplicate because I believe #2645612: Attributes array doesn't populate classes, which is fixed, will fix this issue as well.