モジュール開発中、製品オプションコレクションをロードする前に修正するプラグインを記述しました(説明フィールドを追加します)。はい、これ:
etc / di.xml
<type name="Magento\Catalog\Model\ResourceModel\Product\Option\Collection">
    <plugin name="addOptionDescription" type="Vendor\Module\Plugin\Product\Option\Collection" sortOrder="10" disabled="false"/>
</type>コード:
<?php
namespace Vendor\Module\Plugin\Product\Option;
use Vendor\Module\Model\OptionDescription;
use Magento\Catalog\Model\ResourceModel\Product\Option\Collection as OptionCollection;
class Collection
{
    /**
     * @var \Vendor\Module\Helper\Data
     */
    protected $helper;
    public function __construct(
        \Vendor\Module\Helper\Data $helper
    ) {
        $this->helper = $helper;
    }
    /**
     * @param OptionCollection $subject
     * @param bool $printQuery
     * @param bool $logQuery
     * @return array
     */
    public function beforeLoad($subject, $printQuery = false, $logQuery = false)
    {
        if (!$subject->isLoaded()) {
            $this->addDescriptionToResult($subject);
        }
        return [$printQuery, $logQuery];
    }
    /**
     * Add description to result
     *
     * If yo get error message "Warning: Illegal string offset 'is_in_stock' ... "
     * @see http://devdocs.magento.com/guides/v2.0/install-gde/trouble/php/tshoot_opcache.html
     *
     * @param OptionCollection $collection
     * @return OptionCollection $collection
     */
    private function addDescriptionToResult($collection)
    {
        $tableName = OptionDescription::TABLE_NAME;
        $joinDescriptionExpr = 'main_table.unique_option_id = option_description.unique_option_id AND option_description.store_id = 0';
        $collection->getSelect()->joinLeft(
            ['option_description' => $tableName],
            $joinDescriptionExpr,
            ['description' => 'description']
        );
        return $collection;
    }
    /**
     * Resolve current store id
     *
     * @return int
     */
    protected function getStoreId()
    {
        return $this->helper->resolveCurrentStoreId();
    }
}すべてが問題ないようですが...既存の製品編集ページ(バックエンド)をロードしようとすると、次のエラーが表示されます。
警告:[...] / vendor / magento / module-catalog-inventory / Ui / DataProvider / Product / Form / Modifier / AdvancedInventory.phpの行87の不正な文字列オフセット「is_in_stock」
ドキュメントに示されているように変更した場合(opcache.save_comments = 1私のphp-fpm 設定内で設定)、すべて正常に動作します。しかし、理解できません。上記のエラーの原因となっているコードと、構成を変更せずにそれを防ぐにはどうすればよいですか?