Project

General

Profile

Actions

Bug #76979

closed

FormEngine should allow to set default-Values in new CType-Elements

Added by Nicolai Schirawski over 8 years ago. Updated about 6 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2016-07-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Create a new content-Element as Extension myext with ctype=myctype
In typo3conf/ext/myext/Configuration/TCA/Overrides/tt_content.php you can choose the Form-Elements being shown with CE "myctype" by setting
$GLOBALS['TCA']['tt_content']['types']['myctype']['showitem'] to the

Changing the behaviour of single form elements is only partly possible:

$GLOBALS['TCA']['tt_content']['types']['myctype'] = [
'columnsOverrides' => [
'imageheight' => [
'config' => [
'default' => 250,
'max' => 6,
]
],

Here, "max" will have an effect when using the field in BE, "default" will have no effect

Actions #1

Updated by Christian Kuhn over 8 years ago

Hey, thanks for report.

that's a chicken egg problem: for new records, type is not defined yet, so columnsOverrides can't be used, so you can't set default values in columnsOverrides.

Will close as rejected if you don't have a great idea on how do solve that without hacks.

btw: you could hand over the ctype as get or post (the new content element wizard does stuff like that). in this case the columnsOverrides will work if i remember correctly.

Actions #2

Updated by Christian Kuhn over 8 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Nicolai Schirawski over 8 years ago

But strange: the max value can be changed with columnsOverrides. So this part works

And I am overwriting existing fields in tt_content...

So I think overwriting default should work, too.

Actions #4

Updated by Alexander Opitz about 8 years ago

  • Subject changed from FromEngine should allow to set default-Values in new CType-Elements to FormEngine should allow to set default-Values in new CType-Elements
  • Status changed from Needs Feedback to New

@Christian Kuhn: There was an answer for you.

Actions #5

Updated by Felix Nagel over 7 years ago

Confirmed for TYPO3 8.7.3

that's a chicken egg problem: for new records, type is not defined yet, so columnsOverrides can't be used, so you can't set default values in columnsOverrides.

This works for eval, placeholder, etc. before saving the new element.

Actions #6

Updated by Christian Kuhn about 6 years ago

  • Status changed from New to Rejected

Hey. I'll have to close this. 'default' is set before type is calculated (because type can be influenced by default). So there really is a chicken-egg problem and setting 'default' in columnsOverride will not work in the forseable future.

Actions

Also available in: Atom PDF