-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Theme] Allow overriding templates from plugins (^1.3) #10083
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zales0123
added
the
Potential Bug
Potential bugs or bugfixes, that needs to be reproduced.
label
Jan 10, 2019
pamil
changed the title
[Theme] Allow overriding templates from plugins
[Theme] Allow overriding templates from plugins (^1.3)
Jan 10, 2019
pamil
reviewed
Jan 10, 2019
src/Sylius/Bundle/ThemeBundle/Locator/BundleResourceLocator.php
Outdated
Show resolved
Hide resolved
Zales0123
force-pushed
the
fix-themes-templates-resolving
branch
from
January 10, 2019 12:26
cf9364a
to
60b0284
Compare
pamil
approved these changes
Jan 10, 2019
jacquesbh
approved these changes
Jan 10, 2019
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.
LGTM
pamil
added a commit
that referenced
this pull request
Jan 10, 2019
…ales0123, pamil) This PR was merged into the 1.2 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes #9654 | License | MIT It's hard to test this change with some functional test in a current tests structure, as it would require to use `SyliusPluginTrait` in test bundle/plugin, but it's in a core bundle :/ I have some idea have to test it properly with a Behat scenario, but I need to spend a few more minutes on that :) It would be nice if someone could incorporate these changes into their application and see does it work as expected (cc @jacquesbh :)). I've of course done that, but _better safe than sorry_ 🐃 This change only applies to `1.2` branch, for Sylius `^1.3` take a look here: #10083. Commits ------- 2add023 Fix plugin templates resolving on 1.2 b4084c4 Replace regexp with plain string operation
Thanks, Mateusz! 🥇 |
pamil
added a commit
that referenced
this pull request
Jan 14, 2019
This PR was merged into the 1.2 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | #10082, #10083 | License | MIT I can imagine this PR can be a little bit controversial 😄 but I hope it can be a nice step forward to make `ThemeBundle` more reliable. As there is no easy way to test overriding plugin templates inside `ThemeBundle` itself (as it would require us to use trait from `CoreBundle`), I thought it would be nice to implement such a "test plugin" for Behat tests. It's maybe not the most elegant way, but it tests themes connected with plugins quite well and I don't see having a test plugin only for scenarios a bad thing, as we already have [test themes](https://github.com/Sylius/Sylius/tree/master/src/Sylius/Bundle/ThemeBundle/Tests/Fixtures/themes) or [test bundles](https://github.com/Sylius/Sylius/tree/master/src/Sylius/Bundle/ThemeBundle/Tests/Functional/TestBundle) in our test suite. I was also thinking, that maybe such a test should be implemented on our https://github.com/Sylius/PluginSkeleton, but I really consider overriding plugins template as a `ThemeBundle` feature, rather than plugins... possibility 🚀 Commits ------- c612812 Plugin templates in theme tests 27dbb0d Test plugin with overriden by theme template ba78f11 PR review fixes
pamil
added a commit
to pamil/Sylius
that referenced
this pull request
May 7, 2019
…3) (Zales0123) This PR was merged into the 1.3 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes (kinda) Sylius#9654 | License | MIT This is, of course, a quick fix and quite straight-forward, but it works 😄 And it is still required to use `@SyliusTestPlugin` notation (maybe it's worth to be documented somehow?). This PR fixes the functionality for Sylius `^1.3`, for working fix on `1.2` take a look here: Sylius#10082. Regarding testing it better (as I've also written in fix for `1.2`): > It's hard to test this change with some functional test in a current tests structure, as it would require to use `SyliusPluginTrait` in test bundle/plugin, but it's in a core bundle :/ I have some idea have to test it properly with a Behat scenario, but I need to spend a few more minutes on that :) Commits ------- a43d08b Allow overriding templates from plugins 60b0284 Replace regexp with plain string operation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is, of course, a quick fix and quite straight-forward, but it works 😄 And it is still required to use
@SyliusTestPlugin
notation (maybe it's worth to be documented somehow?). This PR fixes the functionality for Sylius^1.3
, for working fix on1.2
take a look here: #10082.Regarding testing it better (as I've also written in fix for
1.2
):