最新版アップデート後のエラー 投稿する

投稿者:SPS  投稿日時:2021-12-25 21:09:20
カスタムサーチフィールドでの表示が出なくなり、SOY CMS,Shopともに最新版にアップデートしたのですが、アップデート後shopのページ全てに以下のエラーが出てページが表示されなくなりました。


Parse error: syntax error, unexpected 'is_array' (T_STRING) in /home/users/2/lolipop.jp-******/web/***/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php on line 10

よろしくお願いいたします。
投稿者:齋藤毅  投稿日時:2021-12-26 05:36:08
商品詳細情報追加プラグインというものが古くて未対応でした。
/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php
のファイルに下記ページのコードで上書きするとエラーが消えるはずです。
https://github.com/inunosinsi/soycms/blob/master/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php
投稿者:SPS  投稿日時:2021-12-26 08:51:33
お世話になります。
迅速な対応ありがとうございます。
上書きしたところ、エラーメッセージが以下のように変化しました。


Warning: Declaration of CommonItemDescriptionField::onDelete(int $itemId) should be compatible with SOYShopItemCustomFieldBase::onDelete($id) in /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php on line 88

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Fatal error: Uncaught TypeError: Argument 1 passed to soyshop_get_item_attribute_value() must be of the type int, null given, called in /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php on line 61 and defined in /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/src/base/func/dao.php:196 Stack trace: #0 /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php(61): soyshop_get_item_attribute_value(NULL, 'item_descrption...', 'string') #1 /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/src/logic/plugin/extensions/soyshop.item.customfield.php(66): CommonItemDescriptionField->onOutput(Object(SOYShop_ItemListComponent), Object(SOYShop_Item)) #2 /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/lib/soy2_build.php(8643): SOYShopItemCustomFieldDeletageAction->run('soyshop.item.cu...', ' in /home/users/2/lolipop.jp-***********/web/********/cms/soyshop/webapp/src/base/func/dao.php on line 196

よろしくお願いいたします。
投稿者:齋藤毅  投稿日時:2021-12-26 15:54:10
エラーメッセージのファイルの該当する箇所の
$ids = soy2_unserialize(soyshop_get_item_attribute_value($item->getId(), self::FIELD_ID, "string"));

$ids = (is_numeric($item->getId())) ? soy2_unserialize(soyshop_get_item_attribute_value($item->getId(), self::FIELD_ID, "string")) : array();
にすれば良いはずです。
投稿者:SPS  投稿日時:2021-12-26 17:39:47
ありがとうございます。
ページは表示されるようになりましたがエラーメッセージは以下のように変化しました。
また、/soyshop/webapp/lib/soy2_build.php内に
$ids = soy2_unserialize(soyshop_get_item_attribute_value($item->getId(), self::FIELD_ID, "string"));
は含まれていませんでした。
よろしくお願いいたします。


Warning: Declaration of CommonItemDescriptionField::onDelete(int $itemId) should be compatible with SOYShopItemCustomFieldBase::onDelete($id) in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php on line 88

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 2695

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169

Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169
Warning: session_start(): Cannot start session when headers already sent in /home/users/2/lolipop.jp-***********/web/***********/cms/soyshop/webapp/lib/soy2_build.php on line 9169
投稿者:齋藤毅  投稿日時:2021-12-27 05:00:15
エラーメッセージに記述されているファイルは
/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php
の方になります。

他の対応として
function onDelete(int $itemId)
というコードがありますので、

function onDelete($itemId)
もしくは
function onDelete($id)
に変えてみてください。
投稿者:SPS  投稿日時:2021-12-27 16:43:22
ありがとうございます。
編集したのは
/cms/soyshop/webapp/src/module/plugins/common_item_description/soyshop.item.customfield.php
内の該当箇所のみで、上記の状態になりました。他のファイルは編集していません。


とりあえずご指示通り
function onDelete(int $itemId)
の書き換えを行い、無事に表示されるようになりました。
ありがとうございました。
ログインして投稿する