Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: autoload option bugged in objects yaml since 2011 :D #3307

Open
mhsdesign opened this issue Feb 5, 2024 · 0 comments
Open

BUG: autoload option bugged in objects yaml since 2011 :D #3307

mhsdesign opened this issue Feb 5, 2024 · 0 comments

Comments

@mhsdesign
Copy link
Member

While testing #2956 i found out that flow crashes with:

parseAutowiring: Invalid autowiring declaration "off" in source configuration of package Neos.Flow, definition for object "DateTime".

At first i was more confused by the mention of DateTime, that its A returned from registerClassFiles AND that we declare an Objects.yaml for it??

DateTime:
scope: prototype
autowiring: off

But it turns out that the method parseAutowiring was made stricter in the mentioned pr and currently allows also "off":

protected static function parseAutowiring($value)
{
switch ($value) {
case true:
case Configuration::AUTOWIRING_MODE_ON:
return Configuration::AUTOWIRING_MODE_ON;

I know that switch in php are loose comparison == and thought at first "off" == false but the falsy string are "0" and "".

What really happens is that ANY truthy string will pass the check and turn auto-wiring ON!!

That includes the strings "off" "on" and "nudelsuppe" ... !!!
That means that, as we use "off" in our flow configuration code, is was useless all the time and turned autowiring ON.

This is a regression from this change in 2011, which turned '"on"' in the switch case to true and "off" to false.
0284ce6#diff-8a640f9bc0ed3edffb3f01425b0206a17d9ece5c16d04d8cca4c043ee6ca19f6R243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant