Issue Bug Closed

#82880Synchronize inline records triggers maxItemsError

Nicole Hummel 10/29/17, 14:01 updated 11/06/26, 10:57

Description

How to reproduce:

1. Install attached extension.
2. Add new page.
3. Insert “Container” record on the created page.
3.1 Add two content records to “Container” field.
4. Translate the page to another language.
5. Translate the content element with “Translate” mode.
6. Open the container element in default language and attach a third inline content element.
7. Open the translated container element. You will see the third inline content element without translation.
8. Synchronize translated records with “Synchronize with original language”

Expected result:

I see three translated content records.

Actual result:

I see only two content elements afterwards. An error “A maximum of 3 child records are allowed.” is triggered. Reloading the page however shows the expected records.

Guess:

I think the error is triggered before the untranslated record is removed. Thus the JavaScript prevents add the new (translated) content record. It seems the PHP-part of the localization works without errors.

Reviews 1

Files 1

History 1012

  1. Andreas Wolf commented and changed status New Accepted <span data-processor="relativetime" data-value="2017-10-31T23:04:08+00:00" > 10/31/17, 23:04 </span>

    After investigation, I found out that this is indeed a pure JS issue:

    • memorizeAddRecord() adds the new element’s ID to the hidden field value, after which isBelowMax() will return false => this is required to remove the control buttons above/below the record list
    • domAddNewRecord() is called afterwards, to add the record to the list. Unfortunately, this also uses isBelowMax() to check if the limits have been exceeded. This fails because the hidden field value was extended in the previous call

    Unlike I initially suspected, this is in no way related to the placeholder, as far as I can see.

    IMO, the best fix for this would be to change isBelowMax and the code that writes to the hidden field to use the actually present records, as these are the source of truth in this case. This would require us to add the record UIDs to the rendered record HTML, but that is really simple, and change the code accordingly. I’m unsure if this would have any additional impact.

  2. Gerrit Code Review pushed patch set 2 for master to change 54521 status Accepted Under Review <span data-processor="relativetime" data-value="2017-11-02T11:22:49+00:00" > 11/02/17, 11:22 </span>

  3. Susanne Moog commented and changed status Under Review New <span data-processor="relativetime" data-value="2019-03-01T20:06:38+00:00" > 03/01/19, 20:06 </span>

    Patch has been abandoned.

  4. Steffen G/G commented <span data-processor="relativetime" data-value="2019-10-24T17:35:32+00:00" > 10/24/19, 17:35 </span>

    Its kind of wrong question. isBelowMax tests recordCount >= this.data.config[objectPrefix].max.

    While configured in TCA maxItem are allowed.

    So lets ask if isNotAboveMax e.g.
    !(recordCount > this.data.config[objectPrefix].max)

  5. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-06T10:57:58+00:00" > 11/06/26, 10:57 </span>

    The client-side IRRE code was rewritten in TYPO3 v10.0 (#88182). The old domAddNewRecord(), which ran the max-items check again after the new uid had already been memorized, no longer exists. Synchronize/localize now adds the returned records first and memorizes them afterwards, so the false “A maximum of N child records are allowed.” notification can no longer appear. This was also confirmed on v13 in #80036. Closing, please open a new issue if this still happens on a supported version.