Commit b228f018 authored by Steven Wittens's avatar Steven Wittens

#11449: Adding a failsafe check for an improperly prefixed menu sequence. This...

#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 ;).
parent 869a91b7
...@@ -505,6 +505,12 @@ function menu_rebuild() { ...@@ -505,6 +505,12 @@ function menu_rebuild() {
foreach ($menu['items'] as $mid => $item) { foreach ($menu['items'] as $mid => $item) {
if ($mid < 0 && ($item['type'] & MENU_MODIFIABLE_BY_ADMIN)) { if ($mid < 0 && ($item['type'] & MENU_MODIFIABLE_BY_ADMIN)) {
$new_mid = db_next_id('{menu}_mid'); $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']])) { if (isset($new_items[$item['pid']])) {
$new_pid = $new_items[$item['pid']]['mid']; $new_pid = $new_items[$item['pid']]['mid'];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment