Closed davidbrandastic closed 6 years ago
Looks like Magento changed their Magento\Config\Model\Config\Backend\Serialized\ArraySerialized
class to use Json instead of serialize()
:man_facepalming:
We'll need to:
\Meanbee\ServiceWorker\Setup\InstallData
to use the same serializer Magento uses when saving initial values.\Meanbee\ServiceWorker\Helper\Config::getCustomStrategies
to also use the serializer class instead of raw unserialize()
method.
Started testing this today and ran into an error preventing the serviceworker.js from being rendered correctly.
main.CRITICAL: Notice: unserialize(): Error at offset 0 of 60 bytes in ----\vendor\meanbee\magento2-serviceworker\src\Helper\Config.php on line 69 [] []
After checking the config it appears that web/serviceworker/custom_strategies is stored as a json encoded array rather than a serialized array, thus causing the unserialize to fail. Changing unserialize to json_decode seems to clear up the issue with the logged error and the empty serviceworker.js
Tested on: Clean composer install of Magento 2.2.1, meanbee/magento2-serviceworker, and meanbee/magento2-webappmanifest