Commit 07169b76 authored by KarenS's avatar KarenS

#249386 Better method to keep CCK from throwing errors during upgrade by...

#249386 Better method to keep CCK from throwing errors during upgrade by keeping hook_menu() from firing, patch by quicksketch. Thanks!
parent c56d4554
......@@ -128,13 +128,12 @@ function content_menu() {
'type' => MENU_CALLBACK,
);
foreach (node_get_types() as $type) {
$type_name = $type->type;
$content_type = content_types($type_name);
// Make sure this doesn't fire until content_types is working,
// needed to avoid errors on initial installation.
if (!empty($content_type)) {
// Make sure this doesn't fire until content_types is working,
// needed to avoid errors on initial installation.
if (!defined('MAINTENANCE_MODE')) {
foreach (node_get_types() as $type) {
$type_name = $type->type;
$content_type = content_types($type_name);
$type_url_str = $content_type['url_str'];
$items['admin/content/node-type/'. $type_url_str .'/fields'] = array(
'title' => 'Manage fields',
......
......@@ -18,13 +18,12 @@ function fieldgroup_init() {
function fieldgroup_menu() {
$items = array();
foreach (node_get_types() as $type) {
$type_name = $type->type;
$content_type = content_types($type_name);
// Make sure this doesn't fire until content_types is working,
// needed to avoid errors on initial installation.
if (!empty($content_type)) {
// Make sure this doesn't fire until content_types is working,
// needed to avoid errors on initial installation.
if (!defined('MAINTENANCE_MODE')) {
foreach (node_get_types() as $type) {
$type_name = $type->type;
$content_type = content_types($type_name); foreach (node_get_types() as $type) {
$type_url_str = $content_type['url_str'];
$items['admin/content/node-type/'. $type_url_str .'/add_group'] = array(
'title' => 'Add group',
......
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