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().
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | export-2017019-15.patch | 4.01 KB | tim.plunkett |
| #15 | interdiff.txt | 2.3 KB | tim.plunkett |
| #12 | configuration-export-action-path-fix-2017019-12.patch | 4.05 KB | valdo |
| #8 | configuration-export-action-path-fix-2017019-8.patch | 3.61 KB | valdo |
| #5 | configuration-export-action-path-fix-2017019-5.patch | 1.46 KB | amateescu |
Comments
Comment #1
valdo commentedPatch to fix this issue attached.
Comment #2
amateescu commentedNope, it's just the leading '/' that should be removed.
Comment #3
Anonymous (not verified) commentedtag
Comment #4
tim.plunkettI have no idea what I'm talking about, but why isn't that $form_state['redirect'] in the submitForm()?
Comment #5
amateescu commentedFixed all that and added some docs, but we still need tests for this.
Comment #6
valdo commentedI 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.
Comment #7
valdo commentedAccidentally removed the "Needs tests" tag.
Comment #8
valdo commentedI 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.Comment #10
valdo commented#8: configuration-export-action-path-fix-2017019-8.patch queued for re-testing.
Comment #11
valdo commentedThe 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?
Comment #12
valdo commentedPatch 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.
Comment #13
amateescu commentedAwesome! RTBC if the bot comes back green.
Comment #14
valdo commentedTest green, ready to go.
Comment #15
tim.plunkettFixed some doc/code standards, no code changes.
Comment #16
Anonymous (not verified) commentedvaldo - thanks for adding the test checks i asked for :-) this looks RTBC to me.
Comment #17
alexpottCommitted e997ce7 and pushed to 8.x. Thanks!