Skip to content

parameters don't return correctly depending on initial request #5408

@crshovrd

Description

@crshovrd

Under app/config/config.yml I have an entry for:

  parameters:
    bar: "yes"

If I attempt to access this parameter through a controller (under dev environment aka app_dev.php):

class DefaultController extends Controller
{
    public function indexAction()
    {
        var_dump($this->container->parameters['bar']);die;
    }
}

the value "yes" is dumped out.

When I access this under prod environment, it returns null. I'm not sure why as this parameter was defined in config.yml which is used by prod and dev (config.yml is imported into config_dev.yml).

If I switch the order around, everything works as expected. Basically, if I go to app.php first, the correct value is returned. If I then go to app_dev.php the correct value is returned. It seems to me that there is some sort of cache issue going on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions