Skip to content
Snippets Groups Projects

"2910353: Prevent saving config entities when configuration overrides are applied."

Open Vakul Rai requested to merge issue/drupal-2910353:2910353-prevent-saving-config into 11.x
10 unresolved threads

Prevent saving config entities when configuration overrides are applied.

Edited by Vakul Rai

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
102 102 */
103 103 protected $trustedData = FALSE;
104 104
105 /**
106 * Indicates whether the config entity contains overridden data.
107 *
108 * @var bool
109 */
110 protected $hasOverrides = FALSE;
  • 602 617 return $this->trustedData;
    603 618 }
    604 619
    620 /**
    621 * {@inheritdoc}
    622 */
    623 public function hasOverrides() {
  • 178 178 */
    179 179 public function hasTrustedData();
    180 180
    181 /**
    182 * Returns whether the config entity has overridden configuration.
    183 *
    184 * @return bool
    185 * TRUE if the entity has overridden configuration.
    186 */
    187 public function hasOverrides();
  • 246 263 throw new EntityMalformedException('The entity does not have an ID.');
    247 264 }
    248 265
    266 /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
    267 if ($entity->hasOverrides()) {
    268 throw new UnsupportedEntityOperationException('A config entity with config overrides must not be saved. Use \Drupal\Core\Config\Entity\ConfigEntityStorageInterface::loadOverrideFree() to load a non-overridden config entity. Check issue https://www.drupal.org/project/drupal/issues/2910353 for more details');
  • 37 parent::setUp();
    38
    39 ConfigurableLanguage::createFromLangcode('de')->save();
    40 $user = $this->drupalCreateUser([
    41 'administer site configuration',
    42 'translate configuration',
    43 'administer users',
    44 'administer permissions',
    45 ]);
    46 $this->drupalLogin($user);
    47 }
    48
    49 /**
    50 * Test that permissions can be saved with translated role labels.
    51 */
    52 public function testDateFormatUi() {
  • 13 class NonDefaultConfigSaveUpdateTest extends UpdatePathTestBase {
    14
    15 /**
    16 * {@inheritdoc}
    17 */
    18 protected function setDatabaseDumpFiles() {
    19 $this->databaseDumpFiles = [
    20 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz',
    21 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.config-non-default-language.php',
    22 ];
    23 }
    24
    25 /**
    26 * Tests language_post_update_language_select_widget().
    27 */
    28 public function testNonDefaultConfigOverride() {
  • 1376 1376 return $this;
    1377 1377 }
    1378 1378
    1379 /**
    1380 * {@inheritdoc}
    1381 */
    1382 public function hasOverrides() {
  • 123 127 $this->assertNull($override->get('value'));
    124 128 }
    125 129
    130 /**
    131 * Tests language overrides of config entities.
    132 */
    133 public function testConfigEntityLanguageOverrides() {
  • 539 541 $this->entityStorage->save($entity);
    540 542 }
    541 543
    544 /**
    545 * @covers ::save
    546 */
    547 public function testSaveWithOverrides() {
  • 629 650 }
    630 651 }
    631 652
    653 /**
    654 * @covers ::load
    655 * @covers ::postLoad
    656 * @covers ::mapFromStorageRecords
    657 * @covers ::doLoadMultiple
    658 */
    659 public function testLoadWithOverrides() {
  • Vakul Rai added 2 commits

    added 2 commits

    • c8f0986c - 2910353: Updating the Mr review comments.
    • 9dbdb4ee - 2910353: Fixing the test failures in the fixture files due to corrupt view...

    Compare with previous version

  • Vakul Rai added 1 commit

    added 1 commit

    • b359de5c - 2910353: Fixing the test failures in the fixture files due to corrupt view...

    Compare with previous version

  • Vakul Rai added 1 commit

    added 1 commit

    • 26dd68c9 - 2910353: Fixing the cache tag test.

    Compare with previous version

  • Vakul Rai added 1 commit

    added 1 commit

    • c7ef7c0b - 2910353: Adding an optional parameter to the user_role_grant_permissions...

    Compare with previous version

  • Vakul Rai added 1 commit

    added 1 commit

    • 10d05338 - 2910353: Adding an optional parameter to the user_role_grant_permissions...

    Compare with previous version

  • Vakul Rai added 1 commit

    added 1 commit

    • 03a70c39 - 2910353: Updating the user permission methods to use overrides while saving a config.

    Compare with previous version

  • Vakul Rai added 1 commit

    added 1 commit

    • 0b958984 - 2910353: Fixing the Phpcs issues reported.

    Compare with previous version

  • Sascha Grossenbacher added 717 commits

    added 717 commits

    • 0b958984...9b0a10b8 - 706 commits from branch project:11.x
    • ab101e35 - 1 earlier commit
    • f9d1bc85 - Revert "2910353: Prevent saving config entities when configuration overrides are applied."
    • 7f198e26 - 2910353: Prevent saving config entities when configuration overrides are applied.
    • ce599a6e - 2910353: Updating the cspell words and comment about checking the install.
    • c068bd9b - 2910353: Updating the Mr review comments.
    • 297fa33e - 2910353: Fixing the test failures in the fixture files due to corrupt view...
    • 245df76f - 2910353: Fixing the cache tag test.
    • e8e5fa06 - 2910353: Adding an optional parameter to the user_role_grant_permissions...
    • ee958cd5 - 2910353: Updating the user permission methods to use overrides while saving a config.
    • e9c2ff98 - 2910353: Fixing the Phpcs issues reported.
    • 3fff5b69 - Use loadMultipleOverrideFree() in findConfigEntityDependenciesAsEntities as...

    Compare with previous version

  • added 3 commits

    • 0eafd9cc - Revert "2910353: Adding an optional parameter to the...
    • 1a78d76e - Revert "2910353: Updating the user permission methods to use overrides while saving a config."
    • 276346d9 - Correctly fix stale config entity caches

    Compare with previous version

  • added 999 commits

    • 276346d9...989fe116 - 998 commits from branch project:11.x
    • 63974971 - 2910353: Prevent saving config entities when configuration overrides are applied.

    Compare with previous version

  • added 240 commits

    • 63974971...78ec304c - 239 commits from branch project:11.x
    • b1dd0829 - 2910353: Prevent saving config entities when configuration overrides are applied.

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 227 commits

    • 7770a4eb...30fb2bde - 225 commits from branch project:11.x
    • b6fcb092 - 2910353: Prevent saving config entities when configuration overrides are applied.
    • 4f05e1ae - fix coding standards

    Compare with previous version

  • added 221 commits

    • 4f05e1ae...e2774eb7 - 219 commits from branch project:11.x
    • 07089bcf - 2910353: Prevent saving config entities when configuration overrides are applied.
    • 3e479148 - fix coding standards

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading