Review main Merged Breaking

85156[!!!][TASK] Make tt_content imagewidth/imageheight nullable

Georg Ringer CR +2 V +2 Normal +137 −4 updated 07/14/26, 21:06

Commit message

Define the fields `imagewidth` & `imageheight` of content elements
nullable to avoid a default value of `0` which confuses editors. No
other field is filled with a value which can't be removed.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Christian Kuhn +1
    • Benni Mack +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Christian Kuhn +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 2329

Show 34 earlier messages
  1. Georg Ringer uploaded patch set 1 07/08/24, 18:32

  2. core-ci voted on patch set 1 V +1 07/08/24, 18:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61186

  3. Riccardo De Contardi commented on patch set 1 V +1 07/08/24, 21:11

    This change is ready for review.
    Tested with textpic CE, textmedia CE, images CE. I've noticed that the field is empty and the checkbox "set value" uncheched only for _new_ content elements (i.e. elements created after applying the patch) while pre-existing content elements still have "0" in the field and "set value" checked (but on frontend, they look fine, with their original dimensions if I am not wrong)
  4. Simon Schaufelberger commented on patch set 1 CR +1 V +1 07/10/24, 13:44

    Be aware that this will cause a db change: ALTER TABLE `tt_content` CHANGE `imagewidth` `imagewidth` INT UNSIGNED DEFAULT NULL Current value: `imagewidth` INT UNSIGNED DEFAULT 0 NOT NULL ALTER TABLE `tt_content` CHANGE `imageheight` `imageheight` INT UNSIGNED DEFAULT NULL Current value: `imageheight` INT UNSIGNED DEFAULT 0 NOT NULL
  1. Christian Kuhn commented on patch set 1 07/11/24, 18:19

    Are we sure this works well in FE, is there maybe some code that expects 0 (zero) instead of null?

    Reply

    yes. that's the point.
  2. Georg Ringer commented on patch set 1 07/31/24, 15:44

    yes ;)
  3. Georg Ringer rebased onto patch set 2 CR +1 V +1 01/20/25, 19:20

  4. core-ci voted on patch set 2 V +1 01/20/25, 19:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72741

  5. Benni Mack commented on patch set 2 03/23/25, 09:32

    I think this is a good idea, and I also recommend making an upgrade wizard setting these values to "null" which were "0" before.
  6. Georg Ringer uploaded patch set 3 V +1 03/30/25, 08:56

  7. core-ci voted on patch set 3 V +1 03/30/25, 09:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76664

  8. Benjamin Franzke commented on patch set 3 CR -1 03/30/25, 17:32

    tt_content.php:341

    Lower range should now be 1, since 0 is now an invalid (legacy, to be migrated) value.
  9. Georg Ringer commented on patch set 4 CR -1 V +1 03/30/25, 18:15

    Published edit on patch set 3.
  10. core-ci voted on patch set 4 V +1 03/30/25, 18:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76678

  11. Chris Müller commented on patch set 4 03/30/25, 18:38

    Breaking-68303-MakeTt_contentImagewidthimageheightNullable.rst:35

    "issue" seems to be misplaced here?
  12. Georg Ringer commented on patch set 5 V +1 03/30/25, 19:36

    Published edit on patch set 4.
  13. core-ci voted on patch set 5 V +1 03/30/25, 19:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76683

  14. Benjamin Franzke commented on patch set 5 03/31/25, 07:16

    tt_content.php:341 Reply

    Done
  15. Stefan Bürk commented on patch set 5 04/01/25, 13:09

    MediaFieldZeroToNullUpdateWizard.php:84

    Don't resue QueryBuilder instances.
  16. Georg Ringer commented on patch set 6 V +1 04/01/25, 13:15

    Published edit on patch set 5.
  17. Georg Ringer commented on patch set 6 04/01/25, 13:15

    MediaFieldZeroToNullUpdateWizard.php:84 Reply

    Done
  18. core-ci voted on patch set 6 V +1 04/01/25, 13:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76788

  19. Christian Kuhn commented on patch set 6 CR +1 V +1 04/07/25, 12:05

    Reply

    Done

    Breaking-68303-MakeTt_contentImagewidthimageheightNullable.rst:35 Reply

    Done
  20. Benni Mack voted on patch set 6 CR +1 V +1 04/07/25, 12:56

  21. Georg Ringer voted on patch set 6 CR +2 V +2 04/07/25, 14:18

  22. Georg Ringer merged patch set 7 04/07/25, 14:18

  23. Markus Klein commented on patch set 7 07/14/26, 10:51

    MediaFieldZeroToNullUpdateWizard.php:85

    This won't work during an upgrade, where the DB schema hasn't been updated beforehand, which is the default case. I created #110195 to document this.
  24. Stefan Bürk commented on patch set 7 07/14/26, 19:11

    MediaFieldZeroToNullUpdateWizard.php:85 Reply

    Recomnnded way on update is `db schema safe aka extension:setup` which should have updated that and than execute this upgrade wizard. IMO covered by DatabaseUpdatedPrerequisits. Ok just read the issue - you only respect the prerequisites. possible worth to either make that schema aware or ensure databaseupdateprerequeists also executes changes (modifications). Still recommended way is to use `extension:setup -> upgradewizards:run` workaround that anyway (and possible the reason not detected that earlier).
  25. Markus Klein commented on patch set 7 07/14/26, 21:06

    MediaFieldZeroToNullUpdateWizard.php:85 Reply

    Despite any cli command order. If you do a classic update, you got the same problem. Generally speaking, it's not safe to making databaseupdateprerequiste handle changes as well. An upgrade wizard might need the old schema for its work. A clean solution would only be possible, if upgrade wizards could register their needed schema changes before wizard execution.