Skip to content

Commit b529d53

Browse files
authored
Merge pull request #164 from andreaswolf/update-rule-definitions
[TASK] Fix invalid FlexForm code samples
2 parents 62d038d + 1e14f05 commit b529d53

8 files changed

+299
-241
lines changed

packages/typo3-fractor/rules/TYPO3v12/FlexForm/MigrateEmailFlagToEmailTypeFlexFormFractor.php

+32-26
Original file line numberDiff line numberDiff line change
@@ -88,37 +88,43 @@ public function getRuleDefinition(): RuleDefinition
8888
return new RuleDefinition('Migrate email flag to email type', [new CodeSample(
8989
<<<'CODE_SAMPLE'
9090
<T3DataStructure>
91-
<ROOT>
92-
<sheetTitle>aTitle</sheetTitle>
93-
<type>array</type>
94-
<el>
95-
<email_field>
96-
<label>Email</label>
97-
<config>
98-
<type>input</type>
99-
<eval>trim,email</eval>
100-
<max>255</max>
101-
</config>
102-
</email_field>
103-
</el>
104-
</ROOT>
91+
<sheets>
92+
<sDEF>
93+
<ROOT>
94+
<sheetTitle>Sheet Title</sheetTitle>
95+
<type>array</type>
96+
<el>
97+
<email_field>
98+
<config>
99+
<type>input</type>
100+
<eval>trim,email</eval>
101+
<max>255</max>
102+
</config>
103+
</email_field>
104+
</el>
105+
</ROOT>
106+
</sDEF>
107+
</sheets>
105108
</T3DataStructure>
106109
CODE_SAMPLE
107110
,
108111
<<<'CODE_SAMPLE'
109112
<T3DataStructure>
110-
<ROOT>
111-
<sheetTitle>aTitle</sheetTitle>
112-
<type>array</type>
113-
<el>
114-
<email_field>
115-
<label>Email</label>
116-
<config>
117-
<type>email</type>
118-
</config>
119-
</email_field>
120-
</el>
121-
</ROOT>
113+
<sheets>
114+
<sDEF>
115+
<ROOT>
116+
<sheetTitle>Sheet Title</sheetTitle>
117+
<type>array</type>
118+
<el>
119+
<email_field>
120+
<config>
121+
<type>email</type>
122+
</config>
123+
</email_field>
124+
</el>
125+
</ROOT>
126+
</sDEF>
127+
</sheets>
122128
</T3DataStructure>
123129
CODE_SAMPLE
124130
)]);

packages/typo3-fractor/rules/TYPO3v12/FlexForm/MigrateEvalIntAndDouble2ToTypeNumberFlexFormFractor.php

+51-27
Original file line numberDiff line numberDiff line change
@@ -103,36 +103,60 @@ public function getRuleDefinition(): RuleDefinition
103103
{
104104
return new RuleDefinition('Migrate eval int and double2 to type number', [new CodeSample(
105105
<<<'CODE_SAMPLE'
106-
<int_field>
107-
<label>int field</label>
108-
<config>
109-
<type>input</type>
110-
<eval>int</eval>
111-
</config>
112-
</int_field>
113-
<double2_field>
114-
<label>double2 field</label>
115-
<config>
116-
<type>input</type>
117-
<eval>double2</eval>
118-
</config>
119-
</double2_field>
106+
<T3DataStructure>
107+
<sheets>
108+
<sDEF>
109+
<ROOT>
110+
<sheetTitle>Sheet Title</sheetTitle>
111+
<type>array</type>
112+
<el>
113+
<int_field>
114+
<label>int field</label>
115+
<config>
116+
<type>input</type>
117+
<eval>int</eval>
118+
</config>
119+
</int_field>
120+
<double2_field>
121+
<label>double2 field</label>
122+
<config>
123+
<type>input</type>
124+
<eval>double2</eval>
125+
</config>
126+
</double2_field>
127+
</el>
128+
</ROOT>
129+
</sDEF>
130+
</sheets>
131+
</T3DataStructure>
120132
CODE_SAMPLE
121133
,
122134
<<<'CODE_SAMPLE'
123-
<int_field>
124-
<label>int field</label>
125-
<config>
126-
<type>number</type>
127-
</config>
128-
</int_field>
129-
<double2_field>
130-
<label>double2 field</label>
131-
<config>
132-
<type>number</type>
133-
<format>decimal</format>
134-
</config>
135-
</double2_field>
135+
<T3DataStructure>
136+
<sheets>
137+
<sDEF>
138+
<ROOT>
139+
<sheetTitle>Sheet Title</sheetTitle>
140+
<type>array</type>
141+
<el>
142+
<int_field>
143+
<label>int field</label>
144+
<config>
145+
<type>number</type>
146+
</config>
147+
</int_field>
148+
<double2_field>
149+
<label>double2 field</label>
150+
<config>
151+
<type>number</type>
152+
<format>decimal</format>
153+
</config>
154+
</double2_field>
155+
</el>
156+
</ROOT>
157+
</sDEF>
158+
</sheets>
159+
</T3DataStructure>
136160
CODE_SAMPLE
137161
)]);
138162
}

