Project

General

Profile

Actions

Feature #19235

closed

Unused function t3lib_TCEforms::getSingleHiddenField() could be rewritten for proper usage

Added by Cyrille over 15 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-08-20
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

The function t3lib_TCEforms::getSingleHiddenField() seems to be unsused in the source code (like noticed yet in the comments).

While trying to build an "empty" structure in my flex:
[CODE]
<separator>
<type>array</type>
<tx_templavoila>
<title>LLL:EXT:edf_renderlets/tinyMCE/lang.xml:button.separator</title>
</tx_templavoila>
<el>
<icon>
<TCEforms>
<exclude>0</exclude>
<label></label>
<config>
<type>user</type>
<userFunc>tx_edfrdt_flex->getButtonIcon_Separator</userFunc>
</config>
</TCEforms>
</icon>
</el>
</separator>
[/CODE]

It appeared that as there were no input, my tag wasn't kept in flex so I decided to build an hidden field. However, this old function doesn't do it the correct way, I mean, like hidden fields are built in other functions :

[CODE] /**in getSingleHiddenField*/
$itemName=$this->prependFormFieldNames.'['.$table.']['.$uid.']['.$field.']';
$item.='<input type="hidden" name="'.$itemName.'" value="'.htmlspecialchars($itemValue).'" />';
[/CODE]

[CODE]/** Elsewhere*/
$item.='<input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']).'" value="" />';
[/CODE]

Could be patched somehow like that:
[CODE]
function getSingleHiddenField($table,$field,$row,&$PA) {
global $TCA;
$out='';
t3lib_div::loadTCA($table);
if ($TCA[$table]['columns'][$field]) {
$itemValue=$row[$field];
$item.='<input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']).'" value="'.htmlspecialchars($itemValue).'" />';
$out = $item;
}
return $out;
}
[/CODE]
(issue imported from #M9199)

Actions #1

Updated by Alexander Opitz about 11 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?

Actions #2

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions

Also available in: Atom PDF