From 264cb0119d1afb5bc28324137babcc9e60eade0e Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Tue, 31 Mar 2015 09:57:44 +1100 Subject: [PATCH] recordUrl should be taking priority over the default onClick behavior --- modules/backend/behaviors/RelationController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 9d5b3f199..0c5d97140 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -550,6 +550,7 @@ class RelationController extends ControllerBehavior $config->defaultSort = $this->getConfig('view[defaultSort]'); $config->recordsPerPage = $this->getConfig('view[recordsPerPage]'); $config->showCheckboxes = $this->getConfig('view[showCheckboxes]', !$this->readOnly); + $config->recordUrl = $this->getConfig('view[recordUrl]', null); $defaultOnClick = sprintf( "$.oc.relationBehavior.clickViewListRecord(':id', '%s', '%s')", @@ -557,8 +558,11 @@ class RelationController extends ControllerBehavior $this->relationGetSessionKey() ); + if ($config->recordUrl) { + $defaultOnClick = null; + } + $config->recordOnClick = $this->getConfig('view[recordOnClick]', $defaultOnClick); - $config->recordUrl = $this->getConfig('view[recordUrl]', null); if ($emptyMessage = $this->getConfig('emptyMessage')) { $config->noRecordsMessage = $emptyMessage;