Closed Gaspadlo closed 1 year ago
Should be fixed for the next release. To get the fix early, change your verbb/field-manager
requirement in composer.json
to:
"require": {
"verbb/field-manager": "dev-craft-4 as 3.0.2",
"...": "..."
}
Then run composer update
.
Fixed in 3.0.3
Describe the bug
Creating a new matrix field type end with a type error.
{ "name":"Exception", "message":"Cannot assign string to property craft\\models\\MatrixBlockType::$fieldId of type ?int", "code":0, "error":"Cannot assign string to property craft\\models\\MatrixBlockType::$fieldId of type ?int", "exception":"TypeError", "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/fields/Matrix.php", "line":296, "trace":[ { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/base/Component.php", "line":180, "function":"setBlockTypes", "class":"craft\\fields\\Matrix", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/BaseYii.php", "line":558, "function":"__set", "class":"yii\\base\\Component", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/base/BaseObject.php", "line":107, "function":"configure", "class":"yii\\BaseYii", "type":"::" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/base/Model.php", "line":78, "function":"__construct", "class":"yii\\base\\BaseObject", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/fields/Matrix.php", "line":168, "function":"__construct", "class":"craft\\base\\Model", "type":"->" }, { "function":"__construct", "class":"craft\\fields\\Matrix", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/di/Container.php", "line":419, "function":"newInstanceArgs", "class":"ReflectionClass", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/di/Container.php", "line":170, "function":"build", "class":"yii\\di\\Container", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/BaseYii.php", "line":365, "function":"get", "class":"yii\\di\\Container", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/Craft.php", "line":53, "function":"createObject", "class":"yii\\BaseYii", "type":"::" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/helpers/Component.php", "line":121, "function":"createObject", "class":"Craft", "type":"::" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/services/Fields.php", "line":593, "function":"createComponent", "class":"craft\\helpers\\Component", "type":"::" }, { "file":"/var/www/html/craftcms/vendor/verbb/field-manager/src/controllers/BaseController.php", "line":264, "function":"createField", "class":"craft\\services\\Fields", "type":"->" }, { "function":"actionSaveField", "class":"verbb\\fieldmanager\\controllers\\BaseController", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/base/InlineAction.php", "line":57, "function":"call_user_func_array" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/base/Controller.php", "line":178, "function":"runWithParams", "class":"yii\\base\\InlineAction", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/base/Module.php", "line":552, "function":"runAction", "class":"yii\\base\\Controller", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/web/Application.php", "line":301, "function":"runAction", "class":"yii\\base\\Module", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/web/Application.php", "line":625, "function":"runAction", "class":"craft\\web\\Application", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/craftcms/cms/src/web/Application.php", "line":280, "function":"_processActionRequest", "class":"craft\\web\\Application", "type":"->" }, { "file":"/var/www/html/craftcms/vendor/yiisoft/yii2/base/Application.php", "line":384, "function":"handleRequest", "class":"craft\\web\\Application", "type":"->" }, { "file":"/var/www/html/craftcms/web/index.php", "line":12, "function":"run", "class":"yii\\base\\Application", "type":"->" } ] }
Steps to reproduce
Craft CMS version
4.2.3
Plugin version
3.0.2
Multi-site?
Yes
Additional context
A temporary workaround for me has been finding the hidden input "fieldId" in the popup form DOM and setting some random numbers as a value - then the form successfully saved for me... (I am not a BE developer, so that is probably as far as my reporting goes)
The Submitted payload data sents fieldId a blank value - it should probably be null, but somewhere on the BE it gets interpreted and type checked as an empty string (probably)