Twice now, OG panels "use panel as homepage" has disappeared and stopped working on my site. Instead of using panel the group admins have created, it just falls back on the standard. The settings are all still there. You can navigate to the panel using the panel's url. It's just stops overriding the default view.

The fix is super easy: I just (1) go to admin/build/modules uncheck the "OG Panels" module; (2) hit save; (3) check the "OG Panels" module (4) hit save. Then, all is good, for a few days.

Can you help me get this to stick? Is this a bug or a conflict with another module I've installed?

Thanks!

Comments

AliraSirin’s picture

Faced this bug too. In my case there was a conflict with Trash module (overriding menu node view callback). So I uninstalled this old unstable Trash module and developed my version of it (Trashbin/Killfiled didn't suit my needs).
Hope this helps.

keith_k’s picture

I have never heard of (or used) the Trash module. That's probably not the problem.

tallsimon’s picture

i have the same issue. i recently disabled the menu breadcrumb module, don't think this is related though.
EDIT
the same fix works for me too

joshk’s picture

Thanks for the report. I am going to be doing a final pass on the menu logic (there are a few other issues). If you figure out how to reliably reproduce this, let me know.

matcha213’s picture

I have the same problem. It looks like it just dies over time. Any word on this issue?

ajayg’s picture

@joshk,
any updates on this further? If you can atleast submit the work done so far, others can help you finish remaining.

jimthunderbird’s picture

Here is a way to solve the problem through the implementation of hook_init, just need to implement a better access control system.

/**
 * Implementation of hook_init
 * Force the og panels homepage to display correctly.
 */
function og_panels_init(){
  if(arg(0) == 'node' && arg(1) > 0 && arg(2) == ""){
     $nid = (int)arg(1);
     $group_node = node_load($nid);
     if(is_object($group_node) && og_is_group_type($group_node->type)){
         $result = db_query("SELECT did,show_blocks FROM {og_panels} WHERE default_page = 1 AND nid = '%d'", (int)arg(1));
         $panel = db_fetch_object($result);
        og_set_group_context($group_node);
        $display = og_panels_load_display($panel->did, $group_node);
        $output = panels_render_display($display);
        print theme('page', $output ,$panel->show_blocks);exit();
     }
  }
}
geomarketing’s picture

I have all the OG related modules activated but have never seen a "use panel as homepage" in the OG Panel or Group home page view configuration or the content type configuration but this is what I am trying to do and have been searching around for. If someone could tell me where this property is (or should be) I would be very grateful!

AntiNSA’s picture

Title: OG Panel as homepage stops working » Can someone commit this patch? Or is it fixed already?

I need to maybe use og but am worried about any problems

ajayg’s picture

Title: Can someone commit this patch? Or is it fixed already? » OG Panel as homepage stops working

Please don't change the title of issue as it is very confusing. You can always write as your comments.

No one has commented here yet they have reviews/tested/it is working-not working. So unless that happens it won't be commited.

Stanto’s picture

The fix by jimthunderbird on #7 seems to work perfectly so far.

Should be commited.
Thanks for that!

Edit : works when a homepage is set. Else it doesn't display the default homepage, and shows an error.

Stanto’s picture

I made a modification on #7 to avoid this error, and use the default homepage when nothing is set.

/**
* Implementation of hook_init
* Force the og panels homepage to display correctly.
*/
function og_panels_init(){
  if(arg(0) == 'node' && arg(1) > 0 && arg(2) == ""){
     $nid = (int)arg(1);
     $group_node = node_load($nid);
     if(is_object($group_node) && og_is_group_type($group_node->type)){
         $result = db_query("SELECT did,show_blocks FROM {og_panels} WHERE default_page = 1 AND nid = '%d'", (int)arg(1));
         $panel = db_fetch_object($result);
         if($panel){
	        og_set_group_context($group_node);
    	    $display = og_panels_load_display($panel->did, $group_node);
        	$output = panels_render_display($display);
        	print theme('page', $output ,$panel->show_blocks);exit();
        }
     }
  }
}
AntiNSA’s picture

Yesterday the problem happened with me too.. Im not asure exactly why. but my group pages panels stopped workingl while the user profile panel was uneffected. I had to disable, unisntall and reinstall the panel. After doing that the sonctent remained the same and the issue was gone. I hope ot doesnt happen again, it really freaked me out.

populist’s picture

Status: Active » Postponed

I am going to commit this as a temporary fix, but there is a larger problem here that deserves investigation. Leaving open until it can be replicated + resolved.

populist’s picture

Status: Postponed » Closed (works as designed)

The issue here is that certain modules (including trash) are overriding the menu callback for node/%node using a hook_menu_alter. This prevents Panels from doing its thing because it no longer owns the node view.

hook_init() is a workaround, but the solution here is for page manager to be increasingly vigilant about imposters to the node_view throne.

dadderley’s picture

Just upgraded to the newest from 2010-Mar-30 .
My home panel croaked right away. Interestingly enough, i displays beautifully when I preview it.

gmak’s picture

I am seeing the same thing as dougzilla. It has never worked for me. It always defaults to the og_ron view that is normally setup for groups.

dadderley’s picture

Actually, it seemed to work quite well in the 2.x-dev version from September.
I reverted to that version after not having success with this one.

jkandiko’s picture

Tried the patch from the comments. Works at getting the panel to show on the home page, but then screws up the rest of the menus for out site.

jimthunderbird’s picture

Here is another possible solution, thought not perfect, but works better than hook_init, one thing need to solve is the current tab will be set to the actual page that's set to homepage.

1. add function function og_panels_init, implementing hook_init

function og_panels_init(){
if (arg(0) == 'node' && arg(1) > 0) {
    $group_node = node_load(arg(1));
    if(og_is_group_type($group_node->type)){
      if( arg(2) == "" ){
        $_GET['q'] = "node/".$group_node->nid."/og-panel/1";
      }
    }
  }
}

2. change the function _og_panels_node_access to the following

function _og_panels_node_access($nid, $tab_num) {
  $tab = og_panels_node_data($nid, $tab_num);
  if (isset($tab['nid'])) {
    $node = node_load($nid);
    if ($tab['published']) {
      return node_access('view', $node);
    }
  }
  else {
    return FALSE;
  }
}

Essentially what this solution does is to reroute the $_GET['q'] page signal to the safer url: node/".$group_node->nid."/og-panel/1, in order to do this we need to grant access to tab 1, thus we need to modify _og_panels_node_access.

jimthunderbird’s picture

More work needs to be done to get the tab working.

TonyV’s picture

Where exactly to I place this code (in #12)? What file? Thanks for any help as the fix listed at the top of the thread is not working for me.

jimthunderbird’s picture

For #12, you can put it at the beginning of og_panels.module, it is an implementation of hook_init, but this is a temp fix, i think the homepage generally works, you might consider also upgrade the panels and ctools module to the latest version, it might help to solve the problem as well.

Best Regards,
Jim

TonyV’s picture

This worked for me. Thanks for all the help.

tallsimon’s picture

I have not had this problem again thank you