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 site relative partial paths failing in 1.2 #587

Merged
merged 4 commits into from
Jun 25, 2022

Conversation

bennothommo
Copy link
Member

Fixes #571

This PR changes the behaviour in the ViewMaker trait to more closely match the ViewMaker in 1.1, while still retaining the multiple extension support introduced in 643a581#diff-47d4d0a41b9809a09c2b0c209309cd6b776645682610fa2c1906ed66d6ef1b4b.

If a path that is relative the base path is encountered in the getViewPath method, and with one of the allowed extensions matches a valid file, this will be accepted as a partial path. If not, then the ViewMaker will attempt to same within the view paths added at that point. Previously, the base relative paths would only be checked if the path was symbolized in some fashion.

This PR also introduces a fix to the winter:test command by ensuring that the current working directory is always the base path. This matches the behaviour of a web request which would presume the same, and thus ensures that the changes above work in the tests as well.

Matches the behavior of the ViewMaker in the 1.1 branch more closely by checking if the partial path is a local reference first, returning that path if it is. Only if this check fails will it then run through the view paths.

Fixes #571
Fixes the ViewMaker tests by emulating the same behaviour as a web request and having the current directory be the base path of the site, not the directory of the current module or plugin being tested.
@bennothommo bennothommo added maintenance PRs that fix bugs, are translation changes or make only minor changes needs review Issues/PRs that require a review from a maintainer labels Jun 24, 2022
@bennothommo bennothommo added this to the v1.2.0 milestone Jun 24, 2022
@LukeTowers
Copy link
Member

@bennothommo you have added a submodule for the winter/test plugin, needs to be removed.

@LukeTowers LukeTowers added Status: Revision Needed and removed needs review Issues/PRs that require a review from a maintainer labels Jun 25, 2022
@LukeTowers LukeTowers merged commit 7a25524 into wip/1.2 Jun 25, 2022
@LukeTowers LukeTowers deleted the wip/1.2-viewmaker-path-fix branch June 25, 2022 04:10
LukeTowers added a commit that referenced this pull request Jun 29, 2022
* wip/1.2: (21 commits)
  Added fix to ensure correct normalization and return (#588)
  Outputs time respecting backend preferences (#572)
  Bump minimum Laravel version to 9.1
  Fix site relative partial paths failing in 1.2 (#587)
  Switch back to using Laravel CacheServiceProvider
  Rebuild Snowboard agian
  Revert "Rebuild Snowboard"
  Rebuild Snowboard
  Allow a string selector for the form in a request
  Allow a string selector for the form in a request
  Use correct line breaks for Windows tests
  Backport ViewMaker tests from 1.2 branch
  Add additional testMakePartial cases to ViewMaker unit tests (#586)
  Added replaced plugins to the normalize map to ensure classloader namespace aliasing detects replacements (#585)
  Split tests into relevant module folders
  [FIX] Fix plugin flags not loading from cache correctly (#582)
  farsi spelling correction (#579)
  Moved plugin replacement namespace aliasing into register replacement method (#580)
  fix typo
  Add Winter 1.2 as version option in bug report
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PRs that fix bugs, are translation changes or make only minor changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants