[!!!][TASK] IRRE: Always consider "localizeChildrenAtParentLocalization"
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / DataHandling / IRRE / ForeignField / AbstractActionTestCase.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Utility\StringUtility;
18
19 /**
20 * Functional test for the DataHandler
21 */
22 abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
23 {
24 const VALUE_PageId = 89;
25 const VALUE_PageIdTarget = 90;
26 const VALUE_PageIdWebsite = 1;
27 const VALUE_ContentIdFirst = 297;
28 const VALUE_ContentIdLast = 298;
29 const VALUE_HotelIdFirst = 3;
30 const VALUE_HotelIdSecond = 4;
31 const VALUE_HotelIdThird = 5;
32 const VALUE_LanguageId = 1;
33 const VALUE_LanguageIdSecond = 2;
34
35 const TABLE_Page = 'pages';
36 const TABLE_PageOverlay = 'pages_language_overlay';
37 const TABLE_Content = 'tt_content';
38 const TABLE_Hotel = 'tx_irretutorial_1nff_hotel';
39 const TABLE_Offer = 'tx_irretutorial_1nff_offer';
40 const TABLE_Price = 'tx_irretutorial_1nff_price';
41
42 const FIELD_PageHotel = 'tx_irretutorial_hotels';
43 const FIELD_ContentHotel = 'tx_irretutorial_1nff_hotels';
44 const FIELD_HotelOffer = 'offers';
45 const FIELD_OfferPrice = 'prices';
46
47 /**
48 * @var string
49 */
50 protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/DataSet/';
51
52 protected function setUp()
53 {
54 parent::setUp();
55 $this->importScenarioDataSet('LiveDefaultPages');
56 $this->importScenarioDataSet('LiveDefaultElements');
57
58 $this->setUpFrontendRootPage(
59 1,
60 [
61 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
62 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.ts',
63 ]
64 );
65 $this->backendUser->workspace = 0;
66 }
67
68 /**
69 * Parent content records
70 */
71
72 /**
73 * @see DataSet/createParentContentRecord.csv
74 */
75 public function createParentContent()
76 {
77 $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Testing #1']);
78 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
79 }
80
81 /**
82 * @see DataSet/modifyParentContentRecord.csv
83 */
84 public function modifyParentContent()
85 {
86 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, ['header' => 'Testing #1']);
87 }
88
89 /**
90 * @see DataSet/deleteParentContentRecord.csv
91 */
92 public function deleteParentContent()
93 {
94 $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
95 }
96
97 /**
98 * @see DataSet/copyParentContentRecord.csv
99 */
100 public function copyParentContent()
101 {
102 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
103 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
104 }
105
106 /**
107 * @see DataSet/copyParentContentToDifferentPage.csv
108 */
109 public function copyParentContentToDifferentPage()
110 {
111 $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
112 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
113 }
114
115 /**
116 * @see DataSet/localizeParentContentSynchronization.csv
117 */
118 public function localizeParentContentWithLanguageSynchronization()
119 {
120 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
121 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
122 $GLOBALS['TCA'][self::TABLE_Offer]['columns'][self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
123 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
124 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
125 }
126
127 /**
128 * @see DataSet/localizeParentContentWAllChildrenSelect.csv
129 */
130 public function localizeParentContentChainLanguageSynchronizationSource()
131 {
132 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
133 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
134 $this->recordIds['localizedContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
135 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['localizedContentIdFirst'], self::VALUE_LanguageIdSecond);
136 $this->recordIds['localizedContentIdSecond'] = $newTableIds[self::TABLE_Content][$this->recordIds['localizedContentIdFirst']];
137 $this->actionService->modifyRecord(
138 self::TABLE_Content,
139 $this->recordIds['localizedContentIdSecond'],
140 ['l10n_state' => [self::FIELD_ContentHotel => 'source']]
141 );
142 $this->actionService->modifyRecords(
143 self::VALUE_PageId,
144 [
145 self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
146 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
147 ]
148 );
149 }
150
151 /**
152 * @see DataSet/copyParentContentToLanguageWAllChildren.csv
153 */
154 public function copyParentContentToLanguageWithAllChildren()
155 {
156 $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
157 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
158 }
159
160 /**
161 * @see DataSet/localizeParentContentWAllChildren.csv
162 */
163 public function localizeParentContentWithAllChildren()
164 {
165 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
166 $this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
167 }
168
169 /**
170 * @see DataSet/Modify/localizeParentContentNCreateNestedChildrenWLanguageSynchronization.csv
171 */
172 public function localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization()
173 {
174 $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
175 $GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
176 $GLOBALS['TCA'][self::TABLE_Offer]['columns'][self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
177
178 $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
179 $this->recordIds['localizedContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
180
181 $newHotelId = StringUtility::getUniqueId('NEW');
182 $newOfferId = StringUtility::getUniqueId('NEW');
183 $newPriceId = StringUtility::getUniqueId('NEW');
184 $dataMap = [
185 self::TABLE_Content => [
186 self::VALUE_ContentIdLast => [self::FIELD_ContentHotel => '5,' . $newHotelId],
187 ],
188 self::TABLE_Hotel => [
189 $newHotelId => ['pid' => self::VALUE_PageId, 'title' => 'New Hotel #1', 'offers' => $newOfferId],
190 ],
191 self::TABLE_Offer => [
192 $newOfferId => ['pid' => self::VALUE_PageId, 'title' => 'New Offer #1.1', 'prices' => $newPriceId],
193 ],
194 self::TABLE_Price => [
195 $newPriceId => ['pid' => self::VALUE_PageId, 'title' => 'New Price #1.1.1'],
196 ],
197 ];
198 $this->actionService->invoke($dataMap, []);
199 $this->recordIds['newHoteId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newHotelId];
200 $this->recordIds['newOfferId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newOfferId];
201 $this->recordIds['newPriceId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newPriceId];
202 }
203
204 /**
205 * @see DataSet/changeParentContentRecordSorting.csv
206 */
207 public function changeParentContentSorting()
208 {
209 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
210 }
211
212 /**
213 * @see DataSet/moveParentContentRecordToDifferentPage.csv
214 */
215 public function moveParentContentToDifferentPage()
216 {
217 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
218 }
219
220 /**
221 * @see DataSet/moveParentContentRecordToDifferentPageAndChangeSorting.csv
222 */
223 public function moveParentContentToDifferentPageAndChangeSorting()
224 {
225 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
226 $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
227 }
228
229 /**
230 * Page records
231 */
232
233 /**
234 * @see DataSet/modifyPageRecord.csv
235 */
236 public function modifyPage()
237 {
238 $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);
239 }
240
241 /**
242 * @see DataSet/deletePageRecord.csv
243 */
244 public function deletePage()
245 {
246 $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
247 }
248
249 /**
250 * @see DataSet/copyPageRecord.csv
251 */
252 public function copyPage()
253 {
254 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
255 $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
256 $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
257 $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
258 }
259
260 /**
261 * @see DataSet/copyPageWHotelBeforeParentContent.csv
262 */
263 public function copyPageWithHotelBeforeParentContent()
264 {
265 // Ensure hotels get processed first
266 $GLOBALS['TCA'] = array_merge(
267 [self::TABLE_Hotel => $GLOBALS['TCA'][self::TABLE_Hotel]],
268 $GLOBALS['TCA']
269 );
270
271 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
272 $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
273 $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
274 $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
275 }
276
277 /**
278 * IRRE Child Records
279 */
280
281 /**
282 * @see DataSet/createParentContentRecordWithHotelAndOfferChildRecords.csv
283 */
284 public function createParentContentWithHotelAndOfferChildren()
285 {
286 $newTableIds = $this->actionService->createNewRecords(
287 self::VALUE_PageId,
288 [
289 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
290 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
291 self::TABLE_Offer => ['title' => 'Offer #1'],
292 ]
293 );
294 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
295 }
296
297 /**
298 * @see DataSet/createAndCopyParentContentRecordWithHotelAndOfferChildRecords.csv
299 */
300 public function createAndCopyParentContentWithHotelAndOfferChildren()
301 {
302 $newTableIds = $this->actionService->createNewRecords(
303 self::VALUE_PageId,
304 [
305 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
306 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
307 self::TABLE_Offer => ['title' => 'Offer #1'],
308 ]
309 );
310 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
311 $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
312 $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_PageId);
313 $this->recordIds['copiedContentId'] = $copiedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
314 $this->recordIds['copiedHotelId'] = $copiedTableIds[self::TABLE_Hotel][$this->recordIds['newHotelId']];
315 }
316
317 /**
318 * @see DataSet/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
319 */
320 public function createAndLocalizeParentContentWithHotelAndOfferChildren()
321 {
322 $newTableIds = $this->actionService->createNewRecords(
323 self::VALUE_PageId,
324 [
325 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
326 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
327 self::TABLE_Offer => ['title' => 'Offer #1'],
328 ]
329 );
330 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
331 $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
332 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
333 $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
334 }
335
336 /**
337 * @see DataSet/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
338 */
339 public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
340 {
341 unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['sortby']);
342 $newTableIds = $this->actionService->createNewRecords(
343 self::VALUE_PageId,
344 [
345 self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
346 self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
347 self::TABLE_Offer => ['title' => 'Offer #1'],
348 ]
349 );
350 $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
351 $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
352 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
353 $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
354 }
355
356 /**
357 * @see DataSet/modifyOnlyHotelChildRecord.csv
358 */
359 public function modifyOnlyHotelChild()
360 {
361 $this->actionService->modifyRecord(self::TABLE_Hotel, 4, ['title' => 'Testing #1']);
362 }
363
364 /**
365 * @see DataSet/modifyParentRecordAndChangeHotelChildRecordsSorting.csv
366 */
367 public function modifyParentAndChangeHotelChildrenSorting()
368 {
369 $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, [self::FIELD_ContentHotel => '4,3']);
370 }
371
372 /**
373 * @see DataSet/modifyParentRecordWithHotelChildRecord.csv
374 */
375 public function modifyParentWithHotelChild()
376 {
377 $this->actionService->modifyRecords(
378 self::VALUE_PageId,
379 [
380 self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel => '3,4'],
381 self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
382 ]
383 );
384 }
385
386 /**
387 * @see DataSet/modifyParentRecordAndAddHotelChildRecord.csv
388 */
389 public function modifyParentAndAddHotelChild()
390 {
391 $this->actionService->modifyRecords(
392 self::VALUE_PageId,
393 [
394 self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
395 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
396 ]
397 );
398 }
399
400 /**
401 * @see DataSet/modifyParentRecordAndDeleteHotelChildRecord.csv
402 */
403 public function modifyParentAndDeleteHotelChild()
404 {
405 $this->actionService->modifyRecord(
406 self::TABLE_Content,
407 self::VALUE_ContentIdFirst,
408 [self::FIELD_ContentHotel => '3'],
409 [self::TABLE_Hotel => [4]]
410 );
411 }
412
413 public function localizePageWithLocalizationExclude()
414 {
415 $GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
416 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
417 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
418 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
419 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
420 }
421
422 public function localizePageAndAddHotelChildWithLocalizationExclude()
423 {
424 $GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
425 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
426 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
427 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
428 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
429 $this->actionService->modifyRecords(
430 self::VALUE_PageId,
431 [
432 self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
433 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
434 ]
435 );
436 }
437
438 public function localizePageWithLanguageSynchronization()
439 {
440 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
441 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
442 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
443 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
444 }
445
446 public function localizePageAndAddHotelChildWithLanguageSynchronization()
447 {
448 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
449 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
450 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
451 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
452 $this->actionService->modifyRecords(
453 self::VALUE_PageId,
454 [
455 self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
456 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
457 ]
458 );
459 }
460
461 public function localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
462 {
463 unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['languageField']);
464 unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['transOrigPointerField']);
465 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
466 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
467 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
468 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
469 $this->actionService->modifyRecords(
470 self::VALUE_PageId,
471 [
472 self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
473 self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
474 ]
475 );
476 }
477
478 public function localizeAndCopyPageWithLanguageSynchronization()
479 {
480 $GLOBALS['TCA'][self::TABLE_PageOverlay]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
481 $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
482 $this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
483 $this->recordIds['localizedPageOverlayId'] = $localizedTableIds[self::TABLE_PageOverlay][self::VALUE_PageId];
484 $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
485 $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
486 }
487 }