Index: class.t3lib_refindex.php
===================================================================
--- class.t3lib_refindex.php (revision 3310)
+++ class.t3lib_refindex.php (working copy)
@@ -564,7 +564,7 @@
$realFile = $dest.'/'.trim($file);
# if (@is_file($realFile)) { // Now, the refernece index should NOT look if files exist - just faithfully include them if they are in the records!
$newValueFiles[] = array(
- 'filename' => $file,
+ 'filename' => basename($file),
'ID' => md5($realFile),
'ID_absFile' => $realFile
); // the order should be preserved here because.. (?)
@@ -974,6 +974,9 @@
* @return string Input folder prefixed with PATH_site. No checking for existence is done. Output must be a folder without trailing slash.
*/
function destPathFromUploadFolder($folder) {
+ if (!$folder)
+ return substr(PATH_site, 0, -1);
+
return PATH_site.$folder;
}
Index: class.t3lib_tceforms.php
===================================================================
--- class.t3lib_tceforms.php (revision 3310)
+++ class.t3lib_tceforms.php (working copy)
@@ -2032,7 +2032,7 @@
if(!$disabled && !(isset($config['disable_controls']) && t3lib_div::inList($config['disable_controls'], 'upload'))) {
// Adding the upload field:
- if ($this->edit_docModuleUpload) $item.='formWidth().' size="60" />';
+ if ($this->edit_docModuleUpload && $config['uploadfolder']!="") $item.='formWidth().' size="60" />';
}
break;
case 'db': // If the element is of the internal type "db":
@@ -3310,7 +3310,7 @@
while(list(,$pp)=each($itemArray)) {
$pParts = explode('|',$pp);
$uidList[]=$pUid=$pTitle = $pParts[0];
- $opt[]='';
+ $opt[]='';
}
break;
default:
Index: class.t3lib_tcemain.php
===================================================================
--- class.t3lib_tcemain.php (revision 3310)
+++ class.t3lib_tcemain.php (working copy)
@@ -1696,6 +1696,15 @@
}
$valueArray = $dbAnalysis->countItems();
}
+ //store path relative to site root (if uploadfolder is not set)
+ } else {
+ if (count($valueArray)){
+ foreach($valueArray as $key => $theFile){
+ if (t3lib_div::isFirstPartOfStr($theFile,PATH_site)) {
+ $valueArray[$key] = substr($theFile,strlen(PATH_site));
+ }
+ }
+ }
}
return $valueArray;