craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

Field class not found when saving layout #6802

Closed janhenckens closed 4 years ago

janhenckens commented 4 years ago

Description

When editing the field layout of an asset volume or a section, I'm getting the following error:

Error: Class 'SuperTable' not found in /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/Fields.php:1574
Stack trace:
#0 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/Fields.php(845): craft\services\Fields->applyFieldSave('15cc584d-67f2-4...', Array, 'global')
#1 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/ProjectConfig.php(1107): craft\services\Fields->handleChangedField(Object(craft\events\ConfigEvent))
#2 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#3 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Array, Object(craft\events\ConfigEvent))
#4 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/ProjectConfig.php(679): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#5 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/helpers/ProjectConfig.php(76): craft\services\ProjectConfig->processConfigChanges('fields.15cc584d...')
#6 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/Sections.php(1126): craft\helpers\ProjectConfig::ensureAllFieldsProcessed()
#7 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/ProjectConfig.php(1107): craft\services\Sections->handleChangedEntryType(Object(craft\events\ConfigEvent))
#8 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#9 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Array, Object(craft\events\ConfigEvent))
#10 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/ProjectConfig.php(679): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#11 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/ProjectConfig.php(487): craft\services\ProjectConfig->processConfigChanges('entryTypes.c7c3...', true, 'Save entry type...')
#12 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/services/Sections.php(1105): craft\services\ProjectConfig->set('entryTypes.c7c3...', Array, 'Save entry type...')
#13 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/controllers/SectionsController.php(369): craft\services\Sections->saveEntryType(Object(craft\models\EntryType))
#14 [internal function]: craft\controllers\SectionsController->actionSaveEntryType()
#15 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#16 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#17 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/web/Controller.php(189): yii\base\Controller->runAction('save-entry-type', Array)
#18 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry-type', Array)
#19 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/web/Application.php(280): yii\base\Module->runAction('sections/save-e...', Array)
#20 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/web/Application.php(583): craft\web\Application->runAction('sections/save-e...', Array)
#21 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/craftcms/cms/src/web/Application.php(259): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#22 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#23 /data/sites/web/pasweclivestatikbe/subsites/paswec.staging.statik.be/public/index.php(23): yii\base\Application->run()
#24 {main}

SuperTable is installed here on the site and seems to be working correctly on entry detail pages. This is on a Craft install that we're upgrading from 2 to 3, not sure if that has to do with anything. I'm not able to reproduce this on one of our other installs (same versions of both Craft and Supertable).

Since the error is throw in a Craft service I created the issue here but it could be SuperTable related as well (paging @engram-design).

Additional info

CTA 1.3.1 Dumper 2.0.0 Easy Address Field 2.2.5 Feed Me 4.2.3 Freeform 3.8.0 Imager v2.4.0 Incognito Field 1.2.0 Mandrill 1.3.1 Navigate 2.7.0 Neo 2.8.7 Redactor 2.7.4 SEO 3.6.6 Super Table 2.6.2 Video Embedder 1.1.4 VZ URL 2.1.2

engram-design commented 4 years ago

Sounds like you haven't run the content table fixers in Super Table. There's a field that have it's fieldtype set to SuperTable instead of verbb\supertable\fields\SuperTableField. This is the difference from Craft 2 > Craft 3.

It's supposed to change this during the migrations from Craft 2 > Craft 3. Did you get any errors along the way? You should be able to manually update the db columns in the fields table to get around this.

janhenckens commented 4 years ago

I've run the content-table-fixers a couple of times, and it keeps saying there are issues with the same tables and that those are fixed...

I had the same idea to look in the fields table but those all look migrated: afbeelding

I figured out which field was causing the issue by dumping the data and the field had type SuperTable, even though it's in the above screenshot as verbb\supertable\fields\SuperTableField.

So I ran project-config/rebuild and that seemed to fix the issue.

brandonkelly commented 4 years ago

Glad you got it working @janhenckens!