aros_acosのシェル追加でワーニング

ACL設定中、シェルからaros_acosの設定を入れたら、ワーニングが出ました。


ワーニングですし、データは問題なく入ってて、かつ本番運用では発生してもおそらく問題にならないと思われるので、参考までに ^-^;


くだんのワーニング。

[cake@cake console]$ ./cake acl grant Group.4 controllers deny


PHP Warning:  <span style = "color:Red;text-align:left"><b>SQL Error:</b> 1064: You have an error in your SQL syntax; heck the manual that corresponds to your MySQL server version for the right syntax to use near 'setErrorMessageI18n' a line 1</span> in (ROOT DIR)/cake/libs/model/datasources/dbo_source.php on line 525

Warning: <span style = "color:Red;text-align:left"><b>SQL Error:</b> 1064: You have an error in your SQL syntax; checkthe manual that corresponds to your MySQL server version for the right syntax to use near 'setErrorMessageI18n' at lin 1</span> in (ROOT DIR)/cake/libs/model/datasources/dbo_source.php on line 525
<pre><p style = "text-align:left"><b>Query:</b> setErrorMessageI18n </p></pre>PHP Warning:  <span style = "color:Red;txt-align:left"><b>SQL Error:</b> 1064: You have an error in your SQL syntax; check the manual that corresponds to yourMySQL server version for the right syntax to use near 'replaceValidationErrorMessagesI18n' at line 1</span> in /var/ww/html/cake-frame/cake/libs/model/datasources/dbo_source.php on line 525

Warning: <span style = "color:Red;text-align:left"><b>SQL Error:</b> 1064: You have an error in your SQL syntax; checkthe manual that corresponds to your MySQL server version for the right syntax to use near 'replaceValidationErrorMessaesI18n' at line 1</span> in (ROOT DIR)/cake/libs/model/datasources/dbo_source.php on line 525
<pre><p style = "text-align:left"><b>Query:</b> replaceValidationErrorMessagesI18n </p></pre>Permission granted.


エラー(ワーニング)が出た時の定石

  • まずは1行目を解釈しろ。その下は、大体派生エラーだ。

に乗っ取って、抜粋。

PHP Warning:  <span style = "color:Red;text-align:left"><b>SQL Error:</b> 1064: You have an error in your SQL syntax; heck the manual that corresponds to your MySQL server version for the right syntax to use near 'setErrorMessageI18n' a line 1</span> in (ROOT DIR)/cake/libs/model/datasources/dbo_source.php on line 525


cake/libs/model/datasources/dbo_source.php on line 525付近

	function showQuery($sql) {
		$error = $this->error;
		if (strlen($sql) > 200 && !$this->fullDebug && Configure::read() > 1) {
			$sql = substr($sql, 0, 200) . '[...]';
		}
		if (Configure::read() > 0) {
			$out = null;
			if ($error) {
[525行目]				trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING);
			} else {


つまり、

{$this->error}

がエラーである、と。

$this->errorに該当する箇所をさらに抜粋

1064: You have an error in your SQL syntax; heck the manual that corresponds to your MySQL server version for the right syntax to use near 'setErrorMessageI18n' a line 1


・・・ここから先は、あくまで、私の推測です。


「setErrorMessageI18n」とは、主にvalidateメッセージを多言語化したくて使わせていただいてる、cakephperさん作のCakeplusプラグインの関数です。


Cakeplusプラグインが、SQLエラーメッセージの処理と、何か関連を持っている模様?


そして、この先は、$thisの奥深さに私の技量では検証できない次第;;


Warningレベルで、結果自体には問題ありませんし、
Debuggingの設定を本番運用にすれば出力しないモノなので、ささいですが ^^;


(余談)
ワーニングメッセージでググると、Warning表示状態で運用してるサイト発見。おいおい。
運用時設定は、気をつけなければなりませんね ^^;