packages/typo3-fractor/rules/TYPO3v12/FlexForm/MigrateInternalTypeFolderToTypeFolderFlexFormFractor.php

+31-25
Original file line numberDiff line numberDiff line change
@@ -63,36 +63,42 @@ public function getRuleDefinition(): RuleDefinition
6363
return new RuleDefinition('Migrates TCA internal_type into new new TCA type folder', [new CodeSample(
6464
<<<'CODE_SAMPLE'
6565
<T3DataStructure>
66-
<ROOT>
67-
<sheetTitle>aTitle</sheetTitle>
68-
<type>array</type>
69-
<el>
70-
<aFlexField>
71-
<label>aFlexFieldLabel</label>
72-
<config>
73-
<type>group</type>
74-
<internal_type>folder</internal_type>
75-
</config>
76-
</aFlexField>
77-
</el>
78-
</ROOT>
66+
<sheets>
67+
<sDEF>
68+
<ROOT>
69+
<sheetTitle>Sheet Title</sheetTitle>
70+
<type>array</type>
71+
<el>
72+
<aColumn>
73+
<config>
74+
<type>group</type>
75+
<internal_type>folder</internal_type>
76+
</config>
77+
</aColumn>
78+
</el>
79+
</ROOT>
80+
</sDEF>
81+
</sheets>
7982
</T3DataStructure>
8083
CODE_SAMPLE
8184
,
8285
<<<'CODE_SAMPLE'
8386
<T3DataStructure>
84-
<ROOT>
85-
<sheetTitle>aTitle</sheetTitle>
86-
<type>array</type>
87-
<el>
88-
<aFlexField>
89-
<label>aFlexFieldLabel</label>
90-
<config>
91-
<type>folder</type>
92-
</config>
93-
</aFlexField>
94-
</el>
95-
</ROOT>
87+
<sheets>
88+
<sDEF>
89+
<ROOT>
90+
<sheetTitle>Sheet Title</sheetTitle>
91+
<type>array</type>
92+
<el>
93+
<aColumn>
94+
<config>
95+
<type>folder</type>
96+
</config>
97+
</aColumn>
98+
</el>
99+
</ROOT>
100+
</sDEF>
101+
</sheets>
96102
</T3DataStructure>
97103
CODE_SAMPLE
98104
)]);

packages/typo3-fractor/rules/TYPO3v12/FlexForm/MigrateNullFlagFlexFormFractor.php

