Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering issue with nested categories #1321

Closed
my2ter opened this issue Feb 1, 2017 · 1 comment
Closed

Rendering issue with nested categories #1321

my2ter opened this issue Feb 1, 2017 · 1 comment
Assignees
Labels

Comments

@my2ter
Copy link
Contributor

my2ter commented Feb 1, 2017

Description

Errors are thrown in the CMS after nesting categories and I am unable to see them. Seems to be only a rendering issue.

Steps to reproduce

  1. Create category group: Nested
  2. Create category: A
  3. Create category: B
  4. Move category B under A
  5. Use arrow to hide children of A
  6. Use arrow to show children of A -> Category B has disappeared
  7. Refresh the page -> An unknown error occurred.

Additional info

  • Craft version: 3.0.0-beta.1
  • PHP version: 7.1.1-1+deb.sury.org~xenial+1
  • Database driver & version: MySQL 5.7.17
  • Plugins & versions:
    • craftcms/aws-s3 1.0.1
  • Error log:

2017-02-01 14:59:31 [172.17.0.1][1][s9o30asmaq9bfteg21lj0cqd1c][error][yii\db\Exception] PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'element.id' in 'where clause' in /var/www/my-site/vendor/yiisoft/yii2/db/Command.php:900
Stack trace:
#0 /var/www/my-site/vendor/yiisoft/yii2/db/Command.php(900): PDOStatement->execute()
#1 /var/www/my-site/vendor/yiisoft/yii2/db/Command.php(362): yii\db\Command->queryInternal('fetchAll', NULL)
#2 /var/www/my-site/vendor/yiisoft/yii2/db/Query.php(210): yii\db\Command->queryAll()
#3 /var/www/my-site/vendor/craftcms/cms/src/db/Query.php(118): yii\db\Query->all(NULL)
#4 /var/www/my-site/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1004): craft\db\Query->all(NULL)
#5 /var/www/my-site/vendor/craftcms/cms/src/base/Element.php(413): craft\elements\db\ElementQuery->all()
#6 /var/www/my-site/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(389): craft\base\Element::indexHtml(Object(craft\elements\db\CategoryQuery), Array, Array, 'group:25', 'index', true, true)
#7 /var/www/my-site/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(119): craft\controllers\ElementIndexesController->_elementResponseData(true, true)
#8 [internal function]: craft\controllers\ElementIndexesController->actionGetElements()
#9 /var/www/my-site/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#10 /var/www/my-site/vendor/yiisoft/yii2/base/Controller.php(154): yii\base\InlineAction->runWithParams(Array)
#11 /var/www/my-site/vendor/yiisoft/yii2/base/Module.php(454): yii\base\Controller->runAction('get-elements', Array)
#12 /var/www/my-site/vendor/craftcms/cms/src/web/Application.php(329): yii\base\Module->runAction('element-indexes...', Array)
#13 /var/www/my-site/vendor/craftcms/cms/src/web/Application.php(468): craft\web\Application->runAction('element-indexes...', Array)
#14 /var/www/my-site/vendor/craftcms/cms/src/web/Application.php(205): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#15 /var/www/my-site/vendor/yiisoft/yii2/base/Application.php(375): craft\web\Application->handleRequest(Object(craft\web\Request))
#16 /var/www/my-site/web/index.php(23): yii\base\Application->run()
#17 {main}

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'element.id' in 'where clause'
The SQL being executed was: SELECT categories.groupId, elements.id, elements.uid, elements.enabled, elements.archived, elements.dateCreated, elements.dateUpdated, elements_i18n.slug, elements_i18n.uri, elements_i18n.enabled AS enabledForSite, content.id AS contentId, content.title, structureelements.root, structureelements.lft, structureelements.rgt, structureelements.level FROM (SELECT elements.id AS elementsId, elements_i18n.id AS elementsI18nId, content.id AS contentId FROM craft_elements elements INNER JOIN craft_categories categories ON categories.id = elements.id INNER JOIN craft_elements_i18n elements_i18n ON elements_i18n.elementId = elements.id INNER JOIN craft_content content ON content.elementId = elements.id INNER JOIN craft_structureelements structureelements ON structureelements.elementId = elements.id WHERE (((((((categories.groupId = '25')) AND (elements_i18n.siteId='1')) AND (NOT (element.id='1192'))) AND (content.siteId='1')) AND (elements.archived='0')) AND ((elements.enabled='1'))) AND (structureelements.structureId=30) ORDER BY lft LIMIT 50) subquery INNER JOIN craft_categories categories ON categories.id = subquery.elementsId INNER JOIN craft_elements elements ON elements.id = subquery.elementsId INNER JOIN craft_elements_i18n elements_i18n ON elements_i18n.id = subquery.elementsI18nId INNER JOIN craft_content content ON content.id = subquery.contentId INNER JOIN craft_structureelements structureelements ON structureelements.elementId = subquery.elementsId ORDER BY lft in /var/www/my-site/vendor/yiisoft/yii2/db/Schema.php:631
Stack trace:
#0 /var/www/my-site/vendor/yiisoft/yii2/db/Command.php(915): yii\db\Schema->convertException(Object(PDOException), 'SELECT `categor...')
#1 /var/www/my-site/vendor/yiisoft/yii2/db/Command.php(362): yii\db\Command->queryInternal('fetchAll', NULL)
#2 /var/www/my-site/vendor/yiisoft/yii2/db/Query.php(210): yii\db\Command->queryAll()
#3 /var/www/my-site/vendor/craftcms/cms/src/db/Query.php(118): yii\db\Query->all(NULL)
#4 /var/www/my-site/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1004): craft\db\Query->all(NULL)
#5 /var/www/my-site/vendor/craftcms/cms/src/base/Element.php(413): craft\elements\db\ElementQuery->all()
#6 /var/www/my-site/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(389): craft\base\Element::indexHtml(Object(craft\elements\db\CategoryQuery), Array, Array, 'group:25', 'index', true, true)
#7 /var/www/my-site/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(119): craft\controllers\ElementIndexesController->_elementResponseData(true, true)
#8 [internal function]: craft\controllers\ElementIndexesController->actionGetElements()
#9 /var/www/my-site/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#10 /var/www/my-site/vendor/yiisoft/yii2/base/Controller.php(154): yii\base\InlineAction->runWithParams(Array)
#11 /var/www/my-site/vendor/yiisoft/yii2/base/Module.php(454): yii\base\Controller->runAction('get-elements', Array)
#12 /var/www/my-site/vendor/craftcms/cms/src/web/Application.php(329): yii\base\Module->runAction('element-indexes...', Array)
#13 /var/www/my-site/vendor/craftcms/cms/src/web/Application.php(468): craft\web\Application->runAction('element-indexes...', Array)
#14 /var/www/my-site/vendor/craftcms/cms/src/web/Application.php(205): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#15 /var/www/my-site/vendor/yiisoft/yii2/base/Application.php(375): craft\web\Application->handleRequest(Object(craft\web\Request))
#16 /var/www/my-site/web/index.php(23): yii\base\Application->run()
#17 {main}
Additional Information:
Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'element.id' in 'where clause'
)

