Review main Merged

68779[BUGFIX] Prematurely end data array processing on invalid item

Nikita Hovratov CR +2 V +2 Easy +21 −8 updated 08/12/22, 17:00

Commit message

In case the amount of items, shown in the workspace module,
does not exceed the pagination limit - default 30 - the items
array was previously filled with invalid items till the limit
was reached.

This is now fixed by a guard clause which prematurely ends the
processing (the corresponding loop) as soon as no more item
exists.

This guard clause is also implemented in the calculation of
the start value. Usually there shouldn't be any invalid items,
but as such behaviour can not always be ruled out, especially
on multi-user systems, it seems reasonable to add it here, too.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Jochen Roth +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Benni Mack +2
    • Jochen Roth +1
    • Nikita Hovratov +1
    • TYPO3com +1 CI
    • core-ci +1 CI

Issues 1

Files 1

Review log 1422

  1. Nikita Hovratov uploaded patch set 1 04/15/21, 17:26

  2. TYPO3com voted on patch set 1 V +1 04/15/21, 17:33 Completed build in 06m 55s on Thu, 15 Apr, 05:33 PM Test Summary: 33269 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10678

  3. core-ci voted on patch set 1 V +1 04/15/21, 17:37 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2267

  4. Oli Bartsch updated the commit message in patch set 2 04/15/21, 21:10

  5. Oli Bartsch commented on patch set 2 V -1 04/15/21, 21:14

    Hi thanks for your patch. This fixes the JavaScript bug but unfortunately breaks the pagination again. Will have a look at this tomorrow. For testing, just create around 15 content elements and some of them with inline relations, like text&media (with FAL). Set the limit to 5 (you can do this for testing directly in Build/Sources/TypeScript/workspaces/Resources/Public/TypeScript/Backend.ts). The pagination then contains 3 pages - correct - but page 3 is empty and page 2 only contains two items. <= The behaviour could differ for you as it depends on the amount of content elements with inline relations and the amount of inline relations per element.
  6. TYPO3com voted on patch set 2 V +1 04/15/21, 21:17 Completed build in 07m 28s on Thu, 15 Apr, 09:17 PM Test Summary: 33269 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10679

  7. core-ci voted on patch set 2 V +1 04/15/21, 21:22 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2268

  8. Nikita Hovratov uploaded patch set 3 04/16/21, 08:34

  9. Nikita Hovratov commented on patch set 3 04/16/21, 08:40

    Reply

    Hi, thanks for the feedback. You are right. I think my new patch now addresses the real issue: Because of the while loop waiting for parentRecordsCount to hit end, it might occur for the last pagination item that itemsCount is higher than the amount of items in dataArray. Thus the null values are added. A simple check and break statement should do the job.
  10. TYPO3com voted on patch set 3 V +1 04/16/21, 08:41 Completed build in 07m 22s on Fri, 16 Apr, 08:41 AM Test Summary: 33269 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10680

  11. Oli Bartsch uploaded patch set 4 04/16/21, 08:43

  12. Nikita Hovratov wrote 04/16/21, 08:43

    Description "Edit commit message" removed from patch set 2
  13. Oli Bartsch commented on patch set 4 04/16/21, 08:45

    Reply

    Yes, exactly. I pushed a new patchset, addressing this. Sorry for overwriting, didn't noticed that you pushed as well.
  14. core-ci voted on patch set 3 V +1 04/16/21, 08:49 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2275

  15. TYPO3com voted on patch set 4 V +1 04/16/21, 08:50 Completed build in 07m 05s on Fri, 16 Apr, 08:50 AM Test Summary: 33269 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10681

  16. core-ci voted on patch set 4 V +1 04/16/21, 08:59 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2276

  17. Nikita Hovratov commented on patch set 4 04/16/21, 09:02

    Reply

    It's ok, you can keep yours. But maybe adjust the explanation: If there aren't enough parent records in the last pagination item to fill (end - start) the while loop would go on until the parent count has reached end. And this could only happen because of the ?? check for the item. At least it's now double verified 😊
  18. Nikita Hovratov voted on patch set 4 V +1 CR +1 04/16/21, 09:09

  19. Jochen Roth voted on patch set 4 V +1 CR +1 04/16/21, 09:25

  20. Benni Mack voted on patch set 4 V +2 CR +2 04/16/21, 13:00

  21. Benni Mack merged patch set 5 04/16/21, 13:00

  22. Oliver Hader commented on patch set 5 08/12/22, 17:00

    → received report concerning regression, see https://forge.typo3.org/issues/98129