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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scorchio’s picture

I'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.

e2thex’s picture

Status: Active » Reviewed & tested by the community
FileSize
793 bytes

This seems to work well.

I have attached the same patch but for use with drush

bnash2501’s picture

This 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

jec006’s picture

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

Dupe as this has been fixed in boxes.

avr’s picture

Status: Closed (duplicate) » Needs review

This is still an issue. I'm not using Boxes on my site - therefore the patch to boxes has no effect on Context.

tekante’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'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?

avr’s picture

@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:

  1. Edit the context
  2. Standard blocks that are part of the context have the draggable and delete icons and are shown "active".
  3. Menu Blocks that ARE part of the current context being edited are "disabled". In other words, they don't display the draggable and delete icons. Also, they are "dimmed".
  4. Save the context.
  5. Default blocks stay, the 'disabled' menu blocks and custom blocks disappear.
avr’s picture

Status: Postponed (maintainer needs more info) » Needs review

Forgot to update status.

tekante’s picture

I'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?

tekante’s picture

Adding tag for tracking

tekante’s picture

Can 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?

ianthomas_uk’s picture

This 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.