From 3d167ac792af9fbf721548256371fcda87e8eb2c Mon Sep 17 00:00:00 2001 From: sakamocchi Date: Sun, 20 May 2012 22:27:37 +0900 Subject: [PATCH] =?utf8?q?MERGE:=20=E3=83=AA=E3=83=93=E3=82=B8=E3=83=A7?= =?utf8?q?=E3=83=B31866=E3=80=82NucleusPlugin::apply=5Fplugin=5Foptions()?= =?utf8?q?=E3=81=AE=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1. DBハンドラーを書き換えた際の修正漏れ 2. もともとのコードのおかしな箇所の修正。対象となるすべてのプラグインのキャッシュがアップデートされていなかった Revision 1866: FIX: bugs to fail to update options in NucleusPlugin::apply_plugin_options() 1. Mis-written when applying new DB handler 2. original code bugs http://nucleuscms.svn.sourceforge.net/viewvc/nucleuscms?view=revision&revision=1866 --- nucleus/libs/PLUGIN.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/nucleus/libs/PLUGIN.php b/nucleus/libs/PLUGIN.php index 6677208..5a175c2 100644 --- a/nucleus/libs/PLUGIN.php +++ b/nucleus/libs/PLUGIN.php @@ -912,7 +912,7 @@ abstract class NucleusPlugin } // retreive any metadata - $meta = NucleusPlugin::getOptionMeta($info->oextra); + $meta = NucleusPlugin::getOptionMeta($result['oextra']); // if the option is readonly or hidden it may not be saved if ( array_key_exists('access', $meta) @@ -955,8 +955,8 @@ abstract class NucleusPlugin 'context' => $result['ocontext'], 'plugid' => $result['opid'], 'optionname' => $result['oname'], - 'contextid' => $contextid, - 'value' => &$value); + 'contextid' => $contextid, + 'value' => &$value); $manager->notify('PrePluginOptionsUpdate', $data); // delete and insert its fields of table in database @@ -966,17 +966,18 @@ abstract class NucleusPlugin $query = "INSERT INTO %s (oid, ocontextid, ovalue) VALUES (%d, %d, %s);"; $query = sprintf($query, sql_table('plugin_option'), (integer) $oid, (integer) $contextid, DB::quoteValue($value)); DB::execute($query); + + // clear option value cache if the plugin object is already loaded + $plugin=& $manager->pidLoaded($result['opid']); + if ( $plugin ) + { + $plugin->clearOptionValueCache(); + } + + continue; } } - // clear option value cache if the plugin object is already loaded - if ( is_object($info) ) - { - $plugin=& $manager->pidLoaded($result['opid']); - if ( $plugin ) - { - $plugin->clearOptionValueCache(); - } - } + continue; } return; } -- 2.11.0