Closed (won't fix)
Project:
Drupal core
Version:
5.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Oct 2007 at 21:58 UTC
Updated:
13 Apr 2011 at 04:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
pasquallecan you provide steps how to test this patch, please
Comment #2
hunmonk commentedbasically, you need to go to the node type edit form for a node type (ex. 'page' node type at admin/content/types/page), change the 'Type' setting to rename the type, save it, and make sure that that persistent variables are properly transferred to the new names (ie, if you change from 'page' to 'blah' for the type name, then variable 'foo_blah' should be created w/ the same value as 'foo_page', then 'foo_page' should be deleted.
Comment #3
pasqualleok, now I understand the problem with the str_replace function
created a new patch, which is much more readable, I think
how can I test the 'Reset to defaults' option? I changed it to delete the old variable, because that would the correct variable to delete. But the two variable names should be the same in this case anyway.
Comment #4
hunmonk commented@Pasqualle: couple of things:
Code style looks good. I fully tested the lastest patch, and it works properly if the type name changes, doesn't change, or if variables are reset to defaults.
The only thing I might suggest is to write out $variable_new, instead of $var_new -- but it's probably fine as is.
Comment #5
pasquallereplaced
$var_new -> $variable_new
$var_old -> $variable_old
Comment #6
pasquallenotice: Undefined index: type in ..\modules\node\node.module on line 569.
I see a php notice, when testing the "reset to defaults" function, but it was not introduced with this patch. So creating a new issue for it.
the "reset to defaults" and the type change is working correctly, so RTBC
Comment #7
pasqualleThis is an obvious programmer mistake. Explanation:
before patch
after patch
try
after str_replace $key == 'foo_foo' but should be 'comment_foo'
Comment #8
gábor hojtsyThanks, committed.
Comment #9
yched commentedShouldn't this be backported ?
Comment #10
marcingy commentedMarking as won't fix as d5 is end of life.