Context respect does not respect any of the block classes that I put in blocks. It strips them out completely.

https://drupal.org/project/block_class

Comments

david_garcia’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

I can confirm this is happening, in block_list() the $block information constructed is only a subset of all the settings of the block.

Porposed patch completely absorbs all the block settings. Actually this loss of settings should randomly manifest in other kind of issues.

In this case, particularily, the block_class module is adding the css_class setting to the $block data. With the approach from the patch, this and other settings get carried along with the block, the way it should be.

david_garcia’s picture

StatusFileSize
new1.11 KB
dydave’s picture

Hi @david_garcia,

Interesting patch! Since it appears it is pretty much the same problem encountered for the Display Suite module.

In particular, see #2327879-1: Block css classes not being applied to DS Field: the solution suggested is similar: to merge the $block arrays so that no properties would be lost, see the patch: ds-7.x-2.x-merge-block-with-full-block-2327879-1.patch.

Just wanted to point that out because I found it interesting that it would be almost the same cause for these issues: properties that were "lost" somewhere during the rendering process.

Relating these two issues in order to follow their status, evolution of the patches and approaches towards a solution.

Thanks again very much for posting back to the Block Class module and for contributing a patch for this issue.
Cheers!

glynster’s picture

Great this fixed the issue! However only using the patch from #1 the other one produced a "Only garbage was found in the patch input." when patch was attempted.

dydave’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

Hi @glynster,

Thank you for your feedback on this issue and for giving attached patches a round of tests.

I'm not entirely sure of the problem you might have encountered while applying the patch from #2, but I would assume it could be due to module's version.
I have just tried testing the patch from #2 with context_respect-7.x-1.x-dev and it applied correctly as expected.
Therefore, I allowed myself to change the version of this issue to 7.x-1.x-dev, which should be the version used for development, testing and debugging.

Lastly, I would like to mention that comments such as:

the other one produced a "Only garbage was found in the patch input." when patch was attempted.

unfortunately don't really tell us much about the patch or the problem applying it and we would greatly appreciate more constructive information in order to be able to answer more efficiently.

Thanks again to everyone for your feedback, testing/reporting and comments.
Cheers!

botris’s picture

Status: Needs review » Reviewed & tested by the community

Tested against dev, works as expected, fixes incompatibility.

  • david_garcia authored 1f221ba on 7.x-1.x
    Issue #2217553 by david_garcia: Breaks or disables the block class...
frob’s picture

Status: Reviewed & tested by the community » Fixed

I have committed this to the latest dev. If all goes well I will create a new release when this closes.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.