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

投稿者:s_sato  投稿日時:2021-12-10 09:47:52
2.4.0.12にアップデートしたところ以下のエラーが出るようになりました。
PHPを7.4から8.0に変更しても同じようにエラーが出ます。
アップデート前のバージョンがどのバージョンだったか確認していなかったのでわからないのですが、こまめに上げていたので少し前だと思います。
どのように対処したらよろしいでしょうか。

Fatal error: Uncaught TypeError: Argument 1 passed to soyshop_convert_date_string() must be of the type int, object given, called in /home/***/www/***soy/soyshop/webapp/src/module/plugins/campaign/component/CampaignListComponent.class.php on line 16 and defined in /home/***/www/***soy/soyshop/webapp/src/base/func/common.php:855 Stack trace: #0 /home/***/www/***soy/soyshop/webapp/src/module/plugins/campaign/component/CampaignListComponent.class.php(16): soyshop_convert_date_string(Object(HTMLList_DummyObject)) #1 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(6794): CampaignListComponent->populateItem(Object(HTMLList_DummyObject), NULL, -1, 0) #2 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(6759): HTMLList->populateItemImpl(Object(HTMLList_DummyObject), NULL, -1, 0) #3 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(6988): HTMLList->execute() #4 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(7006): HTMLPage->add('campaign_list', Object in /home/***/www/***soy/soyshop/webapp/src/base/func/common.php on line 855
投稿者:齋藤毅  投稿日時:2021-12-10 09:56:29
雑な対応になりますが、
エラーメッセージに記載されているCampainListComponent.class.phpの16行目付近の
$this->addLabel("post_period", array(
	"text" => soyshop_convert_date_string($entity->getPostPeriodStart()) . " 〜 " . soyshop_convert_date_string($entity->getPostPeriodEnd()) . $status
));

$this->addLabel("post_period", array(
	"text" => soyshop_convert_date_string((int)$entity->getPostPeriodStart()) . " 〜 " . soyshop_convert_date_string((int)$entity->getPostPeriodEnd()) . $status
));
にすれば良いです。
※$entity二つの前に(int)を挿入しています。
投稿者:s_sato  投稿日時:2021-12-10 09:59:05
ありがとうございます。
やってみます。
投稿者:s_sato  投稿日時:2021-12-10 10:15:50
上記のエラーはなくなったのですが、かわりに別のエラーがでました。

Fatal error: Uncaught TypeError: soyshop_get_item_attribute_value(): Argument #1 ($itemId) must be of type int, null given, called in /home/***/www/***soy/soyshop/webapp/src/module/plugins/item_standard/soyshop.item.customfield.php on line 128 and defined in /home/***/www/***soy/soyshop/webapp/src/base/func/dao.php:90 Stack trace: #0 /home/***/www/***soy/soyshop/webapp/src/module/plugins/item_standard/soyshop.item.customfield.php(128): soyshop_get_item_attribute_value() #1 /home/***/www/***soy/soyshop/webapp/src/logic/plugin/extensions/soyshop.item.customfield.php(66): ItemStandardField->onOutput() #2 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(8670): SOYShopItemCustomFieldDeletageAction->run() #3 /home/***/www/***soy/soyshop/webapp/src/module/site/common/output_item.php(389): SOY2Plugin::invoke() #4 /home/***/www/***soy/soyshop/webapp/src/base/site/classes/SOYShop_ItemListComponent.class.php(25): soyshop_output_item() #5 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(6794): SOYShop_ItemListComponent->populateItem() #6 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(6759): HTMLList->populateItemImpl() #7 /home/***/www/***soy/soyshop/webapp/src/base/site/classes/SOYShop_ItemListComponent.class.php(15): HTMLList->execute() #8 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(6988): SOYShop_ItemListComponent->execute() #9 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(7006): HTMLPage->add() #10 /home/***/www/***soy/soyshop/webapp/src/base/site/pages/SOYShop_ComplexPageBase.class.php(24): HTMLPage->createAdd() #11 /home/***/www/***soy/soyshop/webapp/src/base/controller/output.php(18): SOYShop_ComplexPageBase->build() #12 /home/***/www/***soy/soyshop/webapp/src/base/SOYShopSiteController.class.php(83): output_page() #13 /home/***/www/***soy/soyshop/webapp/lib/soy2_build.php(236): SOYShopSiteController->execute() #14 /home/***/www/***soy/***/index.php(8): SOY2PageController::run() #15 /home/***/www/***soy/index.php(3): include_once('...') #16 {main} thrown in /home/***/www/***soy/soyshop/webapp/src/base/func/dao.php on line 90

2.3.4.87にバージョンダウンしたところ、問題なく動作したので、ひとまずこれで置いておくことにしました。
投稿者:齋藤毅  投稿日時:2021-12-10 10:18:14
soyshop.item.customfield.phpの128行目にある
$v = soyshop_get_item_attribute_value($item->getId(), $values["id"], "string");

$v = soyshop_get_item_attribute_value((int)$item->getId(), $values["id"], "string");
に変更すれば良いです。
投稿者:s_sato  投稿日時:2021-12-10 10:23:25
ありがとうございます!
あとで試してみます!
ログインして投稿する