Closed (won't fix)
Project:
Organic Groups Menu (OG Menu)
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2008 at 17:41 UTC
Updated:
23 Aug 2010 at 11:32 UTC
When a user who is a member of a group without a menu visits "admin/build/menu", og_menu fails to create a new menu for that group. I found this to be because isset() is being called on the result of the db query. db_fetch_array returns (boolean) false which evaluates to true when passed to isset(). I found that using empty() instead of isset() works as expected. I'm using PHP 5.2.1. Here is a patch to change the appropriate line.
--- og_menu.module.orig 2008-01-07 12:30:59.000000000 -0500
+++ og_menu.module 2008-01-07 12:31:11.000000000 -0500
@@ -340,7 +340,7 @@
foreach ($groups as $gid => $array){
$result = db_fetch_array(db_query('SELECT * FROM {menu} where title = "%s"', $array['title']));
- if (!isset($result)){
+ if (empty($result)){
$form_id = 'menu_edit_menu_form';
$field_values = array('title' => $array['title']);
drupal_execute($form_id, $field_values, $type, $mid);
Comments
Comment #1
avior commentedimrook !
I had the same bug , and this solved the problem !
Thank you very much
Avior
Comment #2
leonk commentedOnce I get a chance to test it I will change it and put it in a future release.
Comment #3
sisyphos commentedThank You very much!!
Comment #4
jide commentedClosing old 1.x issues.