Commit 6940885
committed
bug #2961 [LiveComponent] Fix LiveUrlSubscriber throw
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[LiveComponent] Fix LiveUrlSubscriber throw `MethodNotAllowed`
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix #2960
| License | MIT
> [!WARNING]
> Not sure this is enough, but If anyone wants to build on it, feel free - wont be around tomorrow.
---
The new LiveUrlSubscriber calls the Router to match the previous Url.
At that instant, the RoutingContext is most of the time in POST, and so calling router->match($previousUrl) would throw a MethodNotAllowedException
---
Most recent commit ([Catch MethodNotAllowedException](1da8a7b)) fixes _**this**_ issue ... but I think we have probably other use cases where it would not work.
My previous commit (reverted in the current state) [Force RequestsContext to "GET"](e81aad2) seems a more promising lead.
And the first one (reverted too in current state) [No LiveProps no change](1da8a7b) was to avoid entirely the generation when no props were extracted from URL... sadly i don't think it's enough to say "no props should now be used in URL".. ?
---
Thank you `@zacharylund` for the investigation and `@jmsche` for the perfect reproducer
Commits
-------
5b8d701 [LiveComponent] Fix LiveUrlSubscriber throw `MethodNotAllowed`MethodNotAllowed (smnandre)File tree
2 files changed
+16
-1
lines changed- src/LiveComponent
- src/Util
- tests/Unit/Util
2 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
143 | 157 | | |
144 | 158 | | |
145 | 159 | | |
| |||
0 commit comments