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().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valdo’s picture

Status: Active » Needs review
FileSize
734 bytes

Patch to fix this issue attached.

amateescu’s picture

Status: Needs review » Needs work

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

Anonymous’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

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
FileSize
3.61 KB

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

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
FileSize
2.3 KB
4.01 KB

Fixed some doc/code standards, no code changes.

Anonymous’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.