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

3.2.0 Error when draft auto saving - can't save any edits #4515

Closed
amperand opened this issue Jul 10, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@amperand
Copy link

commented Jul 10, 2019

Description

I'm unable to save updates as the auto draft save feature is throwing an error. The update entry button remains grayed out.

Console.log shows POST index.php?p=admin%2Factions%2F/entry-revisions/save-draft 500 (jquery.js:9827)

Steps to reproduce

  1. Make any change to a field
  2. Shows unknown error over and over

Additional info

  • Craft version: 3.2.0
  • PHP version: 7.3.7
  • Database driver & version: MySQL 5.5.60
  • Plugins & versions:

Control Panel CSS | 2.2.0
Feed Me 4.1.1
Minify 1.2.9
Neo 2.3.5
Redactor 2.3.3.2
Relabel 1.3.2
SEO 3.5.4
Video Embedder 1.1.3

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

Try clearing out your storage/logs/ folder, then reproduce the error, and then search storage/logs/web.log for [error]. Can you please post the error details, including the stack trace?

@khalwat

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Getting what I assume to be a similar/same error:

2019-07-10 21:14:20 [-][1][-][info][yii\db\Command::execute] INSERT INTO `drafts` (`sourceId`, `revisionId`, `creatorId`, `name`, `notes`) VALUES (2, 68, 1, 'Draft 2', NULL)
2019-07-10 21:14:20 [-][1][-][profile begin][yii\db\Command::execute] INSERT INTO `drafts` (`sourceId`, `revisionId`, `creatorId`, `name`, `notes`) VALUES (2, 68, 1, 'Draft 2', NULL)
2019-07-10 21:14:20 [-][1][-][profile end][yii\db\Command::execute] INSERT INTO `drafts` (`sourceId`, `revisionId`, `creatorId`, `name`, `notes`) VALUES (2, 68, 1, 'Draft 2', NULL)
2019-07-10 21:14:20 [-][1][-][trace][yii\db\Transaction::rollBack] Roll back transaction
2019-07-10 21:14:20 [-][1][-][error][yii\db\IntegrityException] PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`craft3`.`drafts`, CONSTRAINT `drafts_revisionId_fk` FOREIGN KEY (`revisionId`) REFERENCES `revisions` (`id`) ON DELETE SET NULL) in /home/vagrant/sites/craft3/vendor/yiisoft/yii2/db/Command.php:1290
Stack trace:
#0 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute()
#1 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/db/Command.php(1091): yii\db\Command->internalExecute('INSERT INTO `dr...')
#2 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/services/Drafts.php(357): yii\db\Command->execute()
#3 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/services/Drafts.php(138): craft\services\Drafts->_insertDraftRow(2, 68, 1, 'Draft 2', NULL)
#4 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/controllers/EntryRevisionsController.php(205): craft\services\Drafts->createDraft(Object(craft\elements\Entry), 1)
#5 [internal function]: craft\controllers\EntryRevisionsController->actionSaveDraft()
#6 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('save-draft', Array)
#9 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-draft', Array)
#10 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Application.php(298): yii\base\Module->runAction('entry-revisions...', Array)
#11 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Application.php(565): craft\web\Application->runAction('entry-revisions...', Array)
#12 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Application.php(277): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#13 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#14 /home/vagrant/sites/craft3/web/index.php(17): yii\base\Application->run()
#15 {main}
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

@khalwat can you send your composer.json and composer.lock files, and a database backup, over to support@craftcms.com?

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

We’ve fixed a couple entry/draft-saving bugs for the next release. Unrelated to the error @khalwat is getting, but might help you, @amperand, and others.

To get the fixes early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#43d22b4403fb555e1d8db3efc4b9978071b1deb5 as 3.2.0",
  "...": "..."
}

Then run composer update.

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

Just fixed @khalwat’s issue, which occurred when editing an entry that had enough revisions to reach the maxRevisions config setting.

To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#179745dff7716446d768b0eaec0152b4c8b1f3d0 as 3.2.1",
  "...": "..."
}

Then run composer update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.