Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is an issue in Menu Block (http://drupal.org/node/1064456) that addresses blocks "forgetting" where they were placed. I noticed this in a custom block of mine as well.
This issue "http://drupal.org/node/996426#comment-4133036" pointed out that Context looks for custom markup added to blocks to make them "editable" (and therefore 'savable').
Unfortunately, if a block doesn't have "#markup" or any element_children (as is the case with Menu Block and my custom block), the additional markup is not added by Context.
Attached patch adds a small check for 'context' and adds the necessary markup.
Comment | File | Size | Author |
---|---|---|---|
#2 | custom_blocks_arent_editable-make.patch | 793 bytes | e2thex |
custom_blocks_arent_editable.patch | 797 bytes | avr | |
Comments
Comment #1
scorchio CreditAttribution: scorchio commentedI'm currently testing this patch - it seems to be working well. I will come back later and set this issue to RTBC after further testing.
Comment #2
e2thex CreditAttribution: e2thex commentedThis seems to work well.
I have attached the same patch but for use with drush
Comment #3
bnash2501 CreditAttribution: bnash2501 commentedThis issue looks to have been solved by a patch in Boxes ( See http://drupal.org/node/1440178 for reference. ).
Using current versions of Boxes, this problem does not see to occur and has default empty box text when trying to edit
Comment #4
jec006 CreditAttribution: jec006 commentedDupe as this has been fixed in boxes.
Comment #5
avr CreditAttribution: avr commentedThis is still an issue. I'm not using Boxes on my site - therefore the patch to boxes has no effect on Context.
Comment #6
tekante CreditAttribution: tekante commentedI've tried replicating this and haven't been able to create behavior without this patch that is corrected with it using either menu block with empty content or a custom block with empty content. Can you detail the exact steps needed to produce the error that this patch corrects?
Comment #7
avr CreditAttribution: avr commented@tekante
In my case, the issue is present when the menu block HAS content (I can't verify the issue with empty content).
When using the inline Context Editor (not Admin->Structure->Context->"My Context"), the following happens:
Comment #8
avr CreditAttribution: avr commentedForgot to update status.
Comment #9
tekante CreditAttribution: tekante commentedI've put a patch in #1076706: menu blocks is gone after saving an existing context, can you see if that resolves the issue for your custom block as well?
Comment #10
tekante CreditAttribution: tekante commentedAdding tag for tracking
Comment #11
tekante CreditAttribution: tekante commentedCan anyone confirm whether fixing #1076706: menu blocks is gone after saving an existing context has corrected this issue or if not provide information about how to replicate this on the latest version of context?
Comment #12
ianthomas_ukThis will likely be fixed by fixing http://drupal.org/node/751062, but I'm not sure that it's definitely a duplicate as I'm not sure what is meant by 'Custom block' and how they may differ from other blocks.