drupal_get_region_content() is used in template_preprocess_maintenance_page() but not in template_preprocess_page()

Files: 
CommentFileSizeAuthor
#19 713462-drupal-add-region-content-18.patch717 bytesjwilson3
PASSED: [[SimpleTest]]: [MySQL] 58,707 pass(es).
[ View ]
#13 713462-drupal-add-region-content-D7.patch497 bytesjwilson3
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 713462-drupal-add-region-content-D7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#1 drupal_add_region_content-remove.patch11.07 KBcasey
FAILED: [[SimpleTest]]: [MySQL] 20,426 pass(es), 0 fail(s), and 2 exception(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new11.07 KB
FAILED: [[SimpleTest]]: [MySQL] 20,426 pass(es), 0 fail(s), and 2 exception(es).
[ View ]

Removing drupal_add_region_content() and drupal_get_region_content() is a possibility, although I am not sure modules need to be able to add content to maintenance pages. This is currently only possible through drupal_add_region_content(), but I believe there are currently no possibilities for modules to do so.

Ideal IMHO would be if maintenance pages are build/rendered/alterable through drupal_render().

Status:Needs review» Needs work

The last submitted patch, drupal_add_region_content-remove.patch, failed testing.

Version:7.x-dev» 8.x-dev
Issue tags:+needs backport to D7

I think this function inherited from D6 drupal_set_content() but limited by maintenance page for some reason.
For D7 we are using hook_page_alter() for purpose of adding some data to a region.

We should change doc block to point this or change behaviour to allow it work as D6 way.

tagged

Version:8.x-dev» 7.x-dev

i am using drupal D7, want to assign content in region using drupal_add_region_content, but content is not shoing in particular region. can you help?

Version:8.x-dev» 7.x-dev

hook_page_alter() is not a replacement for drupal_set_content(). drupal_set_content() could be used inside of other functions, after certain data has been retrieved for instance. A way to achieve this in D7 with hook_page_build() would be to store that data in a static variable in the same way that drupal_add_region_content() is doing, and then retrieve it in hook_page_build(). Not an ideal workflow.

Version:7.x-dev» 8.x-dev

+++ update.php 20 May 2010 13:16:26 -0000
@@ -31,11 +31,7 @@
-  update_task_list('select');

Any reason to remove this?

1 days to next Drupal core point release.

Version:7.x-dev» 8.x-dev

andypost said:

For D7 we are using hook_page_alter() for purpose of adding some data to a region.

Actually, now that I'm looking at it, if you want to add content to a region, you should be using hook_page_build(), not hook_page_alter(). It's like the difference between hook_menu() and hook_menu_alter(). If you want to add new menu items, you use hook_menu(). If you want to tinker with existing ones, you use hook_menu_alter().

Version:8.x-dev» 7.22
Status:Needs work» Needs review

I found a workaround to this issue for D7, and posted it here: http://api.drupal.org/comment/48353#comment-48353. Hopefully this helps out. I welcome any feedback.

Version:7.22» 8.x-dev
Status:Needs review» Needs work

Thanks for posting that, but this core issue needs to stay on Drupal 8 (backport to Drupal 7 is possible later, depending on what the fix is).

Removing a feature from Drupal because its broken feels like the wrong thing to do.

* The amount of code to make this functionality actually work again is trivial (see the following patch below).
* The recommended workaround in #8 does *exactly* what this code already does in core, and makes modules/custom code more confusing (having to set custom variables and alter regions).

Here is a trivial patch that adds this functionality back to D7. The only thing left to do here would be
a) review the methodology suggested in this comment and patch
b) update this patch for D8
c) write a few tests that prove that you can add content to regions.

PS. I need this code because I'm doing a nice trick originally written up by Dave Reid (for D6) to pull content out of a panel region, and place it into a theme region. It entirely depends on this function call, because inside a ctools panel layout definition, you don't have access to hook_page_alter() or hook_page_build(), and this function is really a very clean solution.

Status:Needs work» Needs review
StatusFileSize
new497 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 713462-drupal-add-region-content-D7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

aaaaand.... the patch. :/

Status:Needs review» Needs work
Issue tags:-Needs Documentation, -API clean-up, -needs backport to D7

The last submitted patch, 713462-drupal-add-region-content-D7.patch, failed testing.

Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, 713462-drupal-add-region-content-D7.patch, failed testing.

Status:Needs work» Needs review

Status:Needs review» Needs work
Issue tags:+Needs Documentation, +API clean-up, +needs backport to D7

The last submitted patch, 713462-drupal-add-region-content-D7.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new717 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,707 pass(es).
[ View ]

Rerolled for D8, so bot stops complaining.

Issue tags:+Twig

How another piece of mark-up affects twig?

Issue tags:+Needs tests

Per #12.c

I don't think this needs additional documentation, if the idea is to fix this functionality as it was working in D6. Also, tagging as Novice for test writing.

I;ve updated the documentation for Assigning content to regions to reflect the fact that you need a patch from this issue to make it work in D7 and D8. After this gets in, we should remove that notice.