Config entity in save assumed as updated when it's new

Probably there's no test, got this issue working on #1552396: Convert vocabularies into configuration
When vocabulary saved it's always displayed message about Update on new vocabulary

Files: 
CommentFileSizeAuthor
#10 drupal-config-1789722-10.patch2.05 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 41,396 pass(es).
[ View ]
#6 drupal-config-1789722-6.patch2.31 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] 41,333 pass(es), 2 fail(s), and 0 exception(s).
[ View ]
#4 1789722-core-save-4-test.patch1.34 KBandypost
FAILED: [[SimpleTest]]: [MySQL] 41,317 pass(es), 2 fail(s), and 0 exception(s).
[ View ]
#4 1789722-core-save-4.patch2.42 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 41,335 pass(es).
[ View ]
#2 1789722-core-save-2.patch1.08 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 41,320 pass(es).
[ View ]
#1 1789722-core-save.patch994 bytesandypost
FAILED: [[SimpleTest]]: [MySQL] 41,328 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Comments

Status:Active» Needs review
Issue tags:-Needs tests
StatusFileSize
new994 bytes
FAILED: [[SimpleTest]]: [MySQL] 41,328 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Simple fix

StatusFileSize
new1.08 KB
PASSED: [[SimpleTest]]: [MySQL] 41,320 pass(es).
[ View ]

Finally enforceNew() is moved too

Really? how on earth can we not need tests for this? The logic was completely bass-ackwards.

StatusFileSize
new2.42 KB
PASSED: [[SimpleTest]]: [MySQL] 41,335 pass(es).
[ View ]
new1.34 KB
FAILED: [[SimpleTest]]: [MySQL] 41,317 pass(es), 2 fail(s), and 0 exception(s).
[ View ]

Changed a test to get this trouble

Attached 1789722-core-save-4-test.patch should fail

+++ b/core/modules/config/lib/Drupal/config/ConfigStorageController.phpundefined
@@ -283,18 +283,18 @@ class ConfigStorageController implements EntityStorageControllerInterface {
+      $entity->enforceIsNew(FALSE);

I'm curious if this passes tests without this one line?

Priority:Critical» Major
StatusFileSize
new2.31 KB
FAILED: [[SimpleTest]]: [MySQL] 41,333 pass(es), 2 fail(s), and 0 exception(s).
[ View ]

D'oh.

Status:Needs review» Needs work

The last submitted patch, drupal-config-1789722-6.patch, failed testing.

Priority:Major» Critical
Status:Needs work» Needs review

I don't fully understand that, I'll have to look at the tests tomorrow. Back to CNR for #4. Also, I didn't mean to change the priority.

Assigned:Unassigned» andypost

This is a simple bug and there's already a test - Use patch from #4
let's get this in and continue with conversion to ConfigEntity patches

StatusFileSize
new2.05 KB
PASSED: [[SimpleTest]]: [MySQL] 41,396 pass(es).
[ View ]

DatabaseStorageController does the same thing, but in the reverse order. Here's a patch that is identical to #4 but with the order of the conditionals matching DatabaseStorageController.

I'd say this is RTBC.

Status:Needs review» Reviewed & tested by the community

+1 RTBC and -1 to criticals, btw we should minimize commit thresholds to unfreeze commit features

Issue tags:+Configuration system

Looks good to me.

Status:Reviewed & tested by the community» Fixed

Awesome!!! :D Thanks so much for the quick turnaround on this.

Committed and pushed to 8.x.

Automatically closed -- issue fixed for 2 weeks with no activity.