summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-10-16 19:42:52 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-10-16 19:42:52 +0000
commitb228f0183a7797a8ec45fb39560360f40fcc6b0c (patch)
tree72c195d795d81ccbea1f4ce98984b0e195829874
parent869a91b72eaf85a447e8fd1b78aad51a8b5676cc (diff)
downloadbrdo-b228f0183a7797a8ec45fb39560360f40fcc6b0c.tar.gz
brdo-b228f0183a7797a8ec45fb39560360f40fcc6b0c.tar.bz2
#11449: Adding a failsafe check for an improperly prefixed menu sequence. This is a temporary fix, awaiting a proper install system to end manual prefixing ;).
-rw-r--r--includes/menu.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 729a202b8..da2f8a28a 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -505,6 +505,12 @@ function menu_rebuild() {
foreach ($menu['items'] as $mid => $item) {
if ($mid < 0 && ($item['type'] & MENU_MODIFIABLE_BY_ADMIN)) {
$new_mid = db_next_id('{menu}_mid');
+ // Check explicitly for mid 1. If the database was improperly prefixed,
+ // this would cause a nasty infinite loop.
+ // TODO: have automatic prefixing through an installer to prevent this.
+ if ($new_mid == 1) {
+ $new_mid = db_next_id('{menu}_mid');
+ }
if (isset($new_items[$item['pid']])) {
$new_pid = $new_items[$item['pid']]['mid'];
}