... and why should they :)
The block_class module provides a ui for adding classes to blocks. However, these settings don't export/import with fe_block. I've attached a patch that checks for the existence of the block_class module and if its there, it adds the classes needed and manages the import/export of them.
This is part of a larger issue that the fe_block_settings really should be using the block module's alter commands for the info, and the block save commands for saving blocks. This way every module that interacts with blocks gets a chance to load/save its settings.
If that's not an option, a hook/alter system for the settings components we are going to export might work instead. In the mean time, the patch supplied should help. Given that I deal with features extra on a daily basis for new clients each week, I certainly have the opportunity to work out a more in depth fix if we want to discuss/hash out how it would work.
hope this helps!
Comments
Comment #1
xaqroxThis is being handled in the block_class module itself: #1230234: features support ?
Comment #2
brad.bulger CreditAttribution: brad.bulger commentedExcept that they don't provide useful support for custom blocks. There didn't seem to be much motivation to do otherwise - looks like a pretty standard case of a problem falling between two modules.
Which is a point in favor of what netw3rker was saying about a more general solution, I guess. The patch seems to be working OK still for now.
Comment #3
brad.bulger CreditAttribution: brad.bulger commentednew patch made against the current 1.x-dev code
Comment #4
pfrenssenComment #5
pfrenssenI reviewed the patch, it looks good, just two minor remarks:
Use '&&' instead of 'and'.
This one line if is against coding standards, use brackets :) This is used twice in the patch.
Comment #6
pfrenssenI have created a new branch '1342996' for this issue. I have committed the patch from #3 with remarks from#5 addressed. I also added a bit more documentation and converted the db_query to db_select.
I'd like to add a test for this before merging it in 7.x.
Attached is the diff with current 7.x for people who prefer patches over branches.
Comment #7
pfrenssenAdded test.
Comment #9
pfrenssen#7: 1342996-7-features_extra-block_class.patch queued for re-testing.
Comment #10
pfrenssen#7: 1342996-7-features_extra-block_class-test_only.patch queued for re-testing.
Comment #12
pfrenssenHmm the bot fails with the following error:
Fatal error: Call to undefined function fe_block_get_bid() in /var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/features_extra/tests/fe_block.test on line 57
This means that the fe_block module is not loaded. I'm speculating that this is caused by the new dependency on block_class that has been introduced in this issue. The test bots only refresh their dependency list when a new dev release is made, so the test bot does not have Block Class installed when the test launches. This probably causes module_enable() to bail out early with FALSE.
Locally the test runs fine:
I'm going to add Block Class as a test_dependency in the dev branch and wait until a new dev release is packaged before relaunching the tests.
Comment #13
pfrenssen#7: 1342996-7-features_extra-block_class.patch queued for re-testing.
Comment #14
pfrenssen#7: 1342996-7-features_extra-block_class-test_only.patch queued for re-testing.
Comment #16
pfrenssenOk there goes my theory lol. I'm going out on a limb and merge this in 7.x-1.x. If problems should arise I will revert these changes.
Comment #17
pfrenssenThis is working fine since I added support for Block Class 2.x in #1952922: Add support for Block Class 2.x.