Skip to content

Commit

Permalink
Merge pull request #19 from gartner/haestrup-vandvaerk.dk
Browse files Browse the repository at this point in the history
Haestrup vandvaerk.dk
  • Loading branch information
gartner committed Dec 25, 2014
2 parents bdf3eb8 + 2688d71 commit 9d8e325
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions DB/DataObject/FormBuilder/Frontend.php
Expand Up @@ -831,7 +831,7 @@ public function getAddLink()
public function delete()
{
// Delete record
$postedUrl = array();
$returnUrl = $this->getQueryParamsArray();
$this->mode = self::DELETE;

// TODO: use getDataObject() here
Expand Down Expand Up @@ -924,14 +924,22 @@ public function delete()
return $out;
}

$postedUrl = unserialize($this->form->getSubmitValue('__url'));
// This will restore the url that was in the first call to delete()
// (the call to confirm the delete)
$returnUrl = unserialize($this->form->getSubmitValue('__url'));
}

// Do the actual deletion
if (!$this->confirmDelete
|| ($this->confirmDelete && isset($_REQUEST['confirmed']))
) {

// If we come here after a delete-confirm, retrieve the url we should
// return to after the delete
if (isset($_REQUEST['__url'])) {
$returnUrl = unserialize($_REQUEST['__url']);
}

if (!empty($records)) {
if (is_array($records)) {
$tmpid = array();
Expand Down Expand Up @@ -969,7 +977,7 @@ public function delete()
}

$url = $this->getUrl(
$postedUrl, false, array('record',
$returnUrl, false, array('record',
'addRecord', 'delete', 'confirmed', 'not_confirmed'), '&'
);

Expand Down

0 comments on commit 9d8e325

Please sign in to comment.