+30-24
Original file line numberDiff line numberDiff line change
@@ -93,35 +93,41 @@ public function getRuleDefinition(): RuleDefinition
9393
return new RuleDefinition('Migrate null flag', [new CodeSample(
9494
<<<'CODE_SAMPLE'
9595
<T3DataStructure>
96-
<ROOT>
97-
<sheetTitle>aTitle</sheetTitle>
98-
<type>array</type>
99-
<el>
100-
<aFlexField>
101-
<label>aFlexFieldLabel</label>
102-
<config>
103-
<eval>null</eval>
104-
</config>
105-
</aFlexField>
106-
</el>
107-
</ROOT>
96+
<sheets>
97+
<sDEF>
98+
<ROOT>
99+
<sheetTitle>Sheet Title</sheetTitle>
100+
<type>array</type>
101+
<el>
102+
<aFlexField>
103+
<config>
104+
<eval>null</eval>
105+
</config>
106+
</aFlexField>
107+
</el>
108+
</ROOT>
109+
</sDEF>
110+
</sheets>
108111
</T3DataStructure>
109112
CODE_SAMPLE
110113
,
111114
<<<'CODE_SAMPLE'
112115
<T3DataStructure>
113-
<ROOT>
114-
<sheetTitle>aTitle</sheetTitle>
115-
<type>array</type>
116-
<el>
117-
<aFlexField>
118-
<label>aFlexFieldLabel</label>
119-
<config>
120-
<nullable>true</nullable>
121-
</config>
122-
</aFlexField>
123-
</el>
124-
</ROOT>
116+
<sheets>
117+
<sDEF>
118+
<ROOT>
119+
<sheetTitle>Sheet Title</sheetTitle>
120+
<type>array</type>
121+
<el>
122+
<aFlexField>
123+
<config>
124+
<nullable>true</nullable>
125+
</config>
126+
</aFlexField>
127+
</el>
128+
</ROOT>
129+
</sDEF>
130+
</sheets>
125131
</T3DataStructure>
126132
CODE_SAMPLE
127133
)]);

packages/typo3-fractor/rules/TYPO3v12/FlexForm/MigratePasswordAndSaltedPasswordToPasswordTypeFlexFormFractor.php

+43-39
Original file line numberDiff line numberDiff line change
@@ -104,50 +104,54 @@ public function getRuleDefinition(): RuleDefinition
104104
return new RuleDefinition('Migrate password and salted password to password type', [new CodeSample(
105105
<<<'CODE_SAMPLE'
106106
<T3DataStructure>
107-
<ROOT>
108-
<sheetTitle>aTitle</sheetTitle>
109-
<type>array</type>
110-
<el>
111-
<password_field>
112-
<label>Password</label>
113-
<config>
114-
<type>input</type>
115-
<eval>trim,password,saltedPassword</eval>
116-
</config>
117-
</password_field>
118-
<another_password_field>
119-
<label>Password</label>
120-
<config>
121-
<type>input</type>
122-
<eval>trim,password</eval>
123-
</config>
124-
</another_password_field>
125-
</el>
126-
</ROOT>
107+
<sheets>
108+
<sDEF>
109+
<ROOT>
110+
<sheetTitle>Sheet Title</sheetTitle>
111+
<type>array</type>
112+
<el>
113+
<password_field>
114+
<config>
115+
<type>input</type>
116+
<eval>trim,password,saltedPassword</eval>
117+
</config>
118+
</password_field>
119+
<another_password_field>
120+
<config>
121+
<type>input</type>
122+
<eval>trim,password</eval>
123+
</config>
124+
</another_password_field>
125+
</el>
126+
</ROOT>
127+
</sDEF>
128+
</sheets>
127129
</T3DataStructure>
128130
CODE_SAMPLE
129131
,
130132
<<<'CODE_SAMPLE'
131133
<T3DataStructure>
132-
<ROOT>
133-
<sheetTitle>aTitle</sheetTitle>
134-
<type>array</type>
135-
<el>
136-
<password_field>
137-
<label>Password</label>
138-
<config>
139-
<type>password</type>
140-
</config>
141-
</password_field>
142-
<another_password_field>
143-
<label>Password</label>
144-
<config>
145-
<type>password</type>
146-
<hashed>false</hashed>
147-
</config>
148-
</another_password_field>
149-
</el>
150-
</ROOT>
134+
<sheets>
135+
<sDEF>
136+
<ROOT>
137+
<sheetTitle>Sheet Title</sheetTitle>
138+
<type>array</type>
139+
<el>
140+
<password_field>
141+
<config>
142+
<type>password</type>
143+
</config>
144+
</password_field>
145+
<another_password_field>
146+
<config>
147+
<type>password</type>
148+
<hashed>false</hashed>
149+
</config>
150+
</another_password_field>
151+
</el>
152+
</ROOT>
153+
</sDEF>
154+
</sheets>
151155
</T3DataStructure>
152156
CODE_SAMPLE
153157
)]);

0 commit comments

Comments
 (0)