Commit d6f1a16c authored by noah's avatar noah

Do not try to write civicrm_menu.module_data if it doesn't exist yet

parent 76f6dea7
......@@ -317,17 +317,21 @@ class CRM_Core_Menu {
$menu->find(TRUE);
// Move unrecognized fields to $module_data.
$module_data = array();
foreach (array_keys($item) as $key) {
if (!isset($daoFields[$key])) {
$module_data[$key] = $item[$key];
unset($item[$key]);
if (!CRM_Core_Config::isUpgradeMode() ||
CRM_Core_DAO::checkFieldExists('civicrm_menu', 'module_data', FALSE)
) {
// Move unrecognized fields to $module_data.
$module_data = array();
foreach (array_keys($item) as $key) {
if (!isset($daoFields[$key])) {
$module_data[$key] = $item[$key];
unset($item[$key]);
}
}
}
$menu->copyValues($item);
$menu->module_data = serialize($module_data);
$menu->copyValues($item);
$menu->module_data = serialize($module_data);
}
foreach (self::$_serializedElements as $element) {
if (!isset($item[$element]) ||
......
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