Index: t3lib/class.t3lib_tceforms.php
===================================================================
--- t3lib/class.t3lib_tceforms.php (revision 4019)
+++ t3lib/class.t3lib_tceforms.php (working copy)
@@ -2028,8 +2028,8 @@
$maxitems = t3lib_div::intInRange($config['maxitems'],0);
if (!$maxitems) $maxitems=100000;
$minitems = t3lib_div::intInRange($config['minitems'],0);
- $allowed = $config['allowed'];
- $disallowed = $config['disallowed'];
+ $allowed = trim($config['allowed']);
+ $disallowed = trim($config['disallowed']);
$disabled = '';
if($this->renderReadonly || $config['readOnly']) {
@@ -2145,19 +2145,19 @@
case 'db': // If the element is of the internal type "db":
// Creating string showing allowed types:
- $tempFT = t3lib_div::trimExplode(',',$allowed,1);
- if (!strcmp(trim($tempFT[0]),'*')) {
+ $tempFT = t3lib_div::trimExplode(',', $allowed, true);
+ if (!strcmp(trim($tempFT[0]), '*')) {
+ $onlySingleTableAllowed = false;
$info.=' '.
htmlspecialchars($this->getLL('l_allTables')).
'
';
- } else {
- while(list(,$theT)=each($tempFT)) {
- if ($theT) {
- $info.=' '.
- t3lib_iconWorks::getIconImage($theT,array(),$this->backPath,'align="top"').
- htmlspecialchars($this->sL($GLOBALS['TCA'][$theT]['ctrl']['title'])).
- '
';
- }
+ } elseif ($tempFT) {
+ $onlySingleTableAllowed = (count($tempFT) == 1);
+ foreach ($tempFT as $theT) {
+ $info.= ' ' .
+ t3lib_iconWorks::getIconImage($theT, array(), $this->backPath, 'align="top"') .
+ htmlspecialchars($this->sL($GLOBALS['TCA'][$theT]['ctrl']['title'])) .
+ '
';
}
}
@@ -2170,6 +2170,10 @@
foreach($temp_itemArray as $dbRead) {
$recordParts = explode('|',$dbRead);
list($this_table,$this_uid) = t3lib_BEfunc::splitTable_Uid($recordParts[0]);
+ // For the case that no table was found and only a single table is defined to be allowed, use that one:
+ if (!$this_table && $onlySingleTableAllowed) {
+ $this_table = $allowed;
+ }
$itemArray[] = array('table'=>$this_table, 'id'=>$this_uid);
if (!$disabled && $show_thumbs) {
$rr = t3lib_BEfunc::getRecordWSOL($this_table,$this_uid);