8000 Global variable $current_lang not functional in epc:if · Issue #410 · eprints/eprints · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Global variable $current_lang not functional in epc:if #410

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

Open
mpbraendle opened this issue Jul 14, 2016 · 0 comments
Open

Global variable $current_lang not functional in epc:if #410

mpbraendle opened this issue Jul 14, 2016 · 0 comments

Comments

@mpbraendle
Copy link
Contributor

EPScript / EP Control Format: The global variable $current_lang works in <epc:print expr="$current_lang" />, but not in test expressions such as

<epc:if test="$current_lang = 'en'"> do something </epc:if>

which always yields true irrespective of the value of $current_lang

or

<epc:choose> <epc:when test="$current_lang = 'en'"> do something </epc:when> <epc:otherwise> do something else </epc:otherwise> </epc:choose>

We noticed this bug when we introduced a new global variable $current_url on line 88 of Script.pm similarly to $current_lang on line 87:

$state->{current_lang} = [$state->{session}->get_langid, "STRING" ]; $state->{current_url} = [$state->{session}->current_url, "STRING" ];

and tested both the use of $current_lang and $current_url in epc:if and epc:when .

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

No branches or pull requests

2 participants
155A
0