Project

General

Profile

Actions

Feature #14669

closed

set Fields required

Added by old_Gernott about 19 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2005-04-14
Due date:
% Done:

0%

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

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)


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Feature #25049: Add "wizard" to allowOverrideMatrix Array - feature requestClosed2011-02-15

Actions
Related to TYPO3 Core - Feature #55976: Override TCA config with TSconfig - TCEFORMNew2014-02-14

Actions
Actions #1

Updated by Stefan Galinski almost 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'),
);

Actions #2

Updated by Christian Kuhn almost 14 years ago

It's possible to overwrite this TCA setting in extTables.php (site wide).

Actions #3

Updated by Alexander Opitz over 10 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?

Actions #4

Updated by Philipp Gampe over 10 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.

Actions #5

Updated by Alexander Opitz about 10 years ago

  • Status changed from Needs Feedback to New
Actions #6

Updated by Patrick Broens about 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.

Actions #7

Updated by Patrick Broens about 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.

Actions #8

Updated by Susanne Moog over 8 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?

Actions #9

Updated by Alexander Opitz over 8 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.

Actions #10

Updated by Guido Jansen over 6 years ago

We are not able to use #note-7 anymore, since that hook is removed by breaking change #63846

Actions #11

Updated by Tilo Baller over 5 years ago

  • Related to Feature #55976: Override TCA config with TSconfig - TCEFORM added
Actions #12

Updated by Tilo Baller over 5 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.

Actions

Also available in: Atom PDF