diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6488216d0..88f6c29f4 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -3,6 +3,7 @@ - fixed #12051: Prevent Proxy Caching Breaks Edit/Add Thing - fixed #12053: Thingy: View Thing Data - fixed #12062: Thingy: column headers missing from exported file + - fixed #12063: Return URL from export doesn't work on non-default Thingy's 7.10.10 - fixed #12035: Story Manager - make keywords from Story view work diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index ffd3e482f..cc7982cba 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -1194,6 +1194,29 @@ sub getThing { #------------------------------------------------------------------- +=head2 getThingUrl ( thingData ) + +Returns a the URL to view a Thing in this Thingy + +=head3 thingData + +A hashref of properties for the Thing, as returned by getThing. This is needed to extract the defaultView, +to get the right func, and the thingId. + +=cut + +sub getThingUrl { + my ($self, $thing) = @_; + if ($thing->{defaultView} eq "addThing") { + return 'func=editThingData;thingId='.$thing->{thingId}.';thingDataId=new'; + } + else{ + return 'func=search;thingId='.$thing->{thingId}; + } +} + +#------------------------------------------------------------------- + =head2 getViewThingVars ( ) Returns the field values of a thing instance and the title for its view screen in a tmpl var hashref. @@ -2773,7 +2796,7 @@ sub www_export { } close $CSV; - $pb->update(sprintf q|%s|, $self->getUrl, sprintf($i18n->get('Return to %s'), $thingProperties->{label})); + $pb->update(sprintf q|%s|, $self->getUrl($self->getThingUrl($thingProperties)), sprintf($i18n->get('Return to %s'), $thingProperties->{label})); return $pb->finish($tempStorage->getUrl($csv_filename)); }