Feature #14669
closedset Fields required
0%
Description
It is not possible to make Fields at "Edit Page Headers" set to required.
Like this:
TCEFORM.pages.lastUpdated.disabled = 1
should it give:
TCEFORM.pages.lastUpdated.required = 1
The the Filed has to filled out, when creating a Page.
(issue imported from #M978)
Updated by Stefan Galinski over 14 years ago
The correct way to add a required evaluation of the field would be:
TCEFORM.pages.lastUpdated.config.eval = required
Unfortunatly this can't work, because it's simply not allowed to change this attribute in the override matrix.
$this->allowOverrideMatrix = array(
'input' => array('size', 'max'),
'text' => array('cols', 'rows', 'wrap'),
'check' => array('cols', 'showIfRTE'),
'select' => array('size', 'autoSizeMax', 'maxitems', 'minitems'),
'group' => array('size', 'autoSizeMax', 'max_size', 'show_thumbs', 'maxitems', 'minitems', 'disable_controls'),
'inline' => array('appearance', 'behaviour', 'foreign_label', 'foreign_selector', 'foreign_unique', 'maxitems', 'minitems', 'size', 'autoSizeMax', 'symmetric_label'),
);
Updated by Christian Kuhn over 14 years ago
It's possible to overwrite this TCA setting in extTables.php (site wide).
Updated by Alexander Opitz about 11 years ago
- Status changed from Accepted to Needs Feedback
- Target version deleted (
0) - PHP Version deleted (
4)
Hi,
as this issue is very old. Does using the TCA settings fits your needs?
Updated by Philipp Gampe about 11 years ago
IMHO we should try to add this to the override matrix. If it works without side effects, we should just add most of the eval keys.
Updated by Alexander Opitz almost 11 years ago
- Status changed from Needs Feedback to New
Updated by Patrick Broens over 10 years ago
Agree with Philipp.
This can be very convenient, f.i. for content elements.
For one CType you can make a certain field mandatory and for another CType optional, using conditions in pageTSconfig. More and more agencies are developing their own content elements. For one CE the header field might be mandatory, for the other one not. I don't expect any side effects when adding eval to the override matrix, for fields where eval is allowed.
Updated by Patrick Broens over 10 years ago
I found out it can be done using the hook $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass']
$this->allowOverrideMatrix can be changed using this hook. Therefor it is not necessary adding more options to this variable.
Updated by Susanne Moog over 9 years ago
- Status changed from New to Needs Feedback
In the light of Patricks comment #7 - is this ticket still needed or can it be closed?
Updated by Alexander Opitz about 9 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Updated by Guido Jansen almost 7 years ago
Updated by Tilo Baller about 6 years ago
- Related to Feature #55976: Override TCA config with TSconfig - TCEFORM added
Updated by Tilo Baller about 6 years ago
As there doesn't seem to be any possibility to manipulate the allowOverrideMatrix after the getMainFieldsClass hook was removed with breaking change #63846 (https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.5/Breaking-69568-FormEngine.html), even not in current master (as of 18-11-08), we currently use Reflection as a workaround.
E.g. to allow overriding 'eval'-config on an input tca field with TCEFORM.pages.lastUpdated.config.eval = required
the following code placed in an extensions ext_localconf.php does the job for us:
$reflectionClassFormEngineUtility = new ReflectionClass(\TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::class);
$reflectionPropertyAllowOverrideMatrix = $reflectionClassFormEngineUtility->getProperty('allowOverrideMatrix');
$reflectionPropertyAllowOverrideMatrix->setAccessible(true); // make protected property accessible
$allowOverrideMatrix = $reflectionPropertyAllowOverrideMatrix->getValue();
$allowOverrideMatrix['input'][] = 'eval';
$reflectionPropertyAllowOverrideMatrix->setValue($allowOverrideMatrix);
Tested with TYPO3 7.6.31 and PHP 5.6.