Closed (fixed)
Project:
Markup
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2009 at 11:09 UTC
Updated:
4 Aug 2009 at 14:40 UTC
Hi,
I have written markup_update_6000() in a way that can provide feedback when executed by update.php
Also, rebuilds content caches if any field has been updated.
/**
* Convert text_markup setting to markup since form_markup module no longer
* uses markup setting in D6.
*/
function markup_update_6000() {
$ret = array();
$rebuild_cache = FALSE;
$result = db_query("SELECT * FROM {content_node_field} WHERE type = 'markup'");
while ($markup = db_fetch_object($result)) {
$global_settings = unserialize($markup->global_settings);
if (isset($global_settings['text_markup'])) {
$global_settings['markup'] = $global_settings['text_markup'];
unset($global_settings['text_markup']);
// We can't use update_sql() here because of curly braces in serialized
// array.
db_query("UPDATE {content_node_field} SET global_settings = '%s' WHERE field_name = '%s'", serialize($global_settings), $markup->field_name);
$ret[] = array(
'success' => TRUE,
'query' => strtr('Settings updated for field %field', array('%field' => check_plain($markup->field_name))),
);
$rebuild_cache = TRUE;
}
}
// Rebuild content caches only if necessary.
if ($rebuild_cache) {
content_clear_type_cache();
}
return $ret;
}
Please, let me know if you wish a proper patch.
Comments
Comment #1
markus_petrux commentedComment #2
cyu commentedThank you markus, should show up in next packaged dev: http://drupal.org/cvs?commit=240810
And thank you also for debugging this field with multigroup. I'll give it a try with the latest CCK dev and look at that related CCK issue you've linked.
Comment #3
markus_petrux commentedIt seems like markup.install has gone. ¿?
Comment #4
cyu commentedHmm...should be there now. Not sure what happened there.