Issue #1789722 by andypost, tim.plunkett: Fixed ConfigStorageController::save.

8.0.x
webchick 2012-09-20 13:37:38 -07:00
parent b10ff4324b
commit 5719e7e7d6
2 changed files with 7 additions and 5 deletions

View File

@ -284,13 +284,13 @@ class ConfigStorageController implements EntityStorageControllerInterface {
}
if (!$config->isNew()) {
$return = SAVED_NEW;
$return = SAVED_UPDATED;
$config->save();
$this->postSave($entity, TRUE);
$this->invokeHook('update', $entity);
}
else {
$return = SAVED_UPDATED;
$return = SAVED_NEW;
$config->save();
$entity->enforceIsNew(FALSE);
$this->postSave($entity, FALSE);

View File

@ -45,7 +45,8 @@ class ConfigEntityTest extends WebTestBase {
);
$this->drupalPost('admin/structure/config_test/add', $edit, 'Save');
$this->assertResponse(200);
$this->assertText($label1);
$message_insert = format_string('%label configuration has been created.', array('%label' => $label1));
$this->assertRaw($message_insert);
// Update the configuration entity.
$this->assertLinkByHref('admin/structure/config_test/manage/' . $id);
@ -54,8 +55,9 @@ class ConfigEntityTest extends WebTestBase {
);
$this->drupalPost('admin/structure/config_test/manage/' . $id, $edit, 'Save');
$this->assertResponse(200);
$this->assertNoText($label1);
$this->assertText($label2);
$message_update = format_string('%label configuration has been updated.', array('%label' => $label2));
$this->assertNoRaw($message_insert);
$this->assertRaw($message_update);
// Delete the configuration entity.
$this->assertLinkByHref('admin/structure/config_test/manage/' . $id . '/delete');