The export configuration functionality provided at admin/config/development/export doesn't work when Drupal is installed in a subdirectory of document root (e.g. mysite.com/drupal/).

Configuration export button form action path is now set to absolute path starting with '/':

$form['#action'] = '/admin/config/development/export-download';
File: core/modules/config/lib/Drupal/config/Form/ConfigExportForm.php

The form action path should start with base_path().

Files: 
CommentFileSizeAuthor
#15 export-2017019-15.patch4.01 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 58,073 pass(es).
[ View ]
#15 interdiff.txt2.3 KBtim.plunkett
#12 configuration-export-action-path-fix-2017019-12.patch4.05 KBvaldo
PASSED: [[SimpleTest]]: [MySQL] 57,964 pass(es).
[ View ]
#8 configuration-export-action-path-fix-2017019-8.patch3.61 KBvaldo
PASSED: [[SimpleTest]]: [MySQL] 57,980 pass(es).
[ View ]
#5 configuration-export-action-path-fix-2017019-5.patch1.46 KBamateescu
FAILED: [[SimpleTest]]: [MySQL] 57,377 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#5 interdiff.txt1.47 KBamateescu
#1 configuration-export-action-path-fix-2017019-1.patch734 bytesvaldo
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

Comments

valdo’s picture

Status:Active» Needs review
StatusFileSize
new734 bytes
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

Patch to fix this issue attached.

amateescu’s picture

Status:Needs review» Needs work

Nope, it's just the leading '/' that should be removed.

beejeebus’s picture

Issue tags:+Configuration system

tag

tim.plunkett’s picture

I have no idea what I'm talking about, but why isn't that $form_state['redirect'] in the submitForm()?

amateescu’s picture

Issue tags:+Needs tests
StatusFileSize
new1.47 KB
new1.46 KB
FAILED: [[SimpleTest]]: [MySQL] 57,377 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Fixed all that and added some docs, but we still need tests for this.

valdo’s picture

Issue tags:-Needs tests

I started working on the test for the export functionality bug but then I have run into this issue: #2017859: Permissions export configuration and import configuration are used in config.routing.yml but not implemented
I have attached a patch there as well so please take a look if you get a chance.

I noticed there is no test for the Export UI at all yet, I'll try to write it.

valdo’s picture

Issue tags:+Needs tests

Accidentally removed the "Needs tests" tag.

valdo’s picture

Status:Needs work» Needs review
StatusFileSize
new3.61 KB
PASSED: [[SimpleTest]]: [MySQL] 57,980 pass(es).
[ View ]

I have written a basic test for the export UI, patch is attached, it checks browser response and the archive file contents. It includes also the changes from the patch above.

This patch depends on #2017859: Permissions export configuration and import configuration are used in config.routing.yml but not implemented because we are using permission 'export configuration', so the test will fail while that permission is not implemented.

Status:Needs review» Needs work
Issue tags:-Needs tests, -Configuration system

The last submitted patch, configuration-export-action-path-fix-2017019-8.patch, failed testing.

valdo’s picture

Status:Needs work» Needs review
Issue tags:+Needs tests, +Configuration system
valdo’s picture

The test has passed after #2017859: Permissions export configuration and import configuration are used in config.routing.yml but not implemented got commited. Can you please review/commit this patch as well?

valdo’s picture

StatusFileSize
new4.05 KB
PASSED: [[SimpleTest]]: [MySQL] 57,964 pass(es).
[ View ]

Patch updated:
- Added test: Assert that the downloaded archive file contents are the same as the test site active store.
- Added blank line ending to the test file.

amateescu’s picture

Status:Needs review» Reviewed & tested by the community

Awesome! RTBC if the bot comes back green.

valdo’s picture

Test green, ready to go.

tim.plunkett’s picture

Issue tags:-Needs tests
StatusFileSize
new2.3 KB
new4.01 KB
PASSED: [[SimpleTest]]: [MySQL] 58,073 pass(es).
[ View ]

Fixed some doc/code standards, no code changes.

beejeebus’s picture

valdo - thanks for adding the test checks i asked for :-) this looks RTBC to me.

alexpott’s picture

Status:Reviewed & tested by the community» Fixed

Committed e997ce7 and pushed to 8.x. Thanks!

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