-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fixes error with unperisted dynamic route in sonata FrontendLinkExtension #275
Fixes error with unperisted dynamic route in sonata FrontendLinkExtension #275
Conversation
@@ -68,6 +68,11 @@ public function configureTabMenu( | |||
); | |||
} | |||
|
|||
if($subject instanceof PrefixInterface && !is_string($subject->getId())) { |
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.
missing a space after the if
@@ -68,6 +68,11 @@ public function configureTabMenu( | |||
); | |||
} | |||
|
|||
if ($subject instanceof PrefixInterface && !is_string($subject->getId())) { |
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.
you need to add a use
statement for this interface in the header as you are in a different namespace.
any chance you can add tests for this extension? maybe configure it in Tests/Resources/app/config and check for the link (when it should exist) in Tests/WebTest/RouteAdminTest.php ?
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.
The link is already being tested (/cmf/routing/route/create
). Trying to get it tested somehow...
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 it is, you just need to adjust the config to make this extension being loaded into the admin (then the problem with namespace you now fixed would have been shown as test failure). when you do, you could add a check in the web test cases to check if the frontend link is actually there (except in the create case where the whole tab must be not there, which you could test as well just to be sure)
Fixes error with unperisted dynamic route in sonata FrontendLinkExtension
i merged already as this fixes the bug. if you can add it to testing, that would be cool
yes it is, you just need to adjust the config in Tests/Resources/app/config/... to make this extension being loaded into the admin (then the problem with namespace you now fixed would have been shown as test failure). when you do, you could add a check in the web test cases to check if the frontend link is actually there (except in the create case where the whole tab must be not there, which you could test as well just to be sure) |
@dbu Is it possible that the WebTests are never executed? No I also don't know how to manage the whole db/phpcr test setup to get the WebTests running. Any tips?
Btw. Because of the bug, tag v1.3.1 is still broken. Do you plan to update the tag, or how do you guys manage broken tags? |
It looks indeed like the webtests might not be running. Try running:
Then try again, see the MenuBundle for an example of how the WebTests are executed. |
we don't ever change a tag once its done. it can mess up some peoples system quite badly when a tag changes what git commit its referencing (e.g. when using satis to mirror packagist). i just created 1.3.2 now to have a release where the extension works. @frne if you can try to activate the web tests the same way we run them on menu bundle, that would be great! if not, i will try to do that. |
@dbu I'll activate the tests and expand them to test the sonata extension. Thx. |
Fixes a serious error at the
\Symfony\Cmf\Bundle\RoutingBundle\Admin\Extension\FrontendLinkExtension
when a new dynamic route is created in sonata admin: