Zum Hauptinhalt gehen

Replacing null value with empty default! warning

Kommentare

1 Kommentar

  • Holger Höbbel

    Hello Sumant,

    the code you posted shouldn’t generate that warning message. The warning message indicates that a variable has the value zero and therefore cannot be output correctly. Your code uses variables in three places:

    $CMS_VALUE(grid, default:"")$ => by using ,default:"" you bypass the Warning

    $CMS_FOR(section, st_accordion_list)$ => if st_accordion_list is null, you would get an ERROR (cannot iterate...)

    $CMS_VALUE(section)$ => This variable is defined within the CMS_FOR, so it has a valid value.

    I assume, that within the section templated used within the FS_CATALOG an input component has no value and triggers the warning. 

    Try the following to find the root cause of the WARN message:
    * open the SiteArchitect
    * navigate to the appropriate page (or pageref)
    * open the context menue and select "Display preview errors" and the appropriate language and output channel

    You should get a popup with the Warning. Click on the last line of the stacktrace and you will be taken to the relevant line of the template.

    Here is an explanation of the warning’s stack trace, using an example

    23.03.2026 08:13:46.246 WARN  ($CMS_VALUE(st_accordion_list)$ at 19, 1): Replacing null value with empty default! Undefined variable 'st_accordion_list'!
    inside of: PageTemplate 'standardpage' (id=2342822) (channel=html)
    inside of: $CMS_TRIM(level:3, char:\n)$ - at 124, 56
    inside of: $CMS_VALUE(#global.page.body("body"))$ - at 238, 4
    inside of: SectionTemplate 'download' (id=2342871) (channel=0)
    inside of: $CMS_VALUE(st_accordion_list)$ - at 19, 1

    The Warning occurs on the PageTemplate with the UID standardpage (and the id 2342822) within the output channel "html". 
    There within a $CMS_TRIM()$ tag (in line 124 at position 56)
    And within the CMS_TRIM a CMS_VALUE is used in line 238.
    This CMS_VALUE triggers the output of the section template 'download'
    And within this section template in line 19 the tag $CMS_VALUE(st_accordion_list)$ triggers the warning.
    In this case the variable "st_accordion_list" is null.

    Best regards
    Holger

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.