‪TYPO3CMS  10.4
AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
25 {
26  const ‪VALUE_PageId = 89;
37 
38  const ‪TABLE_Page = 'pages';
39  const ‪TABLE_Content = 'tt_content';
40  const ‪TABLE_Hotel = 'tx_irretutorial_1nff_hotel';
41  const ‪TABLE_Offer = 'tx_irretutorial_1nff_offer';
42  const ‪TABLE_Price = 'tx_irretutorial_1nff_price';
43 
44  const ‪FIELD_PageHotel = 'tx_irretutorial_hotels';
45  const ‪FIELD_ContentHotel = 'tx_irretutorial_1nff_hotels';
46  const ‪FIELD_HotelOffer = 'offers';
47  const ‪FIELD_OfferPrice = 'prices';
48 
52  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/DataSet/';
53 
54  protected function ‪setUp(): void
55  {
56  parent::setUp();
57  $this->‪importScenarioDataSet('LiveDefaultPages');
58  $this->‪importScenarioDataSet('LiveDefaultElements');
59 
60  $this->‪setUpFrontendSite(1, $this->siteLanguageConfiguration);
61  $this->setUpFrontendRootPage(
62  1,
63  [
64  'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
65  'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.typoscript',
66  ]
67  );
68  }
69 
77  public function ‪createParentContent()
78  {
79  $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Testing #1']);
80  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
81  }
82 
83  public function ‪modifyParentContent()
84  {
85  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, ['header' => 'Testing #1']);
86  }
87 
88  public function ‪deleteParentContent()
89  {
90  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
91  }
92 
93  public function ‪copyParentContent()
94  {
95  $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
96  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
97  }
98 
99  public function ‪copyParentContentToDifferentPage()
100  {
101  $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
102  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
103  }
104 
109  {
110  ‪$GLOBALS['TCA'][‪self::TABLE_Content]['columns'][‪self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
111  ‪$GLOBALS['TCA'][‪self::TABLE_Hotel]['columns'][‪self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
112  ‪$GLOBALS['TCA'][‪self::TABLE_Offer]['columns'][‪self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
113  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
114  $this->recordIds['localizedContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
115  }
116 
121  {
122  ‪$GLOBALS['TCA'][‪self::TABLE_Content]['columns'][‪self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
123  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
124  $this->recordIds['localizedContentIdFirst'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
125  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['localizedContentIdFirst'], self::VALUE_LanguageIdSecond);
126  $this->recordIds['localizedContentIdSecond'] = $newTableIds[‪self::TABLE_Content][$this->recordIds['localizedContentIdFirst']];
127  $this->actionService->modifyRecord(
128  self::TABLE_Content,
129  $this->recordIds['localizedContentIdSecond'],
130  ['l10n_state' => [self::FIELD_ContentHotel => 'source']]
131  );
132  $this->actionService->modifyRecords(
133  self::VALUE_PageId,
134  [
135  self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
136  self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
137  ]
138  );
139  }
140 
145  {
146  $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
147  $this->recordIds['localizedContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
148  }
149 
151  {
152  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
153  $this->recordIds['localizedContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
154  }
155 
160  {
161  ‪$GLOBALS['TCA'][‪self::TABLE_Content]['columns'][‪self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
162  ‪$GLOBALS['TCA'][‪self::TABLE_Hotel]['columns'][‪self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
163  ‪$GLOBALS['TCA'][‪self::TABLE_Offer]['columns'][‪self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
164 
165  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
166  $this->recordIds['localizedContentIdFirst'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
167 
168  $newHotelId = ‪StringUtility::getUniqueId('NEW');
169  $newOfferId = ‪StringUtility::getUniqueId('NEW');
170  $newPriceId = ‪StringUtility::getUniqueId('NEW');
171  $dataMap = [
172  self::TABLE_Content => [
173  self::VALUE_ContentIdLast => [self::FIELD_ContentHotel => '5,' . $newHotelId],
174  ],
175  self::TABLE_Hotel => [
176  $newHotelId => ['pid' => ‪self::VALUE_PageId, 'title' => 'New Hotel #1', 'offers' => $newOfferId],
177  ],
178  self::TABLE_Offer => [
179  $newOfferId => ['pid' => ‪self::VALUE_PageId, 'title' => 'New Offer #1.1', 'prices' => $newPriceId],
180  ],
181  self::TABLE_Price => [
182  $newPriceId => ['pid' => ‪self::VALUE_PageId, 'title' => 'New Price #1.1.1'],
183  ],
184  ];
185  $this->actionService->invoke($dataMap, []);
186  $this->recordIds['newHoteId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newHotelId];
187  $this->recordIds['newOfferId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newOfferId];
188  $this->recordIds['newPriceId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newPriceId];
189  }
190 
195  {
196  ‪$GLOBALS['TCA'][‪self::TABLE_Content]['columns'][‪self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
197  ‪$GLOBALS['TCA'][‪self::TABLE_Hotel]['columns'][‪self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
198  ‪$GLOBALS['TCA'][‪self::TABLE_Offer]['columns'][‪self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
199  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
200  $this->recordIds['localizedContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
201  // modify IRRE relation value of localized record (which should be sanitized and filtered)
202  $this->actionService->modifyRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], [self::FIELD_ContentHotel => '0']);
203  }
204 
209  {
210  // disable language synchronization
211  ‪$GLOBALS['TCA'][‪self::TABLE_Content]['columns'][‪self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = false;
212  ‪$GLOBALS['TCA'][‪self::TABLE_Hotel]['columns'][‪self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = false;
213  ‪$GLOBALS['TCA'][‪self::TABLE_Offer]['columns'][‪self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = false;
214  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
215  $this->recordIds['localizedContentId'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
216  $this->recordIds['localizedHotelId'] = $newTableIds[‪self::TABLE_Hotel][‪self::VALUE_HotelIdThird];
217  $this->recordIds['localizedOfferId'] = $newTableIds[‪self::TABLE_Offer][‪self::VALUE_OfferIdLast];
218  // now enable language synchronization
219  ‪$GLOBALS['TCA'][‪self::TABLE_Content]['columns'][‪self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
220  ‪$GLOBALS['TCA'][‪self::TABLE_Hotel]['columns'][‪self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
221  ‪$GLOBALS['TCA'][‪self::TABLE_Offer]['columns'][‪self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
222  // modify IRRE relation values of localized records (which should be sanitized and filtered)
223  $this->actionService->modifyRecords(
224  self::VALUE_PageId,
225  [
226  self::TABLE_Content => ['uid' => $this->recordIds['localizedContentId'], self::FIELD_ContentHotel => '0'],
227  self::TABLE_Hotel => ['uid' => $this->recordIds['localizedHotelId'], self::FIELD_ContentHotel => '0'],
228  self::TABLE_Offer => ['uid' => $this->recordIds['localizedOfferId'], self::FIELD_ContentHotel => '0'],
229  ]
230  );
231  }
232 
233  public function ‪changeParentContentSorting()
234  {
235  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
236  }
237 
238  public function ‪moveParentContentToDifferentPage()
239  {
240  $newRecordIds = $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
241  $this->recordIds['newContentId'] = $newRecordIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
242  }
243 
245  {
246  $newRecordIds = $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
247  $this->recordIds['newContentId'] = $newRecordIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
248  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdWebsite);
249  }
250 
252  {
253  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
254  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdLast);
255  }
256 
264  public function ‪modifyPage()
265  {
266  $this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);
267  }
268 
269  public function ‪deletePage()
270  {
271  $this->actionService->deleteRecord(self::TABLE_Page, self::VALUE_PageId);
272  }
273 
274  public function ‪copyPage()
275  {
276  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
277  $this->recordIds['newPageId'] = $newTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
278  $this->recordIds['newContentIdFirst'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdFirst];
279  $this->recordIds['newContentIdLast'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
280  }
281 
283  {
284  // Ensure hotels get processed first
285  ‪$GLOBALS['TCA'] = array_merge(
286  [self::TABLE_Hotel => ‪$GLOBALS['TCA'][self::TABLE_Hotel]],
287  ‪$GLOBALS['TCA']
288  );
289 
290  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
291  $this->recordIds['newPageId'] = $newTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
292  $this->recordIds['newContentIdFirst'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdFirst];
293  $this->recordIds['newContentIdLast'] = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
294  }
295 
304  {
305  $newTableIds = $this->actionService->createNewRecords(
306  self::VALUE_PageId,
307  [
308  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
309  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
310  self::TABLE_Offer => ['title' => 'Offer #1'],
311  ]
312  );
313  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
314  }
315 
317  {
318  $newTableIds = $this->actionService->createNewRecords(
319  self::VALUE_PageId,
320  [
321  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
322  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
323  self::TABLE_Offer => ['title' => 'Offer #1'],
324  ]
325  );
326  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
327  $this->recordIds['newHotelId'] = $newTableIds[‪self::TABLE_Hotel][0];
328  $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_PageId);
329  $this->recordIds['copiedContentId'] = $copiedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
330  $this->recordIds['copiedHotelId'] = $copiedTableIds[‪self::TABLE_Hotel][$this->recordIds['newHotelId']];
331  }
332 
334  {
335  $newTableIds = $this->actionService->createNewRecords(
336  self::VALUE_PageId,
337  [
338  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
339  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
340  self::TABLE_Offer => ['title' => 'Offer #1'],
341  ]
342  );
343  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
344  $this->recordIds['newHotelId'] = $newTableIds[‪self::TABLE_Hotel][0];
345  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
346  $this->recordIds['localizedContentId'] = $localizedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
347  }
348 
350  {
351  unset(‪$GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['sortby']);
352  $newTableIds = $this->actionService->createNewRecords(
353  self::VALUE_PageId,
354  [
355  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
356  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
357  self::TABLE_Offer => ['title' => 'Offer #1'],
358  ]
359  );
360  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
361  $this->recordIds['newHotelId'] = $newTableIds[‪self::TABLE_Hotel][0];
362  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
363  $this->recordIds['localizedContentId'] = $localizedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
364  }
365 
366  public function ‪modifyOnlyHotelChild()
367  {
368  $this->actionService->modifyRecord(self::TABLE_Hotel, 4, ['title' => 'Testing #1']);
369  }
370 
372  {
373  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, [self::FIELD_ContentHotel => '4,3']);
374  }
375 
376  public function ‪modifyParentWithHotelChild()
377  {
378  $this->actionService->modifyRecords(
379  self::VALUE_PageId,
380  [
381  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel => '3,4'],
382  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
383  ]
384  );
385  }
386 
387  public function ‪modifyParentAndAddHotelChild()
388  {
389  $this->actionService->modifyRecords(
390  self::VALUE_PageId,
391  [
392  self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
393  self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
394  ]
395  );
396  }
397 
398  public function ‪modifyParentAndDeleteHotelChild()
399  {
400  $this->actionService->modifyRecord(
401  self::TABLE_Content,
402  self::VALUE_ContentIdFirst,
403  [self::FIELD_ContentHotel => '3'],
404  [self::TABLE_Hotel => [4]]
405  );
406  }
407 
409  {
410  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
411  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
412  $this->recordIds['localizedPageId'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
413  }
414 
416  {
417  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
418  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
419  $this->recordIds['localizedPageIdFirst'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
420  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
421  $this->recordIds['localizedPageIdSecond'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
422  }
423 
425  {
426  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
427  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
428  $this->recordIds['localizedPageId'] = $localizedTableIds[‪self::TABLE_Page][‪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 
439  {
440  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['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  }
444 
446  {
447  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
448  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
449  $this->recordIds['localizedPageId'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
450  $this->actionService->modifyRecords(
451  self::VALUE_PageId,
452  [
453  self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
454  self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
455  ]
456  );
457  }
458 
460  {
461  unset(‪$GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['languageField']);
462  unset(‪$GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['transOrigPointerField']);
463  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
464  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
465  $this->recordIds['localizedPageId'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
466  $this->actionService->modifyRecords(
467  self::VALUE_PageId,
468  [
469  self::TABLE_Page => ['uid' => self::VALUE_PageId, self::FIELD_PageHotel => '2,__nextUid'],
470  self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #007'],
471  ]
472  );
473  }
474 
476  {
477  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
478  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
479  $this->recordIds['localizedPageId'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
480  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
481  $this->recordIds['newPageId'] = $newTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
482  }
483 
485  {
486  ‪$GLOBALS['TCA'][‪self::TABLE_Page]['columns'][‪self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
487  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
488  $this->recordIds['localizedPageId'] = $localizedTableIds[‪self::TABLE_Page][‪self::VALUE_PageId];
489  // Using "localized page ID" on purpose because BE editing uses a "page" record and data handler
490  $this->actionService->modifyRecords(
491  $this->recordIds['localizedPageId'],
492  [
493  self::TABLE_Page => ['uid' => $this->recordIds['localizedPageId'], self::FIELD_PageHotel => '6,__nextUid', 'l10n_state' => [self::FIELD_PageHotel => 'custom']],
494  self::TABLE_Hotel => ['uid' => '__NEW', 'sys_language_uid' => self::VALUE_LanguageId, 'title' => 'Hotel in dansk page only'],
495  ]
496  );
497  }
498 
499  public function ‪inlineLocalizeSynchronizeLocalizeMissing(): void
500  {
501  // Translate page 89 first
502  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
503  // Localize CE 297 which has two hotels, those are localized, too.
504  $newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, self::VALUE_LanguageId);
505  $this->recordIds['localizedContentId'] = $newTableIds['tt_content'][‪self::VALUE_ContentIdFirst];
506  $this->recordIds['localizedHotelId'] = $newTableIds['tx_irretutorial_1nff_hotel'][‪self::VALUE_HotelIdFirst];
507  // Delete one localized hotel (and its children) again.
508  // We end up with having one localized hotel child and a missing one, while both exist in default language.
509  $this->actionService->deleteRecord('tx_irretutorial_1nff_hotel', $this->recordIds['localizedHotelId']);
510  // Now inlineLocalizeSynchronize->localize - This is the 'localize all records' button when inline
511  // 'appearance' 'showAllLocalizationLink' has been enabled. It should re-localize the missing hotel again.
512  $this->actionService->invoke(
513  [],
514  [
515  'tt_content' => [
516  $this->recordIds['localizedContentId'] => [
517  'inlineLocalizeSynchronize' => [
518  'field' => 'tx_irretutorial_1nff_hotels',
519  'language' => 1,
520  'action' => 'localize',
521  ],
522  ],
523  ],
524  ]
525  );
526  }
527 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\copyPageWithHotelBeforeParentContent
‪copyPageWithHotelBeforeParentContent()
Definition: AbstractActionTestCase.php:281
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeParentContentWithLanguageSynchronization
‪localizeParentContentWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:107
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\TABLE_Hotel
‪const TABLE_Hotel
Definition: AbstractActionTestCase.php:40
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\inlineLocalizeSynchronizeLocalizeMissing
‪inlineLocalizeSynchronizeLocalizeMissing()
Definition: AbstractActionTestCase.php:498
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\TABLE_Offer
‪const TABLE_Offer
Definition: AbstractActionTestCase.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_OfferIdLast
‪const VALUE_OfferIdLast
Definition: AbstractActionTestCase.php:34
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\setUp
‪setUp()
Definition: AbstractActionTestCase.php:53
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\TABLE_Content
‪const TABLE_Content
Definition: AbstractActionTestCase.php:39
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\moveParentContentToDifferentPageAndChangeSorting
‪moveParentContentToDifferentPageAndChangeSorting()
Definition: AbstractActionTestCase.php:250
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setUpFrontendSite
‪setUpFrontendSite(int $pageId, array $additionalLanguages=[])
Definition: AbstractDataHandlerActionTestCase.php:143
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration
‪createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
Definition: AbstractActionTestCase.php:348
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\copyParentContentToLanguageWithAllChildren
‪copyParentContentToLanguageWithAllChildren()
Definition: AbstractActionTestCase.php:143
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\FIELD_HotelOffer
‪const FIELD_HotelOffer
Definition: AbstractActionTestCase.php:46
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_LanguageIdSecond
‪const VALUE_LanguageIdSecond
Definition: AbstractActionTestCase.php:36
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\TABLE_Price
‪const TABLE_Price
Definition: AbstractActionTestCase.php:42
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeParentContentAndSetInvalidChildReferenceWithLanguageSynchronization
‪localizeParentContentAndSetInvalidChildReferenceWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:193
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentWithHotelChild
‪modifyParentWithHotelChild()
Definition: AbstractActionTestCase.php:375
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\FIELD_OfferPrice
‪const FIELD_OfferPrice
Definition: AbstractActionTestCase.php:47
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_PageIdWebsite
‪const VALUE_PageIdWebsite
Definition: AbstractActionTestCase.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeParentContentWithAllChildren
‪localizeParentContentWithAllChildren()
Definition: AbstractActionTestCase.php:149
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\deletePage
‪deletePage()
Definition: AbstractActionTestCase.php:268
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageTwiceWithLocalizationExclude
‪localizePageTwiceWithLocalizationExclude()
Definition: AbstractActionTestCase.php:414
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\FIELD_PageHotel
‪const FIELD_PageHotel
Definition: AbstractActionTestCase.php:44
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\changeParentContentSorting
‪changeParentContentSorting()
Definition: AbstractActionTestCase.php:232
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeParentContentChainLanguageSynchronizationSource
‪localizeParentContentChainLanguageSynchronizationSource()
Definition: AbstractActionTestCase.php:119
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentAndDeleteHotelChild
‪modifyParentAndDeleteHotelChild()
Definition: AbstractActionTestCase.php:397
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\FIELD_ContentHotel
‪const FIELD_ContentHotel
Definition: AbstractActionTestCase.php:45
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentContent
‪modifyParentContent()
Definition: AbstractActionTestCase.php:82
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\copyParentContent
‪copyParentContent()
Definition: AbstractActionTestCase.php:92
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\TABLE_Page
‪const TABLE_Page
Definition: AbstractActionTestCase.php:38
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageAndAddHotelChildWithLanguageSynchronization
‪localizePageAndAddHotelChildWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:444
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createAndCopyParentContentWithHotelAndOfferChildren
‪createAndCopyParentContentWithHotelAndOfferChildren()
Definition: AbstractActionTestCase.php:315
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\deleteParentContent
‪deleteParentContent()
Definition: AbstractActionTestCase.php:87
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentAndAddHotelChild
‪modifyParentAndAddHotelChild()
Definition: AbstractActionTestCase.php:386
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:37
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\moveParentContentToDifferentPage
‪moveParentContentToDifferentPage()
Definition: AbstractActionTestCase.php:237
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\moveParentContentToDifferentPageTwice
‪moveParentContentToDifferentPageTwice()
Definition: AbstractActionTestCase.php:243
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeAndCopyPageWithLanguageSynchronization
‪localizeAndCopyPageWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:474
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageWithLanguageSynchronization
‪localizePageWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:437
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\copyPage
‪copyPage()
Definition: AbstractActionTestCase.php:273
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField
Definition: AbstractActionTestCase.php:16
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_ContentIdLast
‪const VALUE_ContentIdLast
Definition: AbstractActionTestCase.php:30
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_PageId
‪const VALUE_PageId
Definition: AbstractActionTestCase.php:26
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageAndAddMonoglotHotelChildWithLanguageSynchronization
‪localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:458
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization
‪localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization()
Definition: AbstractActionTestCase.php:158
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageWithLocalizationExclude
‪localizePageWithLocalizationExclude()
Definition: AbstractActionTestCase.php:407
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizeParentContentAndSetInvalidChildReferenceWithLateLanguageSynchronization
‪localizeParentContentAndSetInvalidChildReferenceWithLateLanguageSynchronization()
Definition: AbstractActionTestCase.php:207
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyOnlyHotelChild
‪modifyOnlyHotelChild()
Definition: AbstractActionTestCase.php:365
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentAndChangeHotelChildrenSorting
‪modifyParentAndChangeHotelChildrenSorting()
Definition: AbstractActionTestCase.php:370
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_HotelIdSecond
‪const VALUE_HotelIdSecond
Definition: AbstractActionTestCase.php:32
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:92
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\copyParentContentToDifferentPage
‪copyParentContentToDifferentPage()
Definition: AbstractActionTestCase.php:98
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_HotelIdFirst
‪const VALUE_HotelIdFirst
Definition: AbstractActionTestCase.php:31
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyPage
‪modifyPage()
Definition: AbstractActionTestCase.php:263
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase
Definition: AbstractActionTestCase.php:25
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createParentContent
‪createParentContent()
Definition: AbstractActionTestCase.php:76
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_PageIdTarget
‪const VALUE_PageIdTarget
Definition: AbstractActionTestCase.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: AbstractActionTestCase.php:51
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createAndLocalizeParentContentWithHotelAndOfferChildren
‪createAndLocalizeParentContentWithHotelAndOfferChildren()
Definition: AbstractActionTestCase.php:332
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_LanguageId
‪const VALUE_LanguageId
Definition: AbstractActionTestCase.php:35
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_ContentIdFirst
‪const VALUE_ContentIdFirst
Definition: AbstractActionTestCase.php:29
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_HotelIdThird
‪const VALUE_HotelIdThird
Definition: AbstractActionTestCase.php:33
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:201
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageWithSynchronizationAndCustomLocalizedHotel
‪localizePageWithSynchronizationAndCustomLocalizedHotel()
Definition: AbstractActionTestCase.php:483
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\localizePageAndAddHotelChildWithLocalizationExclude
‪localizePageAndAddHotelChildWithLocalizationExclude()
Definition: AbstractActionTestCase.php:423
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createParentContentWithHotelAndOfferChildren
‪createParentContentWithHotelAndOfferChildren()
Definition: AbstractActionTestCase.php:302