-
-
Notifications
You must be signed in to change notification settings - Fork 210
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 Breadcrumbs into the page #1564
Conversation
* Create test for templateManager * Cover breadcrumb html
29cb2b3
to
9f051be
Compare
Hey @VincentLanglet it's the correct code for the test, But as expected it'll fail because the breadcrumbs are not returning into the page! is it fine wait until I find out the issue, or should we skip this test and merge, and after that I open a new PR with the fix for this bug? |
I guess this problem is related with: https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Block/BreadcrumbBlockService.php the getMenu was not used, anymore :/ |
Sure, we can wait the fix |
Ok as I was suspecting this bug was introduced in is there any reason to use this return because it was passing I changed the context passed by template to But I just would like to know if there is some thing else for this cc @Daric971 |
Hey @jordisala1991 could you help me here with this phpstan errors? |
ProxyQuery is now generic.
And for
You have to assert
|
9f2fce2
to
943240e
Compare
Ok I got those 2 errors
any idea how to solve @VincentLanglet |
Isn't a bug ?
So to me Do you mind looking in the issues/creating an issue on https://github.com/vimeo/psalm/issues ? Moreover, if it's a real issue, I think it would have been reported by phpstan. |
4631a51
to
ec7c892
Compare
5f0adf6
to
94cf542
Compare
Yeah there is a bug, But I guess it's not related with psalm Because the code was importing a different ProxyQuery (from Datagrid), But the method returns ProxyQuery from admin |
That's not an issue. I still believe it's an issue with psalm. |
1130c52
to
903b7fb
Compare
@@ -54,6 +54,8 @@ public static function getSubscribedServices(): array | |||
} | |||
|
|||
/** | |||
* @param ProxyQueryInterface<object> $query |
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.
But if we know this is batch for pages, shouldnt this objet be PageInterface?
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.
Indeed
@@ -35,6 +35,8 @@ public static function getSubscribedServices(): array | |||
} | |||
|
|||
/** | |||
* @param ProxyQueryInterface<object> $query |
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.
Same but with SnapshotInterface
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.
Indeed
<div class="row"> | ||
{{ sonata_block_render_event('breadcrumb', { 'context': 'page', 'current_uri': app.request.requestUri }) }} | ||
<div class="row page-breadcrumb"> | ||
{{ sonata_block_render_event('breadcrumb', { 'context': 'sonata.page.block.breadcrumb', 'current_uri': app.request.requestUri }) }} |
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.
do we know why this context changed? should we revert something somewhere?
Also if this code changes is there any docs to update?
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.
check this comment please : #1564 (comment)
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.
But this bug was introduced here: https://github.com/sonata-project/SonataPageBundle/pull/1483/files#diff-f0461df8f4a53195f2b565ad37746df1e8076ff748edb18c3e2689581f2db4caR87
I guess he was just following how the stuffs were made in others parts, But in 3.x it was using page
and when added this method, it was changed!
I choose to use sonata.page.block.breadcrumb
because it's more explainable then page
, But yes, It's a BC!
because if someone is using sonata_block_render_event
passing page, it won't work!
I could back to page
, But I guess it's not the correct correct for breadcrumb
, sonata.page.block.breadcrumb
make more sense!
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.
I made a mistake there, imo it should be page
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.
well we can back this for page :),
I'll open a PR for this ;)
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 if you can open a PR to fix the things I mentioned it would be great :) thanks!
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.
I opened #1570
// Mock Snapshot manager | ||
$snapshotManagerMock = $this->createMock(SnapshotManagerInterface::class); | ||
$transformerMock = $this->createMock(TransformerInterface::class); | ||
$cmsSnapshotManagerMock = new CmsSnapshotManager($snapshotManagerMock, $transformerMock); |
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.
I recommend to not name variables with mock suffix , this one is a mistake for example, it is not a mock
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.
true :/
Subject
I am targeting this branch, because it was breaking the pipeline in 4.x branch.
Closes #1497
Changelog