Skip to content

[BUGFIX] fix JS validation for names of properties and relations #775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: typo3-12-reactjs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Build/Sources/components/ReactFlow/CustomModelNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ export const CustomModelNode = (props) => {
identifier="propertyName"
initialValue={property.name}
onChange={(value) => {
updateProperty(index, "name", value.toLowerCase());
value = value.replace(/(^|_)./g, s => s.slice(-1).toUpperCase());
updateProperty(index, "name", value.charAt(0).toLowerCase() + value.slice(1));
}}
/>
<SelectComponent
Expand Down Expand Up @@ -811,7 +812,8 @@ export const CustomModelNode = (props) => {
initialValue={relation.relationName}
identifier="relationName"
onChange={(value) => {
updateRelation(index, "relationName", value);
value = value.replace(/(^|_)./g, s => s.slice(-1).toUpperCase());
updateProperty(index, "name", value.charAt(0).toLowerCase() + value.slice(1));
}}
/>
<SelectComponent
Expand Down
1 change: 0 additions & 1 deletion Classes/Service/ValidationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ class ValidationService implements SingletonInterface
'fe_group',
'hidden',
'deleted',
'cruser_id',
'crdate',
'tstamp',
'sys_language',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Plugin Options</sheetTitle>
</TCEforms>
<sheetTitle>Plugin Options</sheetTitle>
<type>array</type>
<el>
<settings.flexform_{plugin.key}.empty-field>
<TCEforms>
<label>Empty field</label>
<config>
<type>input</type>
<size>50</size>
<eval>trim</eval>
</config>
</TCEforms>
<label>Empty field</label>
<config>
<type>input</type>
<size>50</size>
<eval>trim</eval>
</config>
</settings.flexform_{plugin.key}.empty-field>
</el>
</ROOT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ if (!is_array($GLOBALS['TCA']['tt_content']['types']['{extension.extensionKey}_{
'tt_content',
'CType',
[
'{plugin.name -> k:format.quoteString()}',
'{extension.extensionKey}_{plugin.key}',
'{extension.extensionKey}-plugin-{plugin.key}',
'{extension.extensionKey}'
'label' => '{plugin.name -> k:format.quoteString()}',
'value' => '{extension.extensionKey}_{plugin.key}',
'icon' => '{extension.extensionKey}-plugin-{plugin.key}',
'group' => '{extension.extensionKey}'
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ return [
'title' => 'LLL:EXT:{extension.extensionKey}/Resources/Private/Language/locallang_db.xlf:{domainObject.databaseTableName}',
'label' => '{domainObject.listModuleValueLabel}',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',<f:if condition="{domainObject.sorting}">
'crdate' => 'crdate',<f:if condition="{domainObject.sorting}">
'sortby' => 'sorting',</f:if><f:if condition="{extension.supportVersioning}">
'versioningWS' => true,</f:if><f:if condition="{extension.supportLocalization}">
'languageField' => 'sys_language_uid',
Expand Down Expand Up @@ -42,7 +41,7 @@ return [
'renderType' => 'selectSingle',
'default' => 0,
'items' => [
['', 0],
['label' => '', 'value' => 0],
],
'foreign_table' => '{domainObject.databaseTableName}',
'foreign_table_where' => 'AND <k:curlyBrackets>#{domainObject.databaseTableName}</k:curlyBrackets>.<k:curlyBrackets>#pid</k:curlyBrackets>=###CURRENT_PID### AND <k:curlyBrackets>#{domainObject.databaseTableName}</k:curlyBrackets>.<k:curlyBrackets>#sys_language_uid</k:curlyBrackets> IN (-1,0)',
Expand All @@ -61,8 +60,7 @@ return [
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
'label' => '',
'invertStateDisplay' => true
]
],
Expand All @@ -72,9 +70,8 @@ return [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'type' => 'datetime',
'format' => 'datetime',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true
Expand All @@ -85,9 +82,8 @@ return [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'type' => 'datetime',
'format' => 'datetime',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038)
Expand Down
1 change: 0 additions & 1 deletion Resources/Private/CodeTemplates/Extbase/extEmconf.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $EM_CONF[$_EXTKEY] = [
'author' => '<f:for each="{extension.persons}" as="person" iteration="counter"><f:if condition="{counter.index} > 0">, </f:if>{person.name}</f:for>',
'author_email' => '<f:for each="{extension.persons}" as="person" iteration="counter"><f:if condition="{person.email}"><f:if condition="{counter.index} > 0">, </f:if>{person.email}</f:if></f:for>',
'state' => '{extension.readableState}',
'clearCacheOnLoad' => 0,
'version' => '{extension.version}',
'constraints' => [
'depends' => [<f:for each="{extension.dependencies}" as="version" key="extensionKey">
Expand Down
Loading