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

Matrix field creation is broken in PostgreSQL on 3.0.22 #3252

Closed
angrybrad opened this issue Aug 29, 2018 · 6 comments
Closed

Matrix field creation is broken in PostgreSQL on 3.0.22 #3252

angrybrad opened this issue Aug 29, 2018 · 6 comments
Labels
bug severity:normal Bugs that affect typical usage

Comments

@angrybrad
Copy link
Member

Steps to reproduce

  1. Install a fresh copy of Craft 3.0.22.
  2. Go to Settings->Fields->Create Field.
  3. Create a new Matrix field give it one block and any field.
  4. Try to save and see error.
2018-08-29 16:08:58 [127.0.0.1][1][ihb3cph7df0fmk74fgisn3j19r][error][yii\db\Exception] PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: "new1" in C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\db\Command.php:1258
Stack trace:
#0 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\db\Command.php(1258): PDOStatement->execute()
#1 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\db\Command.php(1148): yii\db\Command->internalExecute('SELECT EXISTS(S...')
#2 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\db\Command.php(425): yii\db\Command->queryInternal('fetchColumn', 0)
#3 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\db\Query.php(425): yii\db\Command->queryScalar()
#4 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\validators\UniqueValidator.php(187): yii\db\Query->exists()
#5 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\validators\UniqueValidator.php(145): yii\validators\UniqueValidator->modelExists('craft\\records\\F...', Array, Object(craft\fields\PlainText))
#6 [internal function]: yii\validators\UniqueValidator->yii\validators\{closure}(Object(craft\db\Connection))
#7 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\db\Connection.php(1059): call_user_func(Object(Closure), Object(craft\db\Connection))
#8 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\validators\UniqueValidator.php(146): yii\db\Connection->useMaster(Object(Closure))
#9 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\validators\UniqueValidator.php(106): yii\validators\UniqueValidator->validateAttribute(Object(craft\fields\PlainText), 'handle')
#10 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\validators\Validator.php(267): craft\validators\UniqueValidator->validateAttribute(Object(craft\fields\PlainText), 'handle')
#11 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\base\Model.php(367): yii\validators\Validator->validateAttributes(Object(craft\fields\PlainText), Array)
#12 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\services\Matrix.php(172): yii\base\Model->validate()
#13 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\services\Matrix.php(428): craft\services\Matrix->validateBlockType(Object(craft\models\MatrixBlockType), false)
#14 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\fields\Matrix.php(233): craft\services\Matrix->validateFieldSettings(Object(craft\fields\Matrix))
#15 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\services\Fields.php(762): craft\fields\Matrix->validate()
#16 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\controllers\FieldsController.php(272): craft\services\Fields->saveField(Object(craft\fields\Matrix))
#17 [internal function]: craft\controllers\FieldsController->actionSaveField()
#18 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#19 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#20 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\web\Controller.php(103): yii\base\Controller->runAction('save-field', Array)
#21 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\base\Module.php(528): craft\web\Controller->runAction('save-field', Array)
#22 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\web\Application.php(282): yii\base\Module->runAction('fields/save-fie...', Array)
#23 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\web\Application.php(538): craft\web\Application->runAction('fields/save-fie...', Array)
#24 C:\dev\craft3test.test\craft\vendor\craftcms\cms\src\web\Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#25 C:\dev\craft3test.test\craft\vendor\yiisoft\yii2\base\Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#26 C:\dev\craft3test.test\public\index.php(36): yii\base\Application->run()
#27 {main}

Likely related to the UniqueValidator changes made in 3.0.22.

Additional info

  • Craft version: 3.0.22
  • PHP version: 7.1
  • Database driver & version: PostgreSQL 9.6.6
  • Plugins & versions: none
@angrybrad angrybrad added bug severity:normal Bugs that affect typical usage labels Aug 29, 2018
@jhughes241
Copy link

Hello, I'm having the problem described above. Just wondering if I should revert back to an earlier release or wait for this fix -not sure how complicated a fix this is? Is the reversion process fairly straightforward? - I realize I need to restore a database backup and download the older version from the cdn. Is it any more complicated than that?

If this is better asked directly to support, please let me know and I will ask there.

Thank you.

@brandonkelly
Copy link
Member

@jhughes241 Just fixed for the next release.

You can get the release early by changing your craftcms/cms version requirement in composer.json to "dev-develop as 3.0.22", and then run composer update.

@jhughes241
Copy link

Wow! that was super-fast (fix and response).

Thank you!

@brandonkelly
Copy link
Member

Hah, I was in the middle of fixing when you posted :)

@jhughes241
Copy link

Fix worked great! Thanks again:)

@narration-sd
Copy link
Contributor

yes, he's fast ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug severity:normal Bugs that affect typical usage
Projects
None yet
Development

No branches or pull requests

4 participants