verbb / field-manager

Field Manager is a Craft CMS plugin to make it easy to manage your fields and field groups.
MIT License
199 stars 16 forks source link

Can’t clone SuperTable field with Matrix field inside it. #85

Closed furioursus closed 2 years ago

furioursus commented 2 years ago

Describe the bug

i have a SuperTable field that contains a Matrix field. When i attempt to clone the field, i get a server error response. i can confirm that i am able to clone a SuperTable field with no issues, but when i work with a SuperTable field with a Matrix field nested within it, no dice.

Steps to reproduce

  1. Create a SuperTable Field and add a Matrix field with only one block type within it.
  2. Attempt to clone said field in Field manager
  3. Frown. :(

Craft CMS version

4.1.4.1

Plugin version

3.0.0

Multi-site?

no

Additional context

Related plugin

SuperTable version 3.0.0-beta.6

Stack Trace

2022-07-26 18:08:00 [web.ERROR] [Error] Error: Typed property craft\fields\Matrix::$contentTable must not be accessed before initialization in /var/www/html/vendor/craftcms/cms/src/base/ConfigurableComponent.php:65
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/base/Component.php(139): craft\base\ConfigurableComponent->getSettings()
#1 /var/www/html/vendor/yiisoft/yii2/base/Model.php(1028): yii\base\Component->__get('settings')
#2 /var/www/html/vendor/verbb/field-manager/src/services/Service.php(252): yii\base\Model->offsetGet('settings')
#3 /var/www/html/vendor/verbb/field-manager/src/services/Service.php(46): verbb\fieldmanager\services\Service->processCloneSuperTable(Object(verbb\supertable\fields\SuperTableField))
#4 /var/www/html/vendor/verbb/field-manager/src/controllers/BaseController.php(218): verbb\fieldmanager\services\Service->cloneField(Object(verbb\supertable\fields\SuperTableField), Object(verbb\supertable\fields\SuperTableField))
#5 [internal function]: verbb\fieldmanager\controllers\BaseController->actionCloneField()
#6 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#8 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('clone-field', Array)
#9 /var/www/html/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('field-manager/b...', Array)
#10 /var/www/html/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('field-manager/b...', Array)
#11 /var/www/html/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#12 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#13 /var/www/html/web/index.php(12): yii\base\Application->run()
#14 {main} {"memory":8846264,"exception":"[object] (Error(code: 0): Typed property craft\\fields\\Matrix::$contentTable must not be accessed before initialization at /var/www/html/vendor/craftcms/cms/src/base/ConfigurableComponent.php:65)"}
engram-design commented 2 years ago

Fixed in 3.0.1