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

[Routing] fix route loading with wildcard, but dir or file is empty #34024

Merged

Conversation

gseidel
Copy link
Contributor

@gseidel gseidel commented Oct 18, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets no ticket i see so far
License MIT

In my route config i have something like:

empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard

But empty_wildcard is empty or has no route configured.

So i had this error:

Call to a member function addPrefix() on null

This PR take care if no route is configured, there will be no error.

@Tobion
Copy link
Contributor

Tobion commented Oct 18, 2019

As a bug fix it needs to be opened against 3.4

@Tobion
Copy link
Contributor

Tobion commented Oct 18, 2019

Also the XmlFileLoader would need the same bug fix.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I made some changes while merging)

@nicolas-grekas
Copy link
Member

Thank you @gseidel.

nicolas-grekas added a commit that referenced this pull request Oct 19, 2019
… is empty (gseidel)

This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b [Routing] fix route loading with wildcard, but dir or file is empty
@nicolas-grekas nicolas-grekas merged commit 217058b into symfony:4.3 Oct 19, 2019
nicolas-grekas added a commit that referenced this pull request Oct 19, 2019
… is empty (gseidel)

This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b [Routing] fix route loading with wildcard, but dir or file is empty
nicolas-grekas added a commit that referenced this pull request Oct 19, 2019
* 3.4:
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
@nicolas-grekas
Copy link
Member

Applied on 3.4 in a54ecb0

fabpot added a commit that referenced this pull request Oct 20, 2019
* 4.3:
  [HttpKernel] fix wrong removal of the just generated container dir
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
  [Routing] fix route loading with wildcard, but dir or file is empty
fabpot added a commit that referenced this pull request Oct 20, 2019
* 4.4:
  [HttpKernel] fix wrong removal of the just generated container dir
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
  [Routing] fix route loading with wildcard, but dir or file is empty
  bump Form component compatibility versions
  execute all compatible tests across versions
  [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths
@fabpot fabpot mentioned this pull request Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants