I detected that the ContextReaction plugin for blocks concatenates the custom classes through blocks os a context that is rendering.
For example a context with 3 blocks:
block 1 has .green class
block 2 has .red class
block 3 has not classes
When the page is render the blocks are render
block 1 class .green class
block 2 class .green .red class
block 3 class .green .red class
This is related with the code added base on https://www.drupal.org/project/context/issues/2979536
Note: i think the issue https://www.drupal.org/project/context/issues/2979536 it could be closed
Comments
Comment #2
maxmendez commentedI found a solution so simple, here is the patch.
Comment #3
maxmendez commentedComment #4
caspervoogt commentedThanks Max; good catch. I ran into this too and immediately suspected Context, which brought me here. mix-of-block-classes-between-blocks-3150394-2.patch works for me.
Comment #5
paulocsPatch #3 looks good to me.
Comment #6
maticb commentedThe patch is fine, but the code could be improved, array can be only a declaration, it doesn't have to be in 2 lines, also the array push makes no sense since it's only 1 item, always.
I've added the above and another slight optimization (skip array merge if it doesn't have a custom class).
Comment #7
maticb commentedComment #8
paulocsPatch #6 looks good for me.
I tested with two different blocks and they are not mixing each other.
I tested with empty classes values and they are working as well.
If you see the images, I added the class "test1" in one block and "test2" in another block.
Thanks!
Comment #10
paulocsFixed in dev branch!
Thanks @all!