Issue Bug Closed

#96627Using env variable in site config does not really works

Siva Prasad 01/24/22, 12:22 updated 01/27/22, 22:41

Description

If I set

rootPageId:%env(ROOT_PAGE_ID)%

BE breaks

Reviews 0

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

History 4

  1. Oliver Bartsch commented and changed status New Needs Feedback 01/24/22, 15:48

    Hi, since % is a special character, you have to quote it. See the examples in the docs: https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/SiteHandling/UsingEnvVars.html#using-environment-variables-in-site-configuration.

    In your case this should be: rootPageId: '%env(ROOT_PAGE_ID)%'

    Does this fix your issue?

  2. Siva Prasad commented 01/27/22, 10:42

    Oliver Bartsch wrote in #note-1:
    > Hi, since % is a special character, you have to quote it. See the examples in the docs: https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/SiteHandling/UsingEnvVars.html#using-environment-variables-in-site-configuration.
    >
    > In your case this should be: rootPageId: '%env(ROOT_PAGE_ID)%'
    >
    > Does this fix your issue?

    Hello Oliver,

    Thanks for the feedback. I tried both options, I mean with and without quotes. But I will reconfirm this once again and will update here. Thanks for the feedback.

  3. Siva Prasad commented 01/27/22, 15:55

    This ticket can be closed as this was an issue from my side. I missed quotes

  4. Oliver Bartsch commented and changed status Needs Feedback Closed 01/27/22, 22:41

    Alright, thanks for the feedback. Closed as requested.