2017-02-01 14:59:31 [172.17.0.1][1][s9o30asmaq9bfteg21lj0cqd1c][info][application] $_GET = [
'p' => 'admin/actions/element-indexes/get-elements'
]

$_POST = [
'context' => 'index'
'elementType' => 'craft\elements\Category'
'source' => 'group:25'
'criteria' => [
'limit' => '50'
'enabledForSite' => ''
]
'viewState' => [
'mode' => 'table'
'order' => 'structure'
'sort' => 'asc'
]
'collapsedElementIds' => [
0 => '1191'
]
'CRAFT_CSRF_TOKEN' => 'N2s4MHB4T2QDWkJ.BU07UUYjdlQINiRUVjl1eiIxOCheXVRfOS0aPUc7eh1dSX0AS1kMAkRMflQAXFwGSE9/BVVfXlQVHHlXD14IAkgdLlYGW1sDQ0gpXVIIDgEVHildUV8BA0BOfFdRCQoFQUt9Vw5fCUo.DXoQAhpwfhQAAQ8HCmp9OioGE3sCDlwfMRoxbhtocl1VflZTFwlMVEo2QAZYHHwFNipVZy5hWCpKAQ5wW11VJSoaKBkNVFg5Fxg8GCBUWB0QIVZ0Jg5KFBoXK0MIb0IEMDUB'
]

@brandonkelly
Copy link
Member

Fixed for the next release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants