Open Millertaker opened 1 week ago
@Millertaker there's a couple things missing from this bug report that a dev will need to try and reproduce the behavior:
This works if you fire the rules on all requests AND set the language as a request.attribute
@wezell @john-thomas-dotcms
Here's the code give for the page i'm showing
<html>
<header>
<title>My Custom Template</title>
</header>
<body>
<div>
<p>Current language ID: $request.getSession().getAttribute("com.dotmarketing.htmlpage.language")</p>
<p>Language Variable 'customvar sitename': $text.get("sitename")</p>
</div>
</body>
<ul>
<li><a href="index_copy?lang=en">English version</a></li>
<li><a href="index_copy?lang=fr">French version</a></li>
</ul>
</html>
I changed the rules to every request and have the same behavior.
here is the language variable that it's being pulled by the $text
viewtool
by the way, the language ID it's not changing in $request.getSession().getAttribute("com.dotmarketing.htmlpage.language")
with the rule setup
Trying to set this on a page is not going to work because the page language version to render has already be selected higher up in the request stack, before any html or velocity has been rendered.
@wezell i'm not following you completely, are you referring to this line?
<p>Current language ID: $request.getSession().getAttribute("com.dotmarketing.htmlpage.language")</p>
i'm not setting the language attribute there just trying to read it from getAttribute.
Parent Issue
No response
Problem Statement
The rules rewrite is not triggering the language change in the page.
Steps to Reproduce
Lang 1
Lang 2
Acceptance Criteria
com.dotmarketing.htmlpage.language
is changed via a rewrite ruledotCMS Version
24.08.27
Proposed Objective
Core Features
Proposed Priority
Priority 3 - Average
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response