In views_data_export/plugins/views_data_export_plugin_display_export.inc, we have this line of code:

$return_path = empty($_GET['return-url']) ? '' : $_GET['return-url'];

I tried adding "?return-url" to the end of the Data Export display path, but the URL on the results page winds up being:

http://www.company.org/memberexport/user_export.csv%3Freturn-url%3Dmemberexport?eid=7

Obviously I'm not adding the return-url properly. How am I supposed to set a return-url?

If I rework the URL to be this:

http://www.company.org/memberexport/user_export.csv?eid=7&return-url=memberexport

It works great.

Thanks.

CommentFileSizeAuthor
#4 allow_return-url_parameter-1860376-4.patch1.06 KBdobe

Comments

dpearcefl’s picture

No answers on how to use this parameter?

dpearcefl’s picture

Bump one last time. Really would like an answer. Thanks.

steven jones’s picture

Status: Active » Closed (works as designed)

Sorry but the return URL parameter is really for internal use, and not for you to choose where the export redirects to at the end of the process, sorry!

dobe’s picture

Version: 6.x-2.0-beta6 » 7.x-3.x-dev
Category: Support request » Feature request
Issue summary: View changes
Status: Closed (works as designed) » Needs review
StatusFileSize
new1.06 KB

It would be nice if this functionality were in place. I have a view that displays a list of link's to different views that have csv exports that I would like to return to after. Attached is a simple patch to allow this to happen it should not really be a big issue as it seems the main use of this return url is just to provide a link back to wherever you came from.

-Jesse

R.Hendel’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for your work, Jesse!

I tested it and everything works as expected:
While testing in our project

  • I apllied patch #4,
  • added "?return-url=myreturnurl" to menu path of csv-export views display,
  • clicked at "CSV-Export" button in views frontend.
  • It worked as expected: File gets downloaded and I wasn't redirected to any page, as my return-url was the same page containing csv-export button.

There is one problem remaining, but this may be caused by some other things:
We use views_data_export attached to a content pane using panels.
When I trying batch mode, than it breaks in that sense, that module behaves like unpatched version.

dobe’s picture

Hmm. As long as you pass the return-url to the url it should override any default functionality. In your instance are you passing the return-url or are you trying to use the views functionality "Attach to:"? If you are, is it a "Content pane" your trying to attach it to? I would need some further information to debug your issue.

-Jesse

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: allow_return-url_parameter-1860376-4.patch, failed testing.

nwom’s picture

Status: Needs work » Fixed

This appears to have been included in the module. In the newest dev release, the functionality is in place.

Status: Fixed » Closed (fixed)

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