Issue Bug Closed

#100936Label for custom category in constant editor is not used

Karsten Nowak (undkonsorten) 05/31/23, 09:26 updated 10/18/26, 13:49

Description

There are several cases where the label for the custom category is not displayed in the dropdown.

1. if the category key has upper letters

# customcategory=myCategory=My category

in dropdown “my_category” is shown. The “C” will be replaced with “_c”

2. if no empty line follow the definition of the custom category

# customcategory=my_category=My category
myConstant = xy

in dropdown “my_category” is shown. The label will be ignored

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 1

History 12

  1. Christian Weiske commented <span data-processor="relativetime" data-value="2024-01-04T10:47:30+00:00" > 01/04/24, 10:47 </span>

    I can confirm that the second issue appears on TYPO3 v12.4.9, and with “customsubcategory”.
    The label is not used when there is no empty line after the comment.

  2. Christian Weiske commented <span data-processor="relativetime" data-value="2024-01-04T10:55:04+00:00" > 01/04/24, 10:55 </span>

    The reason for that problem is that the comments get attached to the following node by the AST parser.
    Category labels are only looked for in the root node comments in v12, while at least in v10 we could declare categories everywhere.

    Broken:

    # customcategory=test=Test
    test {
        # cat=test/color; type=string; label=Color
        color = orange
    }

    Works:

    # customcategory=test=Test
    
    test {
        # cat=test/color; type=string; label=Color
        color = orange
    }
  3. Christian Kuhn commented <span data-processor="relativetime" data-value="2024-07-09T21:35:00+00:00" > 07/09/24, 21:35 </span>

    a) Somebody ™ could look into the casing issue. If there is some simple fix, we could go for it.

    b) The strategy of the comment binding is to bind comments to the scope of the following node.
    This will most likely not change, and the scenario “no empty line below custom category definition” is rather hard to fix, I suppose. I think we will rather wait for a full substitution of this doomed “logic in comments” strategy, than trying to fix this detail. Please add an empty line for now.

  4. Garvin Hicking commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2024-07-24T07:54:53+00:00" > 07/24/24, 07:54 </span>

    I cannot reproduce the problem a) in TYPO3 v12.4.17 or 13.3-main. I used this:

    # customcategory=myCategoryBroken=My broken category
    
    testbroken {
        # cat=myCategoryBroken/color; type=string; label=Color Broken
        color = orange
    }
    
    # customcategory=mycategoryworking=My working category
    
    testworking {
        # cat=mycategoryworking/color; type=string; label=Color Working
        color = orange
    }

    and both options appear in the two accordion tabs. Not sure though what “dropdown” might refer to?

  5. Lina Wolf commented <span data-processor="relativetime" data-value="2024-08-25T08:53:18+00:00" > 08/25/24, 08:53 </span>

    It seems like a newline is required after the definition of a subcategory or category. Otherwise it will just be ignored starting with TYPO3 v12

    ```
    1. customcategory=myCategoryBroken=My broken category
      testbroken { # cat=myCategoryBroken/color; type=string; label=Color Broken
      color = orange
      }
    1. customcategory=mycategoryworking=My working category

    testworking { # cat=mycategoryworking/color; type=string; label=Color Working
    color = orange
    }
    ```

    The first does not work, the second works

  6. Rémi Payette commented and changed attached clipboard-202509171224-velso.png <span data-processor="relativetime" data-value="2025-09-17T16:37:48+00:00" > 09/17/25, 16:37 </span>

    Typo3 13.4.16, I have this issue in Extension settings.

    not working

    # customcategory

    working properly

    # customsubcategory

    I went as far as confirming that parseCustomCategoryAndSubCategories function in cms-core/Classes/TypoScript/AST/Visitor/AstConstantCommentVisitor.php
    does return my customcategory ( page1 category at the end ) :

    print_r($this->categories);
    Array
    (
        [basic] => Array
            (
                [label] => Basic
                [usageCount] => 0
            )
    
        [menu] => Array
            (
                [label] => Menu
                [usageCount] => 0
            )
    
        [content] => Array
            (
                [label] => Content
                [usageCount] => 0
            )
    
        [page] => Array
            (
                [label] => Page
                [usageCount] => 0
            )
    
        [advanced] => Array
            (
                [label] => Advanced
                [usageCount] => 0
            )
    
        [all] => Array
            (
                [label] => All
                [usageCount] => 0
            )
    
        [page1] => Array
            (
                [usageCount] => 0
                [label] => Page 1
            )

    but the label is not displayed.
    clipboard-202509171224-velso.png

  7. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-10-18T13:49:45+00:00" > 10/18/26, 13:49 </span>

    Going through this issue:

    1. Casing of the category key: could not be reproduced (see note by Garvin Hicking). The key of customcategory and the one used in cat= are both lowercased by AstConstantCommentVisitor.
    2. Missing empty line after customcategory: comments are bound to the following node by the TypoScript parser and custom categories are only read from the comments of the root node. As noted by Christian Kuhn, this is not going to change, an empty line after the definition is required.
    3. Labels of customcategory in the extension settings: fixed in #105694.

    Therefore closing this issue.

    If this is still valid for you in v14, please open a new issue and provide information how to reproduce it. Thanks!