[BUGFIX] TCEforms Suggest doesn't search static tables as user
authorThomas Maroschik <tmaroschik@dfau.de>
Wed, 13 Apr 2011 10:02:57 +0000 (12:02 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Thu, 16 Jun 2011 12:35:34 +0000 (14:35 +0200)
As a backend user, when using a suggest form next to a select
or group field containing entries from a static table I won't
get any results from this table. The pid 0 is not accessible
for regular users, and thus checks against
t3lib_BEfunc::readPageAccess are unneccessary.

Added a condition in t3lib_TCEforms_Suggest_DefaultReceiver::
checkRecordAccess() that checks for an is_static declaration in
TCA ctrl section of the affected table.

Change-Id: Id4a43f07c7d324b1c9c63a610db741b552df6f18
Fixes: #25938
Reviewed-on: http://review.typo3.org/1592
Reviewed-by: Stefan Neufeind
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
Reviewed-by: Björn Pedersen
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php

index bfa7091..a9ffef3 100644 (file)
@@ -335,6 +335,8 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
                        if (!t3lib_BEfunc::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(1))) {
                                $retValue = FALSE;
                        }
+               } elseif (isset($GLOBALS['TCA'][$table]['ctrl']['is_static']) && (bool)$GLOBALS['TCA'][$table]['ctrl']['is_static']) {
+                       $retValue = TRUE;
                } else {
                        if (!is_array(t3lib_BEfunc::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)))) {
                                $retValue = FALSE;
@@ -426,4 +428,4 @@ class t3lib_TCEforms_Suggest_DefaultReceiver {
        }
 }
 
-?>
\ No newline at end of file
+?>