michael@531: michael@531: Activate the Drupal glue code for the FCKeditor filemanager. michael@531: michael@531: Index: sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php michael@531: --- sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php.orig 2008-03-25 16:28:24 +0100 michael@531: +++ sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php 2008-05-02 23:02:23 +0200 michael@531: @@ -39,6 +39,9 @@ michael@531: // Attention: The above 'UserFilesPath' must point to the same directory. michael@531: $Config['UserFilesAbsolutePath'] = '' ; michael@531: michael@531: +// activate Drupal glue code for filemanager michael@531: +require_once "../../../../../filemanager.config.php"; michael@531: + michael@531: // Due to security issues with Apache modules, it is recommended to leave the michael@531: // following setting enabled. michael@531: $Config['ForceSingleExtension'] = true ; michael@531: michael@531: ----------------------------------------------------------------------------- michael@531: michael@531: 1. Fix content validation in "xmlcontent" module in case michael@531: one has enabled multiple filters on a particular input format. michael@531: 2. Additionally, allow absolute paths to support .xsd/.xsl files michael@531: in arbitrary directories. michael@531: 3. Finally, do not create a new DOM and output it as XML. Instead directly michael@531: output the transformed XML in order to get rid of the declaration. michael@531: 4. Additionally, support an optional XML content template (mainly michael@531: for loading ENTITY definitions which cannot be done via XSD and XSLT) michael@531: michael@531: Index: sites/all/modules/xmlcontent/xmlcontent.module michael@531: --- sites/all/modules/xmlcontent/xmlcontent.module.orig 2007-03-14 22:59:59 +0100 michael@531: +++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-30 21:13:16 +0200 michael@531: @@ -39,8 +39,22 @@ michael@531: return t('Allows users to post XML node content and get it transformed through a configured XSLT script'); michael@531: michael@531: case 'process': michael@531: - $xslt_path = drupal_get_path('module', 'xmlcontent'). '/' . variable_get("xmlcontent_xslt_path_$format", ''); michael@531: - return _xmlcontent_transform($text, $xslt_path); michael@531: + $tpl_path = variable_get("xmlcontent_tpl_path_$format", ''); michael@531: + if ($tpl_path) { michael@531: + if (substr($tpl_path, 0, 1) != "/") michael@531: + $tpl_path = drupal_get_path('module', 'xmlcontent') . '/' . $tpl_path; michael@531: + $tpl = file_get_contents($tpl_path); michael@531: + $text = preg_replace("/&template_body;/", $text, $tpl); michael@531: + $cwd = getcwd(); michael@531: + chdir(preg_replace("/\\/[^\\/]+\$/", "", $tpl_path)); michael@531: + } michael@531: + $xslt_path = variable_get("xmlcontent_xslt_path_$format", ''); michael@531: + if (substr($xslt_path, 0, 1) != "/") michael@531: + $xslt_path = drupal_get_path('module', 'xmlcontent') . '/' . $xslt_path; michael@531: + $result = _xmlcontent_transform($text, $xslt_path); michael@531: + if ($tpl_path) michael@531: + chdir($cwd); michael@531: + return $result; michael@531: michael@531: case 'settings': michael@531: return _xmlcontent_filter_settings($format); michael@531: @@ -72,7 +86,7 @@ michael@531: } michael@531: // Does the input format of this node use XML Content filter? michael@531: $format = filter_resolve_format($node->format); michael@531: - $module = db_result(db_query('SELECT module FROM {filters} WHERE format = %d', $format)); michael@531: + $module = db_result(db_query("SELECT module FROM {filters} WHERE format = %d AND module = 'xmlcontent'", $format)); michael@531: if ($module != 'xmlcontent') { michael@531: return; michael@531: } michael@531: @@ -83,7 +97,10 @@ michael@531: return; michael@531: } michael@531: michael@531: - $schema_path = drupal_get_path('module', 'xmlcontent'). '/' . variable_get("xmlcontent_schema_path_$format",''); michael@531: + $schema_path = variable_get("xmlcontent_schema_path_$format", ''); michael@531: + if (substr($schema_path, 0, 1) != "/") michael@531: + $schema_path = drupal_get_path('module', 'xmlcontent') . '/' . $schema_path; michael@531: + michael@531: if (!is_file($schema_path) && ($validation == 'xsd' or $validation == 'rng')) { michael@531: $schema_path = null; michael@531: watchdog( 'xmlcontent', t('Validation required but no schema file'), WATCHDOG_WARNING ); michael@531: @@ -93,7 +110,23 @@ michael@531: libxml_clear_errors(); michael@531: libxml_use_internal_errors(true); michael@531: michael@531: - if (!_xmlcontent_validate($node->body, $validation, $schema_path)) { michael@531: + $text = $node->body; michael@531: + $tpl_path = variable_get("xmlcontent_tpl_path_$format", ''); michael@531: + if ($tpl_path) { michael@531: + if (substr($tpl_path, 0, 1) != "/") michael@531: + $tpl_path = drupal_get_path('module', 'xmlcontent') . '/' . $tpl_path; michael@531: + $tpl = file_get_contents($tpl_path); michael@531: + $text = preg_replace("/&template_body;/", $text, $tpl); michael@531: + $cwd = getcwd(); michael@531: + chdir(preg_replace("/\\/[^\\/]+\$/", "", $tpl_path)); michael@531: + } michael@531: + michael@531: + $result = _xmlcontent_validate($text, $validation, $schema_path); michael@531: + michael@531: + if ($tpl_path) michael@531: + chdir($cwd); michael@531: + michael@531: + if (!$result) { michael@531: form_set_error('body', t('XML Content: Invalid XML') . libxml_errors_string()); michael@531: } michael@531: michael@531: @@ -156,6 +189,13 @@ michael@531: '#collapsible' => TRUE, michael@531: '#collapsed' => FALSE, michael@531: ); michael@531: + $form['xmlcontent']["xmlcontent_tpl_path_$format"] = array( michael@531: + '#type' => 'textfield', michael@531: + '#title' => t('Optional XML Template File Path'), michael@531: + '#default_value' => variable_get("xmlcontent_tpl_path_$format", ''), michael@531: + '#field_prefix' => drupal_get_path('module', 'xmlcontent'). '/', michael@531: + '#description' => t('The file path to the optional XML template, wrapper around the XML content before processing.'), michael@531: + ); michael@531: $form['xmlcontent']["xmlcontent_xslt_path_$format"] = array( michael@531: '#type' => 'textfield', michael@531: '#title' => t('XSLT Script File Path'), michael@531: @@ -218,6 +258,8 @@ michael@531: michael@531: // Load the XML document michael@531: $dom = new DomDocument('1.0', 'UTF-8'); michael@531: + $dom->resolveExternals = true; michael@531: + $dom->substituteEntities = true; michael@531: $valid = $dom->loadXML($xml); michael@531: if (!$valid) { michael@531: watchdog('xmlcontent', "Invalid XML Content", WATCHDOG_WARNING); michael@531: @@ -227,6 +269,8 @@ michael@531: // Load the XSLT script michael@531: // TODO: is there a way to cache it, or not necessary michael@531: $xsl = new DomDocument('1.0', 'UTF-8'); michael@531: + $xsl->resolveExternals = true; michael@531: + $xsl->substituteEntities = true; michael@531: $xsl->load($path_to_xslt); michael@531: michael@531: // Create the XSLT processor michael@531: @@ -242,10 +286,8 @@ michael@531: } michael@531: michael@531: // Transform michael@531: - $newdom = $proc->transformToDoc($dom); michael@531: - michael@531: - // Return the output as XML text (in fact subset of XHTML, depending on the XSLT script) michael@531: - return $newdom->saveXML(); michael@531: + $xml = $proc->transformToXML($dom); michael@531: + return $xml; michael@531: } michael@531: michael@531: michael@531: ----------------------------------------------------------------------------- michael@531: michael@531: Fix upgrading in "simplefeed" module if PostgreSQL is used. michael@531: Fix modules as Drupal 6.2 does not provide db_num_rows() anymore. michael@531: michael@531: Index: sites/all/modules/simplefeed/simplefeed.install michael@531: --- sites/all/modules/simplefeed/simplefeed.install.orig 2008-06-11 07:22:28 +0200 michael@531: +++ sites/all/modules/simplefeed/simplefeed.install 2008-06-14 15:09:53 +0200 michael@531: @@ -31,8 +31,17 @@ michael@531: michael@531: function simplefeed_update_2() { michael@531: $ret = array(); michael@531: - $ret[] = update_sql("ALTER TABLE {simplefeed_feed} DROP INDEX url"); michael@531: - $ret[] = update_sql("ALTER TABLE {simplefeed_feed} CHANGE url url text"); michael@531: + switch ($GLOBALS['db_type']) { michael@531: + case 'mysql': michael@531: + case 'mysqli': michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed} DROP INDEX url"); michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed} CHANGE url url text"); michael@531: + break; michael@531: + case 'pgsql': michael@531: + $ret[] = update_sql("DROP INDEX {simplefeed_feed}_url_idx"); michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed} ALTER COLUMN url TYPE text"); michael@531: + break; michael@531: + } michael@531: return $ret; michael@531: } michael@531: michael@531: Index: sites/all/modules/simplefeed/simplefeed_item.install michael@531: --- sites/all/modules/simplefeed/simplefeed_item.install.orig 2008-06-11 07:22:28 +0200 michael@531: +++ sites/all/modules/simplefeed/simplefeed_item.install 2008-06-14 16:23:01 +0200 michael@531: @@ -60,8 +62,18 @@ michael@531: michael@531: function simplefeed_item_update_3() { michael@531: $ret = array(); michael@531: - $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE url url text"); michael@531: - $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE iid iid varchar(32) NOT NULL"); michael@531: + switch ($GLOBALS['db_type']) { michael@531: + case 'mysql': michael@531: + case 'mysqli': michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE url url text"); michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} CHANGE iid iid varchar(32) NOT NULL"); michael@531: + break; michael@531: + case 'pgsql': michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} ALTER COLUMN url TYPE text"); michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} ALTER COLUMN iid TYPE VARCHAR(32)"); michael@531: + $ret[] = update_sql("ALTER TABLE {simplefeed_feed_item} ALTER COLUMN iid SET NOT NULL"); michael@531: + break; michael@531: + } michael@531: return $ret; michael@531: } michael@531: michael@531: ----------------------------------------------------------------------------- michael@531: michael@531: Fix helpers module for PostgreSQL usage. michael@531: michael@531: Index: sites/all/modules/helpers/helpers_database.module michael@531: --- sites/all/modules/helpers/helpers_database.module.orig 2008-04-23 04:38:34 +0200 michael@531: +++ sites/all/modules/helpers/helpers_database.module 2008-06-16 18:06:41 +0200 michael@531: @@ -16,7 +16,7 @@ michael@531: * michael@531: * NOTE: This is open code - do not put a function declaration on it. michael@531: */ michael@531: - $db_types = array('mysql', 'mysqli', 'postgres'); michael@531: + $db_types = array('mysql', 'mysqli', 'pgsql'); michael@531: $dbtype = $GLOBALS['db_type']; michael@531: if (in_array($dbtype, $db_types)) { michael@531: // Using include because the site may not be using this so we don't want a fatal error. michael@531: Index: sites/all/modules/helpers/includes/dra_pgsql.inc michael@531: --- sites/all/modules/helpers/includes/dra_pgsql.inc.orig 2008-06-16 17:49:43 +0200 michael@531: +++ sites/all/modules/helpers/includes/dra_pgsql.inc 2008-06-16 18:05:19 +0200 michael@531: @@ -0,0 +1,40 @@ michael@531: + value michael@531: + * 2 columns 1st value => 2nd value michael@531: + * 3 or more 1st value => array(2nd value, 3rd value, ...) michael@531: + */ michael@531: +function db_result_array($result) { michael@531: + $array = array(); michael@531: + while ($row = pg_fetch_array($result, NULL, PGSQL_NUM)) { michael@531: + $y = count($row); michael@531: + switch ($y) { michael@531: + case 0: michael@531: + drupal_set_message(t('Db_result_array found no columns in the result set.'), 'error'); michael@531: + return false; michael@531: + michael@531: + case 1: michael@531: + $array[$row[0]] = $row[0]; michael@531: + break; michael@531: + michael@531: + case 2: michael@531: + $array[$row[0]] = $row[1]; michael@531: + break; michael@531: + michael@531: + default: michael@531: + $array[$row[0]] = array_slice($row, 1); michael@531: + break; michael@531: + } michael@531: + } michael@531: + return $array; michael@531: +} michael@531: michael@531: ----------------------------------------------------------------------------- michael@531: michael@531: Fix PostgreSQL usage. michael@531: michael@531: Index: sites/all/modules/nodeupdates/nodeupdates.install michael@531: --- sites/all/modules/nodeupdates/nodeupdates.install.orig 2007-12-31 15:11:57 +0100 michael@531: +++ sites/all/modules/nodeupdates/nodeupdates.install 2008-06-18 18:00:08 +0200 michael@531: @@ -15,10 +15,10 @@ michael@531: michael@531: case 'pgsql': michael@531: db_query("CREATE TABLE {nodeupdates} ( michael@531: - nid integer(10) NOT NULL default '0', michael@531: + nid integer NOT NULL default '0', michael@531: title varchar(128) NOT NULL default '', michael@531: - message longtext NOT NULL default '', michael@531: - timestamp integer(11) NOT NULL default '0' michael@531: + message text NOT NULL default '', michael@531: + timestamp integer NOT NULL default '0' michael@531: )"); michael@531: break; michael@531: } michael@531: michael@531: ----------------------------------------------------------------------------- michael@531: michael@531: Since PHP 5.3 calling functions with objects and having the function michael@531: declare the object parameter as a reference causes a run-time error. michael@531: The "call-by-reference" indicator "&" has to be removed from parameters michael@531: which are known to be passed as objects (by reference). michael@531: michael@531: Index: sites/all/modules/diff/diff.module michael@531: --- sites/all/modules/diff/diff.module.orig 2010-08-12 18:34:08.000000000 +0200 michael@531: +++ sites/all/modules/diff/diff.module 2010-08-13 14:18:26.000000000 +0200 michael@531: @@ -87,7 +87,7 @@ michael@531: /** michael@531: * Implementation of hook_menu_alter(). michael@531: */ michael@531: -function diff_menu_alter(&$callbacks) { michael@531: +function diff_menu_alter($callbacks) { michael@531: // Overwrite the default 'Revisions' page michael@531: $callbacks['node/%node/revisions']['page callback'] = 'diff_diffs_overview'; michael@531: $callbacks['node/%node/revisions']['module'] = 'diff'; michael@531: @@ -133,7 +133,7 @@ michael@531: /** michael@531: * Implementation of hook_nodeapi(). michael@531: */ michael@531: -function diff_nodeapi(&$node, $op, $teaser, $page) { michael@531: +function diff_nodeapi($node, $op, $teaser, $page) { michael@531: if ($page && $op == 'view' && user_access('view revisions') && variable_get('show_diff_inline_'. $node->type, FALSE)) { michael@531: // Ugly but cheap way to check that we are viewing a node's revision page. michael@531: if (arg(2) === 'revisions' && arg(3) === $node->vid) { michael@531: @@ -149,7 +149,7 @@ michael@531: /** michael@531: * Implementation of hook_form_alter(). michael@531: */ michael@531: -function diff_form_alter(&$form, $form_state, $form_id) { michael@531: +function diff_form_alter($form, $form_state, $form_id) { michael@531: if (isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id) { michael@531: // Add a 'View changes' button on the node edit form. michael@531: if (variable_get('show_preview_changes_'. $form['type']['#value'], TRUE) && $form['nid']['#value'] > 0) { michael@531: @@ -194,7 +194,7 @@ michael@531: /** michael@531: * Callback if 'View changes' is pressed. michael@531: */ michael@531: -function diff_node_form_build_preview_changes($form, &$form_state) { michael@531: +function diff_node_form_build_preview_changes($form, $form_state) { michael@531: module_load_include('inc', 'diff', 'diff.pages'); michael@531: $node = node_form_submit_build_node($form, $form_state); michael@531: michael@531: @@ -323,7 +323,7 @@ michael@531: /** michael@531: * Form submission handler for diff_inline_form() for JS-disabled clients. michael@531: */ michael@531: -function diff_inline_form_submit(&$form, &$form_state) { michael@531: +function diff_inline_form_submit($form, $form_state) { michael@531: if (isset($form_state['values']['revision'], $form_state['values']['node'])) { michael@531: $node = $form_state['values']['node']; michael@531: $vid = $form_state['values']['revision']; michael@531: