Closed (fixed)
Project:
Drupal Commons
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Jun 2011 at 23:52 UTC
Updated:
26 Jan 2012 at 20:20 UTC
Jump to comment: Most recent
Page manager module is unable to enable node/%node because some other module already has overridden with commons_core_node_page_view.
because commons_core.module does this:
// Override the node view callback in order to handle group home pages
$items['node/%node']['page callback'] = 'commons_core_node_page_view';
$items['node/%node']['file'] = 'commons_core.overrides.inc';
$items['node/%node']['file path'] = $path;it does this:
function commons_core_node_page_view($node) {
// If this node is a group
if (og_is_group_type($node->type)) {
// Make context aware of the node view since hook_nodeapi() won't
// be triggered here
context_node_condition($node, 'view');
// Return nothing, allowing context to handle the content
return '';
}
// Pass the node to the normal callback
return node_page_view($node);
}So that prevents Panels from being able to override the node template. What would be a some what easy solution for this?
Comments
Comment #1
mstef commentedThis probably belongs in the Commons issue queue, right?
Comment #2
merlinofchaos commentedPage Manager will not override a menu item if some other item module has already done so. However, it is willing to allow modules to specify what the fallback should be. Modules can test if page manager is active and set to override that page; if it is, they can decline to do so and let Page Manager have it, and Page Manager will pass through to that module if no variant takes it. That's the only way I've found that seems to make cooperation actually work for everyone involved.
The hook is hook_page_manager_override() and its implementation looks like this for node_view:
This should be moved into the commons queue. I'm not quite sure which one that is just now.
Comment #3
mstef commentedComment #4
mstef commentedCommitted for fix for upcoming 2.0.
Came up with an interesting solution that seems fine to me:
Comment #6
user654 commentedComment #7
user654 commentedCould the above fix be included in the next release of Commons?
Comment #8
ezra-g commentedThere are 2 fixes above.
To help get this into Commons, it would be great if someone could test and verify which is the appropriate fix and provide a patch.
Comment #9
mstef commentedWasn't this committed prior to the 2.0 release?
Comment #10
ezra-g commentedIt's tough to tell without a link to the commit and without user verification of the fix before it was committed.
However, I found https://github.com/acquia/commons/commit/1b5c56f3328a9ff3bdde805c4bf544e... which is the solution in #4.
Based on the pinkonomy's feedback, it sounds like this isn't having the desired effect in Commons 2.2.
Perhaps Merlinofchaos' solution in #2 is the appropriate fix.
Comment #11
monkeythedrummer commentedI'm having the same problem. Latest Commons version has the fix in #4, but it is not working properly - I am getting duplicate group images and duplicate featured group checkboxes. How do I test the #2 solution? Just paste it over the non-working one?
Comment #12
mstef commentedI can confirm that this is working properly, but is easily mistaken as a bug.
First, make sure that your page (in page manager) has been enabled. You can easily add a variant to the node/%node page in page manager, and forget to actually enable the page.
Second, remember that, despite turning on the newly created custom page, the contexts, which power the entire group page, will remain active - so you will get duplicate content. If you don't want the blocks appearing that context provides, be sure to disable them.
After taking that into considering, please retest, and let me know your results.
Thanks.
Comment #13
ezra-g commentedIn my testing I'm able to override the page display for several content types within the latest dev of Commons. Marking this as fixed based on that testing and #12, but please re-open if you're still having issues overriding the node page view with Panels.