Skip to content

Column not found exception when attempting to delete a supertable field from inside a matrix block type #709

@scholejo

Description

@scholejo

Bug Report

When I try to delete a Supertable field from inside a matrix block type, I get a column not found exception for a field that doesn't even belong to that matrix block type. In my logs, I saw that Blitz is reacting to the deletion of existing Supertable block elements. I added the relevant part of the stack trace below. This happens when deleting the field via control panel as well as when trying to apply the project config with the according changes. Based on the stack trace, I tried it with Blitz disabled and then it worked.

I'm not sure how critical this incompatibility is, because I've just seen that development on Supertable has been discontinued.

It seems that there have been problems with Supertable and at least Scout, too: verbb/super-table#443

#0 /app/vendor/yiisoft/yii2/db/Command.php(1325): yii\db\Schema->convertException(Object(PDOException), 'SELECT `element...')
#1 /app/vendor/yiisoft/yii2/db/Command.php(1186): yii\db\Command->internalExecute('SELECT `element...')
#2 /app/vendor/yiisoft/yii2/db/Command.php(431): yii\db\Command->queryInternal('fetch', NULL)
#3 /app/vendor/yiisoft/yii2/db/Query.php(287): yii\db\Command->queryOne()
#4 /app/vendor/craftcms/cms/src/db/Query.php(280): yii\db\Query->one(NULL)
#5 /app/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1672): craft\db\Query->one(NULL)
#6 /app/vendor/craftcms/cms/src/services/Elements.php(887): craft\elements\db\ElementQuery->one()
#7 /app/vendor/craftcms/cms/src/services/Elements.php(825): craft\services\Elements->_elementById('id', 617727, 'craft\\elements\\...', 1, Array)
#8 /app/vendor/craftcms/cms/src/elements/MatrixBlock.php(343): craft\services\Elements->getElementById(617727, NULL, 1)
#9 /app/vendor/craftcms/cms/src/helpers/ElementHelper.php(510): craft\elements\MatrixBlock->getOwner()
#10 /app/vendor/craftcms/cms/src/helpers/ElementHelper.php(512): craft\helpers\ElementHelper::isDraftOrRevision(Object(craft\elements\MatrixBlock))
#11 /app/vendor/putyourlightson/craft-blitz/src/services/RefreshCacheService.php(279): craft\helpers\ElementHelper::isDraftOrRevision(Object(verbb\supertable\elements\SuperTableBlockElement))
#12 /app/vendor/putyourlightson/craft-blitz/src/Blitz.php(393): putyourlightson\blitz\services\RefreshCacheService->isRefreshableElement(Object(verbb\supertable\elements\SuperTableBlockElement))
#13 [internal function]: putyourlightson\blitz\Blitz->putyourlightson\blitz\{closure}(Object(craft\events\DeleteElementEvent))
#14 /app/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\DeleteElementEvent))
#15 /app/vendor/yiisoft/yii2/base/Component.php(650): yii\base\Event::trigger('craft\\services\\...', 'beforeDeleteEle...', Object(craft\events\DeleteElementEvent))
#16 /app/vendor/craftcms/cms/src/services/Elements.php(2116): yii\base\Component->trigger('beforeDeleteEle...', Object(craft\events\DeleteElementEvent))
#17 /app/vendor/verbb/super-table/src/services/Service.php(419): craft\services\Elements->deleteElement(Object(verbb\supertable\elements\SuperTableBlockElement))
#18 /app/vendor/craftcms/cms/src/services/ProjectConfig.php(1159): verbb\supertable\services\Service->handleDeletedBlockType(Object(craft\events\ConfigEvent))

Diagnostics Report

Relevant versions:
Craft 4.12.0
Supertable 3.0.14
Blitz 4.23.0
PHP 8.2.19

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions