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

Fix error message for named route matching #10589

Closed
wants to merge 1 commit into from

Conversation

berarma
Copy link
Contributor

@berarma berarma commented Apr 27, 2017

When a named route doesn't match, the error message contains "%s" instead of the named route. That's my guess.

@ADmad
Copy link
Member

ADmad commented Apr 27, 2017

Fix looks good. Can you please also add a test case for it.

@ADmad ADmad added this to the 3.4.6 milestone Apr 27, 2017
@ADmad ADmad added the defect label Apr 27, 2017
@cleptric
Copy link
Member

\Cake\Core\Exception\Exception does a vsprintf if message is passed as array.

        throw new \Cake\Routing\Exception\MissingRouteException([
            'url' => 'Foo',
            'context' => 'Context',
            'message' => 'A named route was found for "%s", but matching failed.',
        ]);

screen shot 2017-04-27 at 14 17 55

@codecov-io
Copy link

codecov-io commented Apr 27, 2017

Codecov Report

Merging #10589 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #10589      +/-   ##
============================================
- Coverage     94.89%   94.88%   -0.01%     
  Complexity    12101    12101              
============================================
  Files           422      422              
  Lines         30072    30072              
============================================
- Hits          28536    28533       -3     
- Misses         1536     1539       +3
Impacted Files Coverage Δ Complexity Δ
src/Routing/RouteCollection.php 100% <100%> (ø) 25 <0> (ø) ⬇️
src/Cache/CacheRegistry.php 95.83% <0%> (-4.17%) 11% <0%> (ø)
src/Cache/Engine/FileEngine.php 85.47% <0%> (-1.12%) 72% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0450ecc...1aab265. Read the comment docs.

@berarma
Copy link
Contributor Author

berarma commented Apr 27, 2017

Alright @cleptric. It was because of an error in my app that it didn't work like it should. My ErrorController class wasn't properly extending the Cake's class. Sorry for my mistake.

@berarma berarma closed this Apr 27, 2017
@berarma berarma deleted the route-fix branch April 27, 2017 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants