From e4b0c0fe2754f11235400e8aa69713c18188d4a2 Mon Sep 17 00:00:00 2001 From: tschallacka Date: Tue, 26 Jan 2016 14:17:18 +0100 Subject: [PATCH 1/2] Fixed static id naming primary key RelationController forced belongs to relations to have a primary key named id. If primary key was named differently it wouldn't register the onclick. This fixes that by taking the primary key name from the model. --- bldgpsxb.b3b.txt | 8 ++++++++ modules/backend/behaviors/RelationController.php | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 bldgpsxb.b3b.txt diff --git a/bldgpsxb.b3b.txt b/bldgpsxb.b3b.txt new file mode 100644 index 000000000..eed2010bd --- /dev/null +++ b/bldgpsxb.b3b.txt @@ -0,0 +1,8 @@ + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# On branch fixSortableCheckInList +# Changes to be committed: +# modified: modules/backend/widgets/Lists.php +# + diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 07d4ab4f4..23333d470 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -688,7 +688,8 @@ class RelationController extends ControllerBehavior if ($this->viewMode == 'single') { $config->showCheckboxes = false; $config->recordOnClick = sprintf( - "$.oc.relationBehavior.clickManageListRecord(:id, '%s', '%s')", + "$.oc.relationBehavior.clickManageListRecord(:%s, '%s', '%s')", + $this->relationModel->getKeyName(), $this->field, $this->relationGetSessionKey() ); @@ -698,7 +699,8 @@ class RelationController extends ControllerBehavior } elseif ($isPivot) { $config->recordOnClick = sprintf( - "$.oc.relationBehavior.clickManagePivotListRecord(:id, '%s', '%s')", + "$.oc.relationBehavior.clickManagePivotListRecord(:%s, '%s', '%s')", + $this->relationModel->getKeyName(), $this->field, $this->relationGetSessionKey() ); From 828006a88aa193726618f2cff88e12a5dc67b2bf Mon Sep 17 00:00:00 2001 From: tschallacka Date: Tue, 26 Jan 2016 14:22:24 +0100 Subject: [PATCH 2/2] deleted surplus file... somehow it didn'tget cleaned up --- bldgpsxb.b3b.txt | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 bldgpsxb.b3b.txt diff --git a/bldgpsxb.b3b.txt b/bldgpsxb.b3b.txt deleted file mode 100644 index eed2010bd..000000000 --- a/bldgpsxb.b3b.txt +++ /dev/null @@ -1,8 +0,0 @@ - -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# On branch fixSortableCheckInList -# Changes to be committed: -# modified: modules/backend/widgets/Lists.php -# -