Release Support > Pending Issues

Roundcube 1.5 Beta - problems with template conditions

(1/3) > >>

chris_scott:
Hi,
I'm having some problems with the skin template conditionals (if/elseif/else) in RC 1.5 Beta (latest as of this post.) In some circumstances the html code from ALL the if clauses is included, even if the conditions don't match. (See the attached screenshot.)

I'm pasting the code that works in RC 1.4 but doesn't work in RC 1.5. I have it added to header.html of a custom skin. The odd thing is that if I make the text in the if clauses shorter, it starts working properly. For example, if I remove the last two sentences inside the span of condition 4, it works.

Does anyone have any ideas what's going on?


--- Code: ---<roundcube:if condition="env:task == 'mail' && env:action == 'show'" />
    Condition 1
    <span style="display:none">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nulla quam, egestas
        posuere ac, tincidunt a purus. Ut ornare semper vehicula. Maecenas molestie laoreet elit. Suspendisse
        a accumsan ante, sit amet efficitur tellus. Nulla eget vehicula purus. Praesent gravida, nisl vitae
        egestas vestibulum, erat nulla eleifend leo, in feugiat quam elit vel nulla.
    </span>
<roundcube:elseif condition="env:task == 'mail' && env:action == 'compose'" />
    Condition 2
    <span style="display:none">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nulla quam, egestas
        posuere ac, tincidunt a purus. Ut ornare semper vehicula. Maecenas molestie laoreet elit. Suspendisse
        a accumsan ante, sit amet efficitur tellus. Nulla eget vehicula purus. Praesent gravida, nisl vitae
        egestas vestibulum, erat nulla eleifend leo, in feugiat quam elit vel nulla.
    </span>
<roundcube:elseif condition="env:task == 'mail' && !env:action == 'plugin.summary'" />
    Condition 3
    <span style="display:none">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nulla quam, egestas
        posuere ac, tincidunt a purus. Ut ornare semper vehicula. Maecenas molestie laoreet elit. Suspendisse
        a accumsan ante, sit amet efficitur tellus. Nulla eget vehicula purus. Praesent gravida, nisl vitae
        egestas vestibulum, erat nulla eleifend leo, in feugiat quam elit vel nulla.
    </span>
<roundcube:elseif condition="env:task == 'addressbook'" />
    Condition 4
    <span style="display:none">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nulla quam, egestas
        posuere ac, tincidunt a purus. Ut ornare semper vehicula. Maecenas molestie laoreet elit. Suspendisse
        a accumsan ante, sit amet efficitur tellus. Nulla eget vehicula purus. Praesent gravida, nisl vitae
        egestas vestibulum, erat nulla eleifend leo, in feugiat quam elit vel nulla. Nam ullamcorper sapien purus,
        vitae sollicitudin enim lobortis eget. Aliquam interdum fermentum turpis nec ultrices.
    </span>
<roundcube:elseif condition="env:task == 'settings'" />
    Condition 5
    <span style="display:none">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nulla quam, egestas
        posuere ac, tincidunt a purus. Ut ornare semper vehicula. Maecenas molestie laoreet elit. Suspendisse
        a accumsan ante, sit amet efficitur tellus. Nulla eget vehicula purus. Praesent gravida, nisl vitae
        egestas vestibulum, erat nulla eleifend leo, in feugiat quam elit vel nulla.
    </span>
<roundcube:else/>
    Condition 6
    <span style="display:none">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    </span>
<roundcube:endif />

--- End code ---

alec:
It works for me in git-master. I put your template content at the end of skins/elastic/templates/mail.html and I get "Condition 3" only in the result.

chris_scott:
Hi alec,
I downloaded and installed a fresh copy of RC 1.5 beta (apache/mysql) from git master (https://github.com/roundcube/roundcubemail) and added the code at the end of skins/elastic/templates/mail.html as you indicated. The result is still the same: all the conditions are rendered. (Please see the attachments.) I have not made any modifications to the RC code and the plugins array is empty--the installation is completely clean. I get the same result when I add the code to any other template files; the third screenshot shows the code added to elastic/templates/includes/layout.html; the fourth screenshot: larry/includes/header.html. Thank you for taking another look at this.

alec:
What PHP version? Try with Opcache disabled.

chris_scott:
PHP Version 7.2.34-18+ubuntu20.04.1+deb.sury.org+1

OPcache disabled, no change: all the conditions are still rendered.

Navigation

[0] Message Index

[#] Next page

Go to full version