Scenario: User is editing a context (/admin/build/context/xx) in one window. In another window the user creates a new Views block. Save the view, back to the context page, reload -- the new block doesn't appear in the block list.
The main Context admin page (in context_ui_admin()) calls _block_rehash(), which invokes the block hooks (including from Views) and repopulates the blocks table. _block_rehash() should also be invoked from _context_ui_get_blocks, so it builds the table from the Edit Context pages (without going back to the main Context Admin page).
But _block_rehash() initializes blocks for the *current* theme, and _context_ui_get_blocks loads blocks for the *default* theme. In my case, with Context loading in an admin theme (different from the default/front-end theme), that means _block_rehash() isn't sufficient, and the new Views block still does not appear in the list.
To deal with the current/default theme issue (discussed here, "Context only knows about the current theme," why not just remove the theme='%s' from the blocks query (line 963 of context_ui.admin.inc), and use DISTINCT or array logic to filter duplicates? (I have not explored this option in depth but off the bat it seems better than filtering by the default theme.)
Comments
Comment #1
yhahn commentedI agree with all your points.
_block_rehash()has been added to_context_ui_get_blocksand the block query now allows blocks from any themes to be used in contexts. These should be good stopgap measures until we come up with a good solution to #316555.http://drupal.org/cvs?commit=216508