When using an existing config directory the check for it to be writeable should be omitted.

CommentFileSizeAuthor
#5 2655130-5.patch1.42 KBalexpott
#2 2655130-2.patch1.08 KBbircher
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bircher created an issue. See original summary.

bircher’s picture

Status: Active » Needs review
FileSize
1.08 KB
alexpott’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I wonder if this is testable? The profile has tests for both an existing directory and a tarball.. perhaps the test could make the folder not writeable after putting the config in it. We also still need to check it exists even if we're not doing an upload.

alexpott’s picture

+++ b/src/Form/SyncConfigureForm.php
@@ -71,7 +71,7 @@ class SyncConfigureForm extends FormBase {
+    if ($sync_directory != config_get_config_directory(CONFIG_SYNC_DIRECTORY) && $has_upload) {

This condition does not look quite right.

I think we should create if it is not there. If this fails we should error because this is a mistake.
Then if we have an upload we need to ensure it is writable.

alexpott’s picture

Status: Needs work » Needs review
FileSize
1.42 KB

Tried to write a test. But we can't just do it because chmodding to 0444 always results in 0644. Manually tested this and it is all good.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Issue tags: -Needs tests
Drupal test run
---------------

Tests to be run:
  - Drupal\config_installer\Tests\ConfigInstallerEnSecondTest
  - Drupal\config_installer\Tests\ConfigInstallerFrDirectorySyncTest
  - Drupal\config_installer\Tests\ConfigInstallerFrTarballTest
  - Drupal\config_installer\Tests\ConfigInstallerNoDependenciesProfile
  - Drupal\config_installer\Tests\ConfigInstallerSyncTest
  - Drupal\config_installer\Tests\ConfigInstallerTarballTest
  - Drupal\config_installer\Tests\UninstalledProfileModulesTest

Test run started:
  Monday, February 27, 2017 - 18:29

Test summary
------------

Drupal\config_installer\Tests\ConfigInstallerEnSecondTest     36 passes
Drupal\config_installer\Tests\ConfigInstallerFrDirectorySync  32 passes
Drupal\config_installer\Tests\ConfigInstallerFrTarballTest    35 passes
Drupal\config_installer\Tests\ConfigInstallerNoDependenciesP  28 passes
Drupal\config_installer\Tests\ConfigInstallerSyncTest         33 passes
Drupal\config_installer\Tests\ConfigInstallerTarballTest      39 passes
Drupal\config_installer\Tests\UninstalledProfileModulesTest   45 passes

Test run duration: 1 min 43 sec

No test fails.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

  • alexpott committed 7557015 on 8.x-1.x authored by bircher
    Issue #2655130 by alexpott, bircher: Allow specifying a non-writable...

Status: Fixed » Closed (fixed)

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