Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

expose: false does not work as documented #401

Closed
mbessolov opened this issue Jan 6, 2021 · 5 comments
Closed

expose: false does not work as documented #401

mbessolov opened this issue Jan 6, 2021 · 5 comments

Comments

@mbessolov
Copy link

The documentation page at https://symfony.com/doc/2.x/bundles/FOSJsRoutingBundle/usage.html has the following:

You can prevent to expose a route by configuring it as below:

# app/config/routing.yml
my_very_secret_route:
    pattern: /admin
    defaults: { _controller: HelloBundle:Admin:index }
    options:
        expose: false

It does not work anymore the way it is described.

expose: false (or actually any value) now does exactly the same as expose: true thanks to the following:

    public function isRouteExposed(Route $route, $name)
    {
        return true === $route->hasOption('expose') ||
            ('' !== $this->pattern && preg_match('#^' . $this->pattern . '$#', $name));
    }

This problem was introduced in https://github.com/FriendsOfSymfony/FOSJsRoutingBundle/pull/347/files#diff-fab97a6f1291c76154eff6c52009573a80c2cc9b23541d52ff4d229adfb1f0cdR199-L173

I'm not sure if it is a bug, or if it was done intentionally.

I'll be glad to create a PR, please just let me know which way it should be - whether the code, or the documentation should be fixed.

orocrmdeployer pushed a commit to oroinc/platform that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
orocrmdeployer pushed a commit to oroinc/crm that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
orocrmdeployer pushed a commit to oroinc/customer-portal that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
orocrmdeployer pushed a commit to oroinc/crm-application that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
orocrmdeployer pushed a commit to oroinc/platform-application that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
orocrmdeployer pushed a commit to oroinc/orocommerce-application that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
orocrmdeployer pushed a commit to oroinc/orocommerce-application-de that referenced this issue Jan 12, 2021
- friendsofsymfony/jsrouting-bundle has been updated
- fixed incorrect regexp
- removed no longer supported test case - FriendsOfSymfony/FOSJsRoutingBundle#401
@HamzaRouissi
Copy link

hello @mbessolov
for the version 5 of symfony what is the best way to configure FosJSRoiting;
there is no documentation for the version 5
thank you !

@stof
Copy link
Member

stof commented Jan 26, 2021

I would say that breaking expose: false was a bug.

@stof
Copy link
Member

stof commented Jan 26, 2021

@elliotalld please don't hijack bug reports to ask off-topic support questions. That's only making it harder to manage issues.

@tugrul
Copy link
Contributor

tugrul commented Apr 4, 2021

I couldn't figure out this functionality before. I added test method and fixed the bug.

@tobias-93
Copy link
Collaborator

Fixed in #404

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants