silverstripe / silverstripe-dms

Adds a Document Management System to Silverstripe
BSD 3-Clause "New" or "Revised" License
40 stars 52 forks source link

Issue with Query Strings and BackLink() #58

Closed aNorthernSoul closed 8 years ago

aNorthernSoul commented 9 years ago

When adding documents, if using translatable or another module with a query string, the "Done!" button appends the rest of the URL after the query string, breaking the link.

The problem looks to be in the BackLink() function at line 164 of DMSDocumentAddController.php Modifying it to something like the following, fixes the issue.

public function Backlink(){ $pageID = $this->currentPageID(); $link = singleton('CMSPagesController')->Link(); $link_array = explode('?',$link); if ( sizeof($link_array) > 1 ) { $link = $link_array[0].'edit/show/'.$pageID.'?'.$link_array[1]; }else{ $link = $link.'edit/show/'.$pageID; } return $link; }

xini commented 8 years ago

also see https://github.com/silverstripe-labs/silverstripe-dms/issues/19

xini commented 8 years ago

can be closed.