Skip to content

Commit

Permalink
fixed: dbjoin element "link to joined record" was not applied to list…
Browse files Browse the repository at this point in the history
… view and was generating incorrect url in admin
  • Loading branch information
pollen8 committed Dec 27, 2013
1 parent 6832072 commit ed18bbd
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions plugins/fabrik_element/databasejoin/databasejoin.php
Expand Up @@ -1310,7 +1310,8 @@ public function render($data, $repeatCounter = 0)
}

/**
* Add read only links
* Add read only links, if option set and related 'add options in front end'
* form found.
*
* @param array &$defaultLabels Default labels
* @param array $defaultValues Default values
Expand Down Expand Up @@ -1359,8 +1360,17 @@ protected function popUpFormUrl()
$listid = $db->loadResult();

$itemId = FabrikWorker::itemId($listid);
$task = $app->isAdmin() ? 'task=details.view' : 'view=details';
$url = 'index.php?option=com_' . $package . '&' . $task . '&formid=' . $popupformid . '&listid=' . $listid;

return 'index.php?option=com_' . $package . '&view=details&formid=' . $popupformid . '&listid=' . $listid . '&Itemid=' .$itemId . '&rowid=';
if (!$app->isAdmin())
{
$url .= '&Itemid=' .$itemId;
}

$url .= '&rowid=';

return $url;
}

/**
Expand Down Expand Up @@ -1826,6 +1836,24 @@ public function renderListData($data, stdClass &$thisRow)
// $$$ rob add links and icons done in parent::renderListData();
return parent::renderListData($data, $thisRow);
}

/**
* Optionally pre-format list data before rendering to <ul>
*
* @param array &$data Element Data
* @param array $thisRow Row data
*
* @return void
*/
protected function listPreformat(&$data, $thisRow)
{
$raw = $this->getFullName(true, false);
$displayType = $this->getDisplayType();
$raw .= ($displayType == 'checkbox' || $displayType == 'multilist') ? '_id' : '_raw';
$values = FabrikWorker::JSONtoData($thisRow->$raw, true);

$this->addReadOnlyLinks($data, $values);
}

/**
* Used in things like date when its id is suffixed with _cal
Expand Down

0 comments on commit ed18bbd

Please sign in to comment.