From 96e449225e81af0795b011a50a3f48b2ba587477 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 15 Oct 2009 22:39:07 +0000 Subject: [PATCH] BUGFIX: If a CTF without a show action is made readonly, don't add the show action back. (from r88960) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89204 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TableListField.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forms/TableListField.php b/forms/TableListField.php index ab7920e06..840e19f57 100755 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -530,7 +530,10 @@ JS function performReadonlyTransformation() { $clone = clone $this; $clone->setShowPagination(false); - $clone->setPermissions(array('show')); + + // Only include the show action if it was in the original CTF. + $clone->setPermissions(in_array('show', $this->permissions) ? array('show') : array()); + $clone->addExtraClass( 'readonly' ); $clone->setReadonly(true); return $clone;