OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 23-May-2008 11:27:19
Branch: HEAD Handle: 2008052310271800
Modified files:
openpkg-src/drupal drupal.patch
Log:
hmmm.... Drupal uses the 'aid' field of the 'actions' table
incorrectly at a lot more code locations. Fix all of them, too
Summary:
Revision Changes Path
1.11 +95 -2 openpkg-src/drupal/drupal.patch
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/drupal/drupal.patch
============================================================================
$ cvs diff -u -r1.10 -r1.11 drupal.patch
--- openpkg-src/drupal/drupal.patch 23 May 2008 08:44:10 -0000 1.10
+++ openpkg-src/drupal/drupal.patch 23 May 2008 09:27:18 -0000 1.11
@@ -330,7 +330,7 @@
--- /dev/null 2008-05-02 21:08:21 +0200
+++ sites/all/modules/img_assist/img_assist_popup.js 2008-05-02 21:05:56
+0200
@@ -0,0 +1,20 @@
-+/* $Id: drupal.patch,v 1.10 2008/05/23 08:44:10 rse Exp $ */
++/* $Id: drupal.patch,v 1.11 2008/05/23 09:27:18 rse Exp $ */
+
+function launch_popup(nid, mw, mh) {
+ var ox = mw;
@@ -461,7 +461,7 @@
-----------------------------------------------------------------------------
-Fix "Action" administration dialog.
+Fix "Action" related administration dialog and corresponding run-time
handling.
Index: modules/system/system.module
--- modules/system/system.module.orig 2008-04-09 23:11:49 +0200
@@ -476,3 +476,96 @@
$edit['actions_type'] = $data->type;
$function = $data->callback;
+Index: includes/actions.inc
+--- includes/actions.inc.orig 2007-12-31 15:51:04 +0100
++++ includes/actions.inc 2008-05-23 11:22:17 +0200
+@@ -54,7 +54,7 @@
+ $where_values = array();
+ foreach ($action_ids as $action_id) {
+ if (is_numeric($action_id)) {
+- $where[] = 'OR aid = %d';
++ $where[] = "OR aid = '%s'";
+ $where_values[] = $action_id;
+ }
+ elseif (isset($available_actions[$action_id])) {
+@@ -93,7 +93,7 @@
+ else {
+ // If it's a configurable action, retrieve stored parameters.
+ if (is_numeric($action_ids)) {
+- $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid
= %d", $action_ids));
++ $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid
= '%s'", $action_ids));
+ $function = $action->callback;
+ $context = array_merge($context, unserialize($action->parameters));
+ $result[$action_ids] = $function($object, $context, $a1, $a2);
+@@ -325,7 +325,7 @@
+ function actions_save($function, $type, $params, $desc, $aid = NULL) {
+ $serialized = serialize($params);
+ if ($aid) {
+- db_query("UPDATE {actions} SET callback = '%s', type = '%s', parameters
= '%s', description = '%s' WHERE aid = %d", $function, $type, $serialized,
$desc, $aid);
++ db_query("UPDATE {actions} SET callback = '%s', type = '%s', parameters
= '%s', description = '%s' WHERE aid = '%s'", $function, $type, $serialized,
$desc, $aid);
+ watchdog('actions', 'Action %action saved.', array('%action' => $desc));
+ }
+ else {
+@@ -333,7 +333,7 @@
+ // separate table for numeric aids.
+ db_query('INSERT INTO {actions_aid} VALUES (default)');
+ $aid = db_last_insert_id('actions_aid', 'aid');
+- db_query("INSERT INTO {actions} (aid, callback, type, parameters,
description) VALUES (%d, '%s', '%s', '%s', '%s')", $aid, $function, $type,
$serialized, $desc);
++ db_query("INSERT INTO {actions} (aid, callback, type, parameters,
description) VALUES ('%s', '%s', '%s', '%s', '%s')", $aid, $function, $type,
$serialized, $desc);
+ watchdog('actions', 'Action %action created.', array('%action' =>
$desc));
+ }
+
+@@ -350,7 +350,7 @@
+ * The appropriate action row from the database as an object.
+ */
+ function actions_load($aid) {
+- return db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d",
$aid));
++ return db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid =
'%s'", $aid));
+ }
+
+ /**
+@@ -360,6 +360,6 @@
+ * integer The ID of the action to delete.
+ */
+ function actions_delete($aid) {
+- db_query("DELETE FROM {actions} WHERE aid = %d", $aid);
++ db_query("DELETE FROM {actions} WHERE aid = '%s'", $aid);
+ module_invoke_all('actions_delete', $aid);
+ }
+Index: modules/user/user.admin.inc
+--- modules/user/user.admin.inc.orig 2008-01-16 23:54:41 +0100
++++ modules/user/user.admin.inc 2008-05-23 11:24:13 +0200
+@@ -737,13 +737,13 @@
+ form_set_error('mask', t('You must enter a mask.'));
+ }
+ else {
+- db_query("UPDATE {access} SET mask = '%s', type = '%s', status = '%s'
WHERE aid = %d", $edit['mask'], $edit['type'], $edit['status'], $aid);
++ db_query("UPDATE {access} SET mask = '%s', type = '%s', status = '%s'
WHERE aid = '%s'", $edit['mask'], $edit['type'], $edit['status'], $aid);
+ drupal_set_message(t('The access rule has been saved.'));
+ drupal_goto('admin/user/rules');
+ }
+ }
+ else {
+- $edit = db_fetch_array(db_query('SELECT aid, type, status, mask FROM
{access} WHERE aid = %d', $aid));
++ $edit = db_fetch_array(db_query('SELECT aid, type, status, mask FROM
{access} WHERE aid = '%s'', $aid));
+ }
+ return drupal_get_form('user_admin_access_edit_form', $edit, t('Save
rule'));
+ }
+@@ -859,7 +859,7 @@
+ */
+ function user_admin_access_delete_confirm($form_state, $aid = 0) {
+ $access_types = array('user' => t('username'), 'mail' => t('e-mail'),
'host' => t('host'));
+- $edit = db_fetch_object(db_query('SELECT aid, type, status, mask FROM
{access} WHERE aid = %d', $aid));
++ $edit = db_fetch_object(db_query("SELECT aid, type, status, mask FROM
{access} WHERE aid = '%s'", $aid));
+
+ $form = array();
+ $form['aid'] = array('#type' => 'hidden', '#value' => $aid);
+@@ -873,7 +873,7 @@
+ }
+
+ function user_admin_access_delete_confirm_submit($form, &$form_state) {
+- db_query('DELETE FROM {access} WHERE aid = %d',
$form_state['values']['aid']);
++ db_query("DELETE FROM {access} WHERE aid = '%s'",
$form_state['values']['aid']);
+ drupal_set_message(t('The access rule has been deleted.'));
+ $form_state['redirect'] = 'admin/user/rules';
+ return;
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]