The information available is not enough. For the case i´m going to talk about, it took me a lot of time to debug and required manually update of yii2-debug libraries. Toolbar error tag reported only Serialization of closure is not allowed, but no clue about which file was generating that. My first attempt was including the file and line to the title tag, but this reports the LogTarget::class instead the real origin. I finally found the AssetPanel::save() method, in which i could try assets individually and detect the origin of failure by including a call to serialize within a try/catch block.
Also, the panel did not show any record for an error.
I think that serializations should be checked individually for each assetBundle and prevent stoppping the whole process.
What steps will reproduce the problem?
Create an assetBundle and within registerAssetFiles($view) method, store the view as a property of that assetBundle public $param was previously declared. (In my case was view, but you can store any object which includes a closure wichin one of its properties)
What's expected?
Debug panel should work show all assetBundles
What do you get instead?
Serialization of closure is not allowed as title of the toolbar tag and the AssetsPanel shows only the previous parsed bundles, without tips to error registered.
The information available is not enough. For the case i´m going to talk about, it took me a lot of time to debug and required manually update of yii2-debug libraries. Toolbar error tag reported only
Serialization of closure is not allowed
, but no clue about which file was generating that. My first attempt was including the file and line to the title tag, but this reports theLogTarget::class
instead the real origin. I finally found theAssetPanel::save()
method, in which i could try assets individually and detect the origin of failure by including a call to serialize within a try/catch block. Also, the panel did not show any record for an error. I think that serializations should be checked individually for each assetBundle and prevent stoppping the whole process.What steps will reproduce the problem?
Create an assetBundle and within
registerAssetFiles($view)
method, store the view as a property of that assetBundlepublic $param
was previously declared. (In my case was view, but you can store any object which includes a closure wichin one of its properties)What's expected?
Debug panel should work show all assetBundles
What do you get instead?
Serialization of closure is not allowed
astitle
of the toolbar tag and the AssetsPanel shows only the previous parsed bundles, without tips to error registered.Additional info