Project

General

Profile

Actions

Bug #17621

closed

Insertion of more than one items by the Element Browser is allowed when it shouldn't

Added by Kostas Petrianakis about 17 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2007-09-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The backend interface allows to select more than one items by the Element Browser for fields that take references to pages or files and should allow only one item to be inserted.

See proposed solution bellow:

Replace the generated Javascript function: setFormValueOpenBrowser
within the function: dbFileCon
in the file: t3lib/class.t3lib_tceforms.php (line:4761)
with this:

function setFormValueOpenBrowser(mode,params) { //
var cmltemp = new Array();
cmltemp = params.split(\'|\');
var cmlname = cmltemp0;
cmlObj = '.$formObj.'[cmlname+"_list"];
if(cmlObj){
var len = cmlObj.length;
if(cmlObj.size==1 && len>=1){
alert(\'This field takes only one item. Please remove the existing one before attempting to input another.\');
return false;
}
}
var url = "'.$this->backPath.'browser.php?mode="+mode+"&bparams="+params;

browserWin = window.open(url,"Typo3WinBrowser","height=350,width="+(mode=="db"?650:600)+",status=0,menubar=0,resizable=1,scrollbars=1");
browserWin.focus();
}

(issue imported from #M6372)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #20422: TCEForm does not replace the existing element if adding a new element to a field with maxitems=1Closed2009-05-14

Actions
Actions

Also available in: Atom PDF