-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] fix triggering deprecation in file locator #34886
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
Conversation
xabbuh
commented
Dec 9, 2019
Q | A |
---|---|
Branch? | 4.4 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | Fix #34556 |
License | MIT |
Doc PR |
@xabbuh I can confirm the fix works and the deprecation is not triggered anymore! Nice :D |
// no need to trigger deprecations when the loaded file is given as absolute path | ||
foreach ($this->paths as $deprecatedPath) { | ||
if (\is_array($locations)) { | ||
foreach ($locations as $location) { | ||
if (null !== $currentPath && 0 === strpos($location, $currentPath)) { | ||
return $locations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, when there are several paths and one of them is not deprecated, we don't know anymore if a deprecated path is going to be used or not, so we skip the deprecation to prevent a false-positive. This means we might miss a deprecation, but that's the best we can do, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am afraid there isn't anything we can do about this. Either we trigger deprecations where we shouldn't or we miss some where they would be appropriate.
Thank you @xabbuh. |
…abbuh) This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel] fix triggering deprecation in file locator | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34556 | License | MIT | Doc PR | Commits ------- 142b179 fix triggering deprecation in file locator
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel][FileLocator] Fix deprecation message | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Ref #34886 `$deprecatedPath` is the foreach value so it only works if the last element triggers the deprecation, otherwise the value is wrong. Commits ------- 18ce839 [HttpKernel][FileLocator] Fix deprecation message