Only first row checked

GROL - August 16, 2008 - 19:17
Project:Custom Breadcrumbs
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:GROL
Status:closed
Description

My bugfix

function _custom_breadcrumbs_load_for_type($node) {
  $sql = "SELECT * FROM {custom_breadcrumb} WHERE node_type = '%s'";
  $result = db_query($sql, $node->type);
  while ($breadcrumb = db_fetch_object($result)) {
    if (!empty($breadcrumb->visibility_php)) {
      // Use PHP code to check the visibility.
      ob_start();
      //$result = eval(trim($breadcrumb->visibility_php)); commented by GROL
      $visibility = eval(trim($breadcrumb->visibility_php));
      ob_end_clean();
      if ($visibility == TRUE) {
      return $breadcrumb;
      }
    }
    else {
      return $breadcrumb;
    }
  }
}

#1

bangpound - October 1, 2008 - 04:21
Status:active» needs review

thumbs up. the error is that $result is the db_query resource it's looping through, and if there's a PHP visibility to evaluate, that result is also put into $result.

AttachmentSize
custom_breadcrumbs_visibility_check.patch 822 bytes

#2

motto - October 5, 2008 - 21:42

Good job! This fix works fine for me.

#3

MGN - October 16, 2008 - 03:14
Status:needs review» reviewed & tested by the community

Patch works fine. I've tested it and have been using it for am using it for a couple of weeks now...no problems.

#4

thePanz - October 17, 2008 - 08:50

Manual edited .module file with your patch. Works fine.

#5

scottrigby - December 1, 2008 - 19:16

perfect - this is great - any chance of getting into the next release? :)

#6

MGN - February 11, 2009 - 02:36
Version:6.x-1.3» 6.x-1.x-dev
Status:reviewed & tested by the community» fixed

Committed to 6.x-1.x-dev.

#7

System Message - February 25, 2009 - 02:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#8

datawench - May 29, 2009 - 20:20
Priority:critical» minor

Apparently this didn't make it into 6x-1.4?

#9

MGN - May 29, 2009 - 21:16

Look at the dates of the releases. 6.x-1.4 is older than 6.x-1.x-dev. The latest release will always be the developmental release. I am waiting on #334324: Menu active trail query to be resolved before releasing the next stable version (6.x-1.5).

 
 

Drupal is a registered trademark of Dries Buytaert.