Review main Merged

77949[TASK] Deprecate TBE_STYLES stylesheet and stylesheet2

Torben Hansen CR +2 V +2 Normal +78 −0 updated 02/27/23, 09:11

Commit message

The rarely used and undocumented configuration declarations

* `$GLOBALS['TBE_STYLES']['stylesheet']`
* `$GLOBALS['TBE_STYLES']['stylesheet2']`

have been added with Kasper's "Initial revision" in 2003 and are
problematic, when two extensions use the same configuration declaration.

Since TYPO3 4.4 it is possible to include CSS stylesheets for the TYPO3
backend using a custom skin configuration as shown below:

`$GLOBALS['TBE_STYLES']['skins']['my_extension']['stylesheetDirectories'][]`

The configuration declarations `$GLOBALS['TBE_STYLES']['stylesheet']`
and `$GLOBALS['TBE_STYLES']['stylesheet2']` have therefore been marked
as deprecated and will be removed in TYPO3 13.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Sybille Peters +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1722

  1. Torben Hansen uploaded patch set 1 02/26/23, 18:52

  2. Sybille Peters commented on patch set 1 02/26/23, 19:15

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:43

    Is not the convention to use the extension key as array key and not $nameOfSkin? If not, extension might overwrite skins of other extensions. The name of the skin is also in the array key in the array stylesheetDirectories. That is also implied by the examples in the (outdated) skinning reference. Example: $GLOBALS['TBE_STYLES']['skins']['my_extension']['stylesheetDirectories'] = [ 'css' => 'EXT:my_extension/Resources/Public/Backend/Skin/Css' ]; Otherwise it would be better to do: if (!isset($GLOBALS['TBE_STYLES']['skins']['some arbitrary name']['stylesheetDirectories'])) { $GLOBALS['TBE_STYLES']['skins']['some arbitrary name']['stylesheetDirectories'] = []; } $GLOBALS['TBE_STYLES']['skins']['some arbitrary name']['stylesheetDirectories'][] = 'EXT:my_extension/Resources/Public/Backend/Skin/Css';

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:51

    It would be nice to add the name of the file here. You can use the :caption: directive. That is commonly used in the main docs now to add the file name. Example: .. code-block:: php :caption: EXT:my_extension/ext_tables.php $GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['css'] = 'EXT:backend/Resources/Public/Css/';
  3. core-ci voted on patch set 1 V +1 02/26/23, 19:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38128

  4. Sybille Peters uploaded patch set 2 V +1 02/26/23, 19:57

  5. Sybille Peters commented on patch set 1 02/26/23, 19:58

    Added the :caption: with filename to changelog.

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:51 Reply

    Done
  6. core-ci voted on patch set 2 V +1 02/26/23, 20:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38131

  7. Torben Hansen uploaded patch set 3 V +1 02/27/23, 07:46

  8. Torben Hansen commented on patch set 2 02/27/23, 07:47

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:43 Reply

    Thanks for your feedback. I replaced `$nameOfSkin` with `my_extension` in the RST and commit message
  9. core-ci voted on patch set 3 V +1 02/27/23, 07:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38142

  10. Thomas Hohn voted on patch set 3 CR +1 02/27/23, 08:18

  11. Georg Ringer commented on patch set 3 02/27/23, 08:19

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:15

    CSS stands already for custom stylesheet. suggestion: replace with "custom CSS"

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:38

    would also create a list just like above

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:52

    please use my_extension instead instead of css
  12. Torben Hansen uploaded patch set 4 CR +1 V +1 02/27/23, 08:24

  13. Torben Hansen commented on patch set 3 02/27/23, 08:25

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:15 Reply

    Done

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:38 Reply

    Done

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:52 Reply

    Changes it to use `my_extension`. The previous example was taken 1:1 from ext:backend.
  14. core-ci voted on patch set 4 V +1 02/27/23, 08:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38143

  15. Thomas Hohn voted on patch set 4 CR +1 02/27/23, 08:33

  16. Nikita Hovratov uploaded patch set 5 CR +1 V +1 02/27/23, 08:50

  17. Nikita Hovratov voted on patch set 5 V +1 CR +1 02/27/23, 08:50

  18. Sybille Peters commented on patch set 5 02/27/23, 08:56

    Deprecation-100033-DeprecateTBE_STYLESStylesheetAndStylesheet2.rst:52 Reply

    Shoudn't "backend" be replace with "my_extension" here, not "css"? In gridelements, it is like this: $GLOBALS['TBE_STYLES']['skins']['gridelements']['stylesheetDirectories']['gridelements_structure'] In (outdated) skinning reference: https://docs.typo3.org/m/typo3/reference-skinning/4.5/en-us/BackendCssApi/SkinningApi/Index.html
  19. core-ci voted on patch set 5 V +1 02/27/23, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38144

  20. Sybille Peters voted on patch set 5 CR +1 02/27/23, 09:00

  21. Georg Ringer voted on patch set 5 V +2 CR +2 02/27/23, 09:11

  22. Georg Ringer merged patch set 6 02/27/23, 09:11