Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review Quiet

75020[FEATURE] Allow excluding tables from page copy

Rozbeh Chiryai Sharahi CR +1 V +1 Normal +206 −1 updated 09/30/26, 11:41

Commit message

When a page is copied, all records on it are copied too.
For some tables this is wrong. Copying a site root page
created duplicate redirects with the same source.

The new TCA option ctrl['copyWithPage'] excludes a table
from page copy. It defaults to true and is available as
TcaSchemaCapability::CopyWithPage. sys_redirect sets it
to false, so redirects are no longer copied with a page.

The option only skips records collected by their pid.
Inline and file children are still copied together with
their parent, the same way page copy already behaves for
tables a non-admin user is not allowed to modify.

Tables with ctrl['readOnly'] are skipped early as well.
Their records were never copied, but still processed.

Based on an earlier patch by Rozbeh Chiryai Sharahi.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 5
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/20/75020/5 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/20/75020/5 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Daniel Windloff +1
  • Verified V +1 Needs a vote
    • Daniel Windloff +1
    • core-ci +1 CI

Issues 2

Files 15

Review log 2025

  1. Rozbeh Chiryai Sharahi uploaded patch set 1 07/02/22, 14:31

  2. core-ci voted on patch set 1 V +1 07/02/22, 14:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28611

  3. Simon Schaufelberger rebased onto patch set 2 08/03/22, 21:18

  4. core-ci voted on patch set 2 V +1 08/03/22, 21:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29806

  5. Oliver Gassner commented on patch set 2 CR +1 03/08/23, 13:49

    Solves the page-copy problem for my use-case. If it is the "right" general solution -> no idea.
  6. Christian Ludwig commented on patch set 2 02/25/25, 17:11

    This feature would make live easy fixing a problem at Yoast SEO. See https://github.com/Yoast/Yoast-SEO-for-TYPO3/issues/602
  7. Wolfgang Klinger uploaded patch set 3 CR +1 V +1 09/28/26, 13:51

  8. Wolfgang Klinger commented on patch set 3 09/28/26, 13:53

    Taking this over, rebased onto TcaSchema, option renamed to copyWithPage, also resolves #104740.
  9. Wolfgang Klinger commented on patch set 3 09/28/26, 13:54

    Reply

    Done

    Reply

    Done
  10. core-ci voted on patch set 3 V +1 09/28/26, 14:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109430

  11. Benni Mack commented on patch set 3 09/29/26, 09:44

    This change is ready for review.
  12. Georg Ringer commented on patch set 3 09/29/26, 09:52

    Feature-104740-ExcludeTablesFromPageCopy.rst:27

    why not excludeFromCopy => true? trying to avoid double negation
  13. Wolfgang Klinger commented on patch set 3 09/29/26, 10:05

    Feature-104740-ExcludeTablesFromPageCopy.rst:27 Reply Unresolved

    I would keep copyWithPage: - the records can still be copied on their own, excludeFromCopy would probably suggest the table can't be copied at all - I don't see the double negation in 'copyWithPage' => false; that's just a flag - it matches existing ctrl options like hideAtCopy and prependAtCopy But if another name is preferred, I'd use excludeFromPageCopy (explicit)
  14. Daniel Windloff commented on patch set 3 09/29/26, 10:59

    DataHandler.php:3624

    I would suggest adding a `TcaSchemaCapability` to access the value; that way, type safety is ensured. Following a comment via slack on the patch (referencing an earlier patch of mine) any table with `readOnly=true` should also be excluded from being copied with a page. The new capability would thus be composed of the two configurations: - crtl readOnly - crtl copyWithPage
  15. Wolfgang Klinger uploaded patch set 4 V +1 09/29/26, 11:15

  16. Wolfgang Klinger commented on patch set 4 09/29/26, 11:15

    DataHandler.php:3624 Reply

    Added CopyWithPage capability (thanks for the hint). readOnly tables are skipped too, as a separate check next to AccessReadOnly
  17. core-ci voted on patch set 4 V +1 09/29/26, 11:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109505

  18. Daniel Windloff voted on patch set 4 CR +1 09/29/26, 11:31

  19. Benni Mack commented on patch set 4 CR -1 09/29/26, 11:37

    Having such a generic option opens up a lot of side effects. Such as: what if there is a constraint to “minitems” in an inline relationship and these inline children have the option set ? Editors would not even expect that they are missing. We need to consider such options especially in datahandler with all the options we already have. We are running behind on fixing side effects for years now with existing options. We have a lot of cases to cover with FAL or with workspaces in mind which we need to respect
  20. Daniel Windloff voted on patch set 4 V +1 09/29/26, 11:43

  21. Wolfgang Klinger uploaded patch set 5 CR +1 V +1 09/29/26, 12:38

  22. Wolfgang Klinger commented on patch set 4 09/29/26, 12:39

    Reply

    Thanks @benni@typo3.org, good point. But I checked this: the option only skips the step in `copySpecificPage` that collects records by their pid. Inline and file children are still copied together with their parent (`copyRecord_processRelation`), so minitems is fine, also in workspaces. It works the same way as for a non-admin user today, where page copy skips tables missing in tables_modify. I added two tests (live and workspace) with `copyWithPage=false` on hotel, offer and price, the result is identical to the normal copyPage.csv. I also updated the RST to explain this there too. hth to put your concerns to rest ;)
  23. core-ci voted on patch set 5 V +1 09/29/26, 12:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109506

  24. Benni Mack commented on patch set 5 09/30/26, 06:19

    Reply

    thanks. still my gut feeling isn't the best on this one, but that's just for historical reasons. I won't block this feature, at the same time, I won't be +1-ing it.
  25. Daniel Windloff voted on patch set 5 CR +1 V +1 09/30/26, 11:41