Skip to content

Fallback to @page var if no Current.page is set#3011

Merged
tvdeyen merged 1 commit intoAlchemyCMS:mainfrom
tvdeyen:at-page-fallback
Sep 3, 2024
Merged

Fallback to @page var if no Current.page is set#3011
tvdeyen merged 1 commit intoAlchemyCMS:mainfrom
tvdeyen:at-page-fallback

Conversation

@tvdeyen
Copy link
Copy Markdown
Member

@tvdeyen tvdeyen commented Sep 3, 2024

What is this pull request for?

With Alchemy 7.2 (#2701) we started to use Alchemy::Current.page for rendering elements of current page. If one has a custom controller to render Alchemy content with:

render(template: "alchemy/pages/show")

it is now empty if Alchemy::Current.page is not set.

Someday we might deprecate the @page instance variable, but until then we need to fall back to it.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

With Alchemy 7.2 (AlchemyCMS#2701) we started to use `Alchemy::Current.page`
for rendering elements of current page. If one has a custom
controller to render Alchemy content with:

    render(template: "alchemy/pages/show")

it is now empty if `Alchemy::Current.page` is not set.

Someday we might deprecate the `@page` instance variable,
but until then we need to fall back to it.
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.47%. Comparing base (2adf6e2) to head (26072ab).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3011   +/-   ##
=======================================
  Coverage   96.47%   96.47%           
=======================================
  Files         237      237           
  Lines        6403     6403           
=======================================
  Hits         6177     6177           
  Misses        226      226           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tvdeyen tvdeyen merged commit 3e82952 into AlchemyCMS:main Sep 3, 2024
@tvdeyen tvdeyen deleted the at-page-fallback branch September 3, 2024 21:15
@tvdeyen
Copy link
Copy Markdown
Member Author

tvdeyen commented Sep 4, 2024

💚 All backports created successfully

Status Branch Result
7.2-stable

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants