I have a view that takes a numeric ID as an argument. It works great.
But when I attach an export to it, and then try to export, it goes through the process, shows the loading bar...and then nothing.
I get this error:
The requested page "/admin/commerce/products/%25/coupon-codes-per-deal/export?eid=4" could not be found.
And this is no matter what type I try to export to (csv, xls, etc).
It replaces the argument in the url with "%25". If I retype the url and put a correct ID in there, it does say:
Your export has been created. View/download the file here (will automatically download in 3 seconds.)
But then redirects and I get another error.
So it seems the arguments in the URL are not being handled properly.
Comments
Comment #1
jazzdrive3 commentedSo essentially, the module is take the path "as-is" from the view and just passing it to a function somewhere, which then replaces the "%" placeholder of the path with the ascii code "%25" instead of keeping the current argument of the page.
So the path "/admin/commerce/products/540/coupon-codes-per-deal", when you click on the attached export, becomes
"/admin/commerce/products/%25/coupon-codes-per-deal/export?eid=4" because the 540 argument is not being passed to it. It's just grabbing the raw path of the view.
But I'm not sure where this is happening. Can anyone offer any insight?
The export is logged and recorded into the database just fine, and I can get to it by manually typing in the url with the right export arguments. But a normal user is not going to do this, and that's who I need to hand this off to soon.
Thanks!
Comment #2
jazzdrive3 commentedFound the exact place of the problem.
In the file "views_data_export_plugin_display_export.inc", near line 277, it grabs the path from the view options, which breaks anything using arguments.
$final_destination = $this->get_option('path');
I changed it to this, and the first redirect works:
$final_destination = $_GET['q'];
Then you need to change the render_complete function around line 472, but you need to do something more complicated.
I had to loop through the view object and manually replace each % with an arg to ensure compatibility. To get the true path to the view, you can do this:
Comment #3
steven jones commentedCould you re-test with the latest beta please, 7.x-3.0-beta6?
Comment #4
steven jones commentedCan't reproduce with beta6, please re-open if you can.
Comment #5
steven jones commentedApologies, I can reproduce this now.
Comment #6
steven jones commentedFixed in 7.x-3.x, we should backport this to 6.x-2.x
Comment #7
steven jones commentedFixed in 6.x-2.x also.