summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Chedemois2008-07-25 02:17:52 (GMT)
committer Yves Chedemois2008-07-25 02:17:52 (GMT)
commit90ce3d08a8b3d6895e9c77c97fc76402fcfd1c4c (patch)
treeec63b776180102d3ee50f291eb5b76f722716ee8
parenta899b833b6579add8cdbe02570ddd772020e07d4 (diff)
Fix PHP warnings when renaming a content type.
We can't trigger the menu_rebuild() ourselves here, too early. node/content_types.inc's submit handlers take care of this after node types information has been rebuilt.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--includes/content.crud.inc12
2 files changed, 8 insertions, 5 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 52f1aef..f0c5c8c 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -16,6 +16,7 @@ CCK 6.2-dev
- #93436 Add $form parameter to content_validate.
- #277310 by fractile81: update node object by reference in content_load().
- #285771 Views integration: use the new 'float' filter handler where applicable.
+- Fix PHP warnings when renaming a content type.
CCK 6.2.rc4
===========
diff --git a/includes/content.crud.inc b/includes/content.crud.inc
index 1f78f93..539b09a 100644
--- a/includes/content.crud.inc
+++ b/includes/content.crud.inc
@@ -590,9 +590,10 @@ function content_type_update($info) {
}
}
- // Reset all content type info and alter the menu paths.
+ // Reset all content type info.
+ // Menu needs to be rebuilt as well, but node types need to be rebuilt first.
+ // node_type_form_submit() takes care of this.
content_clear_type_cache(TRUE);
- menu_rebuild();
}
/**
@@ -607,8 +608,8 @@ function content_type_update($info) {
*
*/
function content_type_delete($info) {
- // This isn't right either, since content_field_instance_read()
- // only picks up active fields, so inactive ones won't get deleted.
+ // TODO : What about inactive fields ?
+ // Currently, content_field_instance_delete doesn't work on those...
$fields = content_field_instance_read(array('type_name' => $info->type));
foreach ($fields as $field) {
content_field_instance_delete($field['field_name'], $info->type);
@@ -619,6 +620,7 @@ function content_type_delete($info) {
db_drop_table($ret, $table);
watchdog('content', 'The content fields table %name has been deleted.', array('%name' => $table));
}
+ // Menu needs to be rebuilt as well, but node types need to be rebuilt first.
+ // node_type_form_submit() takes care of this.
content_clear_type_cache(TRUE);
- menu_rebuild();
}