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

Create new form throws database exception #1

Closed
cap-akimrey opened this issue Jul 20, 2020 · 2 comments
Closed

Create new form throws database exception #1

cap-akimrey opened this issue Jul 20, 2020 · 2 comments

Comments

@cap-akimrey
Copy link

Description

Create new form, enter details, hit Save, db exception thrown

Steps to reproduce

  1. Create your form
  2. Enter details
  3. Save

Additional info

  • Plugin version: 1
  • Craft version: 3.4.27

Stacktrace:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fieldlayouttabs.id' in 'field list' in /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php:1293
Stack trace:
#0 /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php(1293): PDOStatement->execute()
#1 /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT `fieldla...')
#2 /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php(401): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /var/www/cap.org/vendor/yiisoft/yii2/db/Query.php(248): yii\db\Command->queryAll()
#4 /var/www/cap.org/vendor/craftcms/cms/src/db/Query.php(152): yii\db\Query->all(NULL)
#5 /var/www/cap.org/vendor/verbb/formie/src/services/Fields.php(655): craft\db\Query->all()
#6 /var/www/cap.org/vendor/verbb/formie/src/models/FieldLayout.php(58): verbb\formie\services\Fields->getLayoutPagesById(1035)
#7 /var/www/cap.org/vendor/verbb/formie/src/elements/Form.php(427): verbb\formie\models\FieldLayout->getPages()
#8 /var/www/cap.org/vendor/verbb/formie/src/controllers/FormsController.php(347): verbb\formie\elements\Form->getFormConfig()
#9 /var/www/cap.org/vendor/verbb/formie/src/controllers/FormsController.php(89): verbb\formie\controllers\FormsController->_prepareVariableArray(Array)
#10 [internal function]: verbb\formie\controllers\FormsController->actionEdit(25627, NULL, NULL)
#11 /var/www/cap.org/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /var/www/cap.org/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /var/www/cap.org/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('edit', Array)
#14 /var/www/cap.org/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('edit', Array)
#15 /var/www/cap.org/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('formie/forms/ed...', Array)
#16 /var/www/cap.org/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('formie/forms/ed...', Array)
#17 /var/www/cap.org/vendor/craftcms/cms/src/web/Application.php(276): yii\web\Application->handleRequest(Object(craft\web\Request))
#18 /var/www/cap.org/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /var/www/cap.org/web/index.php(21): yii\base\Application->run()
#20 {main}

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fieldlayouttabs.id' in 'field list'
The SQL being executed was: SELECT fieldlayouttabs.id, fieldlayouttabs.layoutId, fieldlayouttabs.name, fieldlayouttabs.sortOrder, fieldlayouttabs.uid, ps.settings
FROM craft_fieldlayouttabs
LEFT JOIN craft_formie_pagesettings ps ON ps.fieldLayoutTabId = fieldlayouttabs.id
WHERE layoutId=1035
ORDER BY sortOrder in /var/www/cap.org/vendor/yiisoft/yii2/db/Schema.php:674
Stack trace:
#0 /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'SELECT fieldla...') #1 /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT fieldla...')
#2 /var/www/cap.org/vendor/yiisoft/yii2/db/Command.php(401): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /var/www/cap.org/vendor/yiisoft/yii2/db/Query.php(248): yii\db\Command->queryAll()
#4 /var/www/cap.org/vendor/craftcms/cms/src/db/Query.php(152): yii\db\Query->all(NULL)
#5 /var/www/cap.org/vendor/verbb/formie/src/services/Fields.php(655): craft\db\Query->all()
#6 /var/www/cap.org/vendor/verbb/formie/src/models/FieldLayout.php(58): verbb\formie\services\Fields->getLayoutPagesById(1035)
#7 /var/www/cap.org/vendor/verbb/formie/src/elements/Form.php(427): verbb\formie\models\FieldLayout->getPages()
#8 /var/www/cap.org/vendor/verbb/formie/src/controllers/FormsController.php(347): verbb\formie\elements\Form->getFormConfig()
#9 /var/www/cap.org/vendor/verbb/formie/src/controllers/FormsController.php(89): verbb\formie\controllers\FormsController->_prepareVariableArray(Array)
#10 [internal function]: verbb\formie\controllers\FormsController->actionEdit(25627, NULL, NULL)
#11 /var/www/cap.org/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /var/www/cap.org/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /var/www/cap.org/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('edit', Array)
#14 /var/www/cap.org/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('edit', Array)
#15 /var/www/cap.org/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('formie/forms/ed...', Array)
#16 /var/www/cap.org/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('formie/forms/ed...', Array)
#17 /var/www/cap.org/vendor/craftcms/cms/src/web/Application.php(276): yii\web\Application->handleRequest(Object(craft\web\Request))
#18 /var/www/cap.org/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /var/www/cap.org/web/index.php(21): yii\base\Application->run()
#20 {main}
Additional Information:
Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'fieldlayouttabs.id' in 'field list'
)

@mizmiz
Copy link

mizmiz commented Jul 20, 2020

Line 1002 in /vendor/verbb/formie/src/services/Fields.php should be

->from(['{{%fieldlayouttabs}} fieldlayouttabs'])

@jaydensmith
Copy link
Contributor

jaydensmith commented Jul 20, 2020

Fixed in 1.0.1, sorry about that!

@mkrigsman mkrigsman mentioned this issue Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants