craftcms / cms

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

[4.x]: After upgrade to 4: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'structureelements.structureId' in 'on clause' #12416

Closed alexanderloewe closed 1 year ago

alexanderloewe commented 1 year ago

What happened?

Description

After the upgrade to Craft CMS 4.3 I get that error after saving any entry. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'structureelements.structureId' in 'on clause'

Entry revisions alsow can't be cleared.

Steps to reproduce

Retesting the upgrade

Error

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'structureelements.structureId' in 'on clause' in /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT EXISTS(S...')
#2 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(436): yii\db\Command->queryInternal('fetchColumn', 0)
#3 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Query.php(446): yii\db\Command->queryScalar()
#4 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/db/Query.php(321): yii\db\Query->exists(NULL)
#5 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1540): craft\db\Query->exists(NULL)
#6 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(267): craft\elements\db\ElementQuery->exists(NULL)
#7 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(538): benf\neo\elements\db\BlockQuery->benf\neo\elements\db\{closure}()
#8 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(268): benf\neo\elements\db\BlockQuery->_setFilteredResultIfUsingMemoized(Object(Closure))
#9 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Revisions.php(103): benf\neo\elements\db\BlockQuery->exists()
#10 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/services/Fields.php(653): craft\services\Revisions->createRevision(Object(benf\neo\elements\Block), NULL, NULL, Array)
#11 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/Field.php(932): benf\neo\services\Fields->createRevisionBlocks(Object(benf\neo\Field), Object(craft\elements\Entry), Object(craft\elements\Entry))
#12 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/base/Element.php(4747): benf\neo\Field->afterElementPropagate(Object(craft\elements\Entry), true)
#13 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/Entry.php(2003): craft\base\Element->afterPropagate(true)
#14 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Elements.php(1612): craft\elements\Entry->afterPropagate(true)
#15 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Revisions.php(162): craft\services\Elements->duplicateElement(Object(craft\elements\Entry), Array)
#16 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/Entry.php(2007): craft\services\Revisions->createRevision(Object(craft\elements\Entry), 8, '')
#17 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Elements.php(3036): craft\elements\Entry->afterPropagate(false)
#18 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Elements.php(1039): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, true, true)
#19 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/controllers/ElementsController.php(900): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#20 [internal function]: craft\controllers\ElementsController->actionSave()
#21 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#22 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#23 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save', Array)
#24 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('elements/save', Array)
#25 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('elements/save', Array)
#26 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#27 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#28 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/web/index.php(21): yii\base\Application->run()
#29 {main}

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'structureelements.structureId' in 'on clause'
The SQL being executed was: SELECT EXISTS(SELECT `elements`.`id`, `elements`.`canonicalId`, `elements`.`fieldLayoutId`, `elements`.`uid`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateLastMerged`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_sites`.`id` AS `siteSettingsId`, `elements_sites`.`slug`, `elements_sites`.`siteId`, `elements_sites`.`uri`, `elements_sites`.`enabled` AS `enabledForSite`, `neoblocks`.`fieldId`, `neoblocks`.`primaryOwnerId`, `neoblocks`.`typeId`, `neoblocks_owners`.`ownerId`, `neoblocks_owners`.`sortOrder`, `content`.`id` AS `contentId`, `content`.`field_sequenceStyle`, `content`.`field_addressType`, `content`.`field_graphSameAs`, `content`.`field_anchor`, `content`.`field_newsletterSalutation`, `content`.`field_salutation`, `content`.`field_speech`, `content`.`field_answer`, `content`.`field_workplace`, `content`.`field_alignHorizontal`, `content`.`field_alignVertical`, `content`.`field_authors`, `content`.`field_hideAreas`, `content`.`field_description`, `content`.`field_graphDescription`, `content`.`field_shopDescription`, `content`.`field_newsletterSubject`, `content`.`field_rankStars`, `content`.`field_imageStyle`, `content`.`field_newsletterBoxesStyle`, `content`.`field_code`, `content`.`field_pageCss`, `content`.`field_fileTitle`, `content`.`field_date`, `content`.`field_dateTime`, `content`.`field_eMail`, `content`.`field_endDate_wrsfclkl`, `content`.`field_countdownEndDate`, `content`.`field_graphFbProfile`, `content`.`field_graphFbProfileID`, `content`.`field_newsletterFooterText`, `content`.`field_callFormSelection`, `content`.`field_callForm`, `content`.`field_question`, `content`.`field_jobFunction`, `content`.`field_addressNr`, `content`.`field_headerImagesStyle`, `content`.`field_headerHeightStyle`, `content`.`field_headerSliderStyle`, `content`.`field_headerTheme`, `content`.`field_bgColor`, `content`.`field_smIcon`, `content`.`field_iconStyle`, `content`.`field_socialMediaIcon`, `content`.`field_iframe`, `content`.`field_callContent`, `content`.`field_callContentInner_xpppilvj`, `content`.`field_pageJs`, `content`.`field_pageTrackingJs`, `content`.`field_mapLatitude`, `content`.`field_mapPin`, `content`.`field_mapLongitude`, `content`.`field_addressCountry`, `content`.`field_readingTime`, `content`.`field_lineType`, `content`.`field_newsletterLink`, `content`.`field_smLink`, `content`.`field_linkOffsite`, `content`.`field_linkRel_utcozkch`, `content`.`field_linkData`, `content`.`field_linkClass`, `content`.`field_linkQuery`, `content`.`field_linkStyle`, `content`.`field_linkTitle`, `content`.`field_newsletterLinkTitle`, `content`.`field_linkUrl`, `content`.`field_linkTarget`, `content`.`field_graphLiProfile`, `content`.`field_newsletterList`, `content`.`field_minimizedContentStyle`, `content`.`field_mobileNummer`, `content`.`field_imageMultiStyle`, `content`.`field_lastname`, `content`.`field_names`, `content`.`field_newsletterNav`, `content`.`field_newsletterNavFooter`, `content`.`field_newsletterLanguage`, `content`.`field_callNewsletterFormSelection`, `content`.`field_note`, `content`.`field_openingHours`, `content`.`field_organization`, `content`.`field_addressCity`, `content`.`field_password`, `content`.`field_workload`, `content`.`field_addressZip`, `content`.`field_addressZipCity`, `content`.`field_popUpStyle`, `content`.`field_newsletterPreheader`, `content`.`field_price`, `content`.`field_graphTags`, `content`.`field_fontAlign`, `content`.`field_newsletterFontAlign`, `content`.`field_fontColor`, `content`.`field_pageClass`, `content`.`field_wrapperType`, `content`.`field_seoAltTag`, `content`.`field_seoDesignation`, `content`.`field_seoCanonical`, `content`.`field_seoDescription`, `content`.`field_seoKeywords`, `content`.`field_seoRobots`, `content`.`field_seoSiteName`, `content`.`field_seoRichSchema`, `content`.`field_seoTitle`, `content`.`field_newsletterSmProfiles`, `content`.`field_languageSetup`, `content`.`field_startDate_uooymfaf`, `content`.`field_addressFloor`, `content`.`field_addressStreet`, `content`.`field_addressStreetNr`, `content`.`field_teaserDescription`, `content`.`field_teaserDescriptionRtf_xbnwjwkl`, `content`.`field_teaserTitle`, `content`.`field_phone`, `content`.`field_newsletterText`, `content`.`field_text`, `content`.`field_textRtf`, `content`.`field_textStyle`, `content`.`field_textBoxesStyle`, `content`.`field_graphTitle`, `content`.`field_mainTitle`, `content`.`field_newsletterTitle`, `content`.`field_titleStyle`, `content`.`field_titleTag`, `content`.`field_graphTwcard`, `content`.`field_graphTwProfile`, `content`.`field_graphType`, `content`.`field_newsletterOverviewType`, `content`.`field_overviewType`, `content`.`field_newsletterOvertitle`, `content`.`field_overTitle`, `content`.`field_subTitle`, `content`.`field_videoEmbed`, `content`.`field_videoEmbedOption`, `content`.`field_videoStyle`, `content`.`field_fullName`, `content`.`field_firstname`, `content`.`field_benefitList`, `content`.`field_website`, `content`.`field_time`, `content`.`field_quote`, `content`.`field_addressAdditive`, `elements`.`revisionId`, `revisions`.`creatorId` AS `revisionCreatorId`, `revisions`.`num` AS `revisionNum`, `revisions`.`notes` AS `revisionNotes`
FROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `elementsSitesId`, `content`.`id` AS `contentId`
FROM `elements` `elements`
INNER JOIN `neoblocks` `neoblocks` ON `neoblocks`.`id` = `elements`.`id`
INNER JOIN `neoblocks_owners` `neoblocks_owners` ON (`neoblocks_owners`.`blockId` = `elements`.`id`) AND (`neoblocks_owners`.`ownerId` = `neoblocks`.`primaryOwnerId`)
INNER JOIN `elements` `owners` ON `owners`.`id` = `neoblocks`.`primaryOwnerId`
INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id`
INNER JOIN `content` `content` ON (`content`.`elementId` = `elements`.`id`) AND (`content`.`siteId` = `elements_sites`.`siteId`)
INNER JOIN `revisions` `revisions` ON `revisions`.`id` = `elements`.`revisionId`
INNER JOIN `neoblockstructures` `neoblockstructures` ON `neoblockstructures`.`structureId` = `structureelements`.`structureId`
WHERE (`owners`.`draftId` IS NULL) AND (`owners`.`revisionId` IS NULL) AND (`elements_sites`.`siteId`=2) AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`draftId` IS NULL) AND (`elements`.`revisionId`=12697) AND (`neoblockstructures`.`siteId`=2)
ORDER BY `num` DESC) `subquery`
INNER JOIN `elements` `elements` ON `elements`.`id` = `subquery`.`elementsId`
INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`elementsSitesId`
INNER JOIN `neoblocks` `neoblocks` ON `neoblocks`.`id` = `subquery`.`elementsId`
INNER JOIN `neoblocks_owners` `neoblocks_owners` ON (`neoblocks_owners`.`blockId` = `elements`.`id`) AND (`neoblocks_owners`.`ownerId` = `neoblocks`.`primaryOwnerId`)
INNER JOIN `content` `content` ON `content`.`id` = `subquery`.`contentId`
INNER JOIN `revisions` `revisions` ON `revisions`.`id` = `elements`.`revisionId`
ORDER BY `num` DESC) in /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException(Object(PDOException), 'SELECT EXISTS(S...')
#1 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT EXISTS(S...')
#2 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(436): yii\db\Command->queryInternal('fetchColumn', 0)
#3 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Query.php(446): yii\db\Command->queryScalar()
#4 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/db/Query.php(321): yii\db\Query->exists(NULL)
#5 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1540): craft\db\Query->exists(NULL)
#6 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(267): craft\elements\db\ElementQuery->exists(NULL)
#7 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(538): benf\neo\elements\db\BlockQuery->benf\neo\elements\db\{closure}()
#8 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(268): benf\neo\elements\db\BlockQuery->_setFilteredResultIfUsingMemoized(Object(Closure))
#9 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Revisions.php(103): benf\neo\elements\db\BlockQuery->exists()
#10 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/services/Fields.php(653): craft\services\Revisions->createRevision(Object(benf\neo\elements\Block), NULL, NULL, Array)
#11 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/Field.php(932): benf\neo\services\Fields->createRevisionBlocks(Object(benf\neo\Field), Object(craft\elements\Entry), Object(craft\elements\Entry))
#12 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/base/Element.php(4747): benf\neo\Field->afterElementPropagate(Object(craft\elements\Entry), true)
#13 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/Entry.php(2003): craft\base\Element->afterPropagate(true)
#14 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Elements.php(1612): craft\elements\Entry->afterPropagate(true)
#15 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Revisions.php(162): craft\services\Elements->duplicateElement(Object(craft\elements\Entry), Array)
#16 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/Entry.php(2007): craft\services\Revisions->createRevision(Object(craft\elements\Entry), 8, '')
#17 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Elements.php(3036): craft\elements\Entry->afterPropagate(false)
#18 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/services/Elements.php(1039): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, true, true)
#19 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/controllers/ElementsController.php(900): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#20 [internal function]: craft\controllers\ElementsController->actionSave()
#21 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#22 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#23 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save', Array)
#24 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('elements/save', Array)
#25 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('elements/save', Array)
#26 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#27 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#28 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/web/index.php(21): yii\base\Application->run()
#29 {main}
Additional Information:
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'structureelements.structureId' in 'on clause'
)

Craft CMS version

Craft CMS 4.3.4

PHP version

8.1

Operating system and version

Linux 3.10.0-962.3.2.lve1.5.73.el7.x86_64

Database type and version

MySQL 5.7.37

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.0-20)

Installed plugins and versions

No response

alexanderloewe commented 1 year ago

A bit more data on that one, after trying to remove the revisons via cl.

 ./craft utils/prune-revisions

Deprecated: auto_detect_line_endings is deprecated in /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/vlucas/phpdotenv/src/Loader.php on line 172
What is the max number of revisions an element can have? [7] 0
Finding elements with too many revisions ... done

Pruning revisions ...
- Entry 9 (7 revisions) ... done
- Entry 12 (7 revisions) ... done
- Entry 14 (5 revisions) ... done
- Entry 16 (7 revisions) ... done
- Entry 18 (7 revisions) ... done
- Entry 20 (5 revisions) ... done
- Entry 22 (7 revisions) ... done (found 0)
- Entry 24 (4 revisions) ... done (found 0)
- Entry 26 (4 revisions) ... done (found 0)
- Entry 28 (4 revisions) ... done (found 0)
- Entry 30 (6 revisions) ... done
- Entry 32 (1 revisions) ... done (found 0)
- Entry 34 (1 revisions) ... done (found 0)
- Entry 36 (7 revisions) ... done
- Entry 38 (1 revisions) ... done
- Entry 40 (1 revisions) ... done
- Neo Block 73 (1 revisions) ... Exception 'yii\db\Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'structureelements.structureId' in 'on clause'
The SQL being executed was: SELECT `elements`.`id`, `elements`.`canonicalId`, `elements`.`fieldLayoutId`, `elements`.`uid`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateLastMerged`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_sites`.`id` AS `siteSettingsId`, `elements_sites`.`slug`, `elements_sites`.`siteId`, `elements_sites`.`uri`, `elements_sites`.`enabled` AS `enabledForSite`, `neoblocks`.`fieldId`, `neoblocks`.`primaryOwnerId`, `neoblocks`.`typeId`, `neoblocks_owners`.`ownerId`, `neoblocks_owners`.`sortOrder`, `content`.`id` AS `contentId`, `content`.`field_sequenceStyle`, `content`.`field_addressType`, `content`.`field_graphSameAs`, `content`.`field_anchor`, `content`.`field_newsletterSalutation`, `content`.`field_salutation`, `content`.`field_speech`, `content`.`field_answer`, `content`.`field_workplace`, `content`.`field_alignHorizontal`, `content`.`field_alignVertical`, `content`.`field_authors`, `content`.`field_hideAreas`, `content`.`field_description`, `content`.`field_graphDescription`, `content`.`field_shopDescription`, `content`.`field_newsletterSubject`, `content`.`field_rankStars`, `content`.`field_imageStyle`, `content`.`field_newsletterBoxesStyle`, `content`.`field_code`, `content`.`field_pageCss`, `content`.`field_fileTitle`, `content`.`field_date`, `content`.`field_dateTime`, `content`.`field_eMail`, `content`.`field_endDate_wrsfclkl`, `content`.`field_countdownEndDate`, `content`.`field_graphFbProfile`, `content`.`field_graphFbProfileID`, `content`.`field_newsletterFooterText`, `content`.`field_callFormSelection`, `content`.`field_callForm`, `content`.`field_question`, `content`.`field_jobFunction`, `content`.`field_addressNr`, `content`.`field_headerImagesStyle`, `content`.`field_headerHeightStyle`, `content`.`field_headerSliderStyle`, `content`.`field_headerTheme`, `content`.`field_bgColor`, `content`.`field_smIcon`, `content`.`field_iconStyle`, `content`.`field_socialMediaIcon`, `content`.`field_iframe`, `content`.`field_callContent`, `content`.`field_callContentInner_xpppilvj`, `content`.`field_pageJs`, `content`.`field_pageTrackingJs`, `content`.`field_mapLatitude`, `content`.`field_mapPin`, `content`.`field_mapLongitude`, `content`.`field_addressCountry`, `content`.`field_readingTime`, `content`.`field_lineType`, `content`.`field_newsletterLink`, `content`.`field_smLink`, `content`.`field_linkOffsite`, `content`.`field_linkRel_utcozkch`, `content`.`field_linkData`, `content`.`field_linkClass`, `content`.`field_linkQuery`, `content`.`field_linkStyle`, `content`.`field_linkTitle`, `content`.`field_newsletterLinkTitle`, `content`.`field_linkUrl`, `content`.`field_linkTarget`, `content`.`field_graphLiProfile`, `content`.`field_newsletterList`, `content`.`field_minimizedContentStyle`, `content`.`field_mobileNummer`, `content`.`field_imageMultiStyle`, `content`.`field_lastname`, `content`.`field_names`, `content`.`field_newsletterNav`, `content`.`field_newsletterNavFooter`, `content`.`field_newsletterLanguage`, `content`.`field_callNewsletterFormSelection`, `content`.`field_note`, `content`.`field_openingHours`, `content`.`field_organization`, `content`.`field_addressCity`, `content`.`field_password`, `content`.`field_workload`, `content`.`field_addressZip`, `content`.`field_addressZipCity`, `content`.`field_popUpStyle`, `content`.`field_newsletterPreheader`, `content`.`field_price`, `content`.`field_graphTags`, `content`.`field_fontAlign`, `content`.`field_newsletterFontAlign`, `content`.`field_fontColor`, `content`.`field_pageClass`, `content`.`field_wrapperType`, `content`.`field_seoAltTag`, `content`.`field_seoDesignation`, `content`.`field_seoCanonical`, `content`.`field_seoDescription`, `content`.`field_seoKeywords`, `content`.`field_seoRobots`, `content`.`field_seoSiteName`, `content`.`field_seoRichSchema`, `content`.`field_seoTitle`, `content`.`field_newsletterSmProfiles`, `content`.`field_languageSetup`, `content`.`field_startDate_uooymfaf`, `content`.`field_addressFloor`, `content`.`field_addressStreet`, `content`.`field_addressStreetNr`, `content`.`field_teaserDescription`, `content`.`field_teaserDescriptionRtf_xbnwjwkl`, `content`.`field_teaserTitle`, `content`.`field_phone`, `content`.`field_newsletterText`, `content`.`field_text`, `content`.`field_textRtf`, `content`.`field_textStyle`, `content`.`field_textBoxesStyle`, `content`.`field_graphTitle`, `content`.`field_mainTitle`, `content`.`field_newsletterTitle`, `content`.`field_titleStyle`, `content`.`field_titleTag`, `content`.`field_graphTwcard`, `content`.`field_graphTwProfile`, `content`.`field_graphType`, `content`.`field_newsletterOverviewType`, `content`.`field_overviewType`, `content`.`field_newsletterOvertitle`, `content`.`field_overTitle`, `content`.`field_subTitle`, `content`.`field_videoEmbed`, `content`.`field_videoEmbedOption`, `content`.`field_videoStyle`, `content`.`field_fullName`, `content`.`field_firstname`, `content`.`field_benefitList`, `content`.`field_website`, `content`.`field_time`, `content`.`field_quote`, `content`.`field_addressAdditive`, `elements`.`revisionId`, `revisions`.`creatorId` AS `revisionCreatorId`, `revisions`.`num` AS `revisionNum`, `revisions`.`notes` AS `revisionNotes`
FROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `elementsSitesId`, `content`.`id` AS `contentId`
FROM `elements` `elements`
INNER JOIN `neoblocks` `neoblocks` ON `neoblocks`.`id` = `elements`.`id`
INNER JOIN `neoblocks_owners` `neoblocks_owners` ON (`neoblocks_owners`.`blockId` = `elements`.`id`) AND (`neoblocks_owners`.`ownerId` = `neoblocks`.`primaryOwnerId`)
INNER JOIN `elements` `owners` ON `owners`.`id` = `neoblocks`.`primaryOwnerId`
INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id`
INNER JOIN `content` `content` ON (`content`.`elementId` = `elements`.`id`) AND (`content`.`siteId` = `elements_sites`.`siteId`)
INNER JOIN `revisions` `revisions` ON `revisions`.`id` = `elements`.`revisionId`
INNER JOIN `neoblockstructures` `neoblockstructures` ON `neoblockstructures`.`structureId` = `structureelements`.`structureId`
WHERE (`owners`.`draftId` IS NULL) AND (`owners`.`revisionId` IS NULL) AND (`elements_sites`.`siteId` IN (2, 1)) AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`draftId` IS NULL) AND (`elements`.`canonicalId`=73) AND (`neoblockstructures`.`siteId` IN (2, 1)) AND (`elements_sites`.`id` = (SELECT `elements_sites`.`id`
FROM `elements` `subElements`
INNER JOIN `neoblocks` `neoblocks` ON `neoblocks`.`id` = `subElements`.`id`
INNER JOIN `neoblocks_owners` `neoblocks_owners` ON (`neoblocks_owners`.`blockId` = `subElements`.`id`) AND (`neoblocks_owners`.`ownerId` = `neoblocks`.`primaryOwnerId`)
INNER JOIN `elements` `owners` ON `owners`.`id` = `neoblocks`.`primaryOwnerId`
INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `subElements`.`id`
INNER JOIN `content` `content` ON (`content`.`elementId` = `subElements`.`id`) AND (`content`.`siteId` = `elements_sites`.`siteId`)
INNER JOIN `revisions` `revisions` ON `revisions`.`id` = `subElements`.`revisionId`
INNER JOIN `neoblockstructures` `neoblockstructures` ON `neoblockstructures`.`structureId` = `structureelements`.`structureId`
WHERE (`owners`.`draftId` IS NULL) AND (`owners`.`revisionId` IS NULL) AND (`elements_sites`.`siteId` IN (2, 1)) AND (`subElements`.`archived`=FALSE) AND (`subElements`.`dateDeleted` IS NULL) AND (`subElements`.`draftId` IS NULL) AND (`subElements`.`canonicalId`=73) AND (`neoblockstructures`.`siteId` IN (2, 1)) AND (`subElements`.`id` = `elements`.`id`)
ORDER BY case when `elements_sites`.`siteId` = 2 then 0 else 1 end, `elements_sites`.`id`
LIMIT 1))
ORDER BY `num` DESC) `subquery`
INNER JOIN `elements` `elements` ON `elements`.`id` = `subquery`.`elementsId`
INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`elementsSitesId`
INNER JOIN `neoblocks` `neoblocks` ON `neoblocks`.`id` = `subquery`.`elementsId`
INNER JOIN `neoblocks_owners` `neoblocks_owners` ON (`neoblocks_owners`.`blockId` = `elements`.`id`) AND (`neoblocks_owners`.`ownerId` = `neoblocks`.`primaryOwnerId`)
INNER JOIN `content` `content` ON `content`.`id` = `subquery`.`contentId`
INNER JOIN `revisions` `revisions` ON `revisions`.`id` = `elements`.`revisionId`
ORDER BY `num` DESC'

