Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.3] Glob loader breaks loading inline YAML resources #22938

Copy link
Copy link
Closed
@alcaeus

Description

@alcaeus
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.3.0-RC1

First of all, I'm not sure if this is issue or if this "just shouldn't be done this way".

Upgrading to Symfony 3.3.0-RC1 in Sylius causes an error as indicated in Sylius/Sylius#7896. After additional investigation I figured this is caused due to Sylius using a custom loader to load config files with inline YAML as a resource (example shortened):

sylius_admin_admin_user:
    resource: |
        alias: sylius.admin_user
        except: ['show']
    type: sylius.resource

The custom loader generates routes based on the configuration given in the resource key, so it's a nice way to avoid writing lots of boilerplate code for the same thing over and over. Using the resource key also reduces the amount of files needed: without this, there would have to be one routing file and another file containing the actual specification (now contained in resource).

With this comes the issue: the introduction of glob loaders in #21635 broke this completely, while #22621 partially fixed it: it no longer breaks for config files that don't contain any of the characters triggering the glob loader (removing the except directive in the config above fixes the error for this file).

Would you consider this a valid use-case of the resource key in a config file? If so, should the check for the glob pattern be hardened? In this case, adding a check against newlines would help, but who knows what else is out there. Another option would be to fall back to the default behavior if the glob loader didn't load anything, but I'm also not sure what side-effects this might have. Last but not least, this could also be fixed on the Sylius side; I just wanted to check here before doing that.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.