in /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Schema.php:676

Error Info:
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'structureelements.structureId' in 'on clause'
)

Caused by: Exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'structureelements.structureId' in 'on clause''

in /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php:1302

Stack trace:
#0 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT `element...')
#2 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Command.php(410): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/db/Query.php(249): yii\db\Command->queryAll()
#4 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/db/Query.php(248): yii\db\Query->all(NULL)
#5 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1492): craft\db\Query->all(NULL)
#6 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(248): craft\elements\db\ElementQuery->all(NULL)
#7 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(538): benf\neo\elements\db\BlockQuery->benf\neo\elements\db\{closure}()
#8 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/spicyweb/craft-neo/src/elements/db/BlockQuery.php(248): benf\neo\elements\db\BlockQuery->_setFilteredResultIfUsingMemoized(Object(Closure))
#9 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/console/controllers/utils/PruneRevisionsController.php(141): benf\neo\elements\db\BlockQuery->all()
#10 [internal function]: craft\console\controllers\utils\PruneRevisionsController->actionIndex()
#11 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#13 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
#14 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/console/Controller.php(224): yii\console\Controller->runAction('', Array)
#15 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array)
#16 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('utils/prune-rev...', Array)
#17 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/console/Application.php(90): yii\console\Application->runAction('utils/prune-rev...', Array)
#18 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('utils/prune-rev...', Array)
#19 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/craftcms/cms/src/console/Application.php(121): yii\console\Application->handleRequest(Object(craft\console\Request))
#20 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
#21 /home/wedotch/public_html/_hosting/ernaehrungsbewusst/craft(22): yii\base\Application->run()
#22 {main}
i-just commented 1 year ago

Hi, thanks for getting in touch. Could you please let me know which version you updated from and which version of Neo plugin you are using? Was Neo also updated in the process? It looks like the error is related to Neo fields. Are you able to check if this is also happening if you try to save an entry or remove revisions from a section that doesn't contain Neo field?

alexanderloewe commented 1 year ago

Thank you for your reply. Yes, I had also seen that yesterday. When I try to save other entities that do not contain a Neo field, everything seems to work cleanly and the save process works smoothly.

Yes, Neo was updates with Craft CMS

Version: Neo | 3.5.8

Demo:

Bildschirm­foto 2022-12-05 um 11 41 14
i-just commented 1 year ago

Hi, thanks for the info. It looks like another update to Neo was released today and it might be related to the error you're experiencing:

Screenshot 2022-12-05 at 11 51 23

As a start, could you please update Neo to 3.5.9 and see if it resolves it?

alexanderloewe commented 1 year ago

Yes, it works fine. Thank you a lot!

i-just commented 1 year ago

Not a problem :) glad it's all sorted!