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

TreeView: PHP 7.3 issue in AJAXTree #59

Closed
AiYoriAoshi opened this issue Feb 11, 2019 · 1 comment
Closed

TreeView: PHP 7.3 issue in AJAXTree #59

AiYoriAoshi opened this issue Feb 11, 2019 · 1 comment

Comments

@AiYoriAoshi
Copy link

AiYoriAoshi commented Feb 11, 2019

There is a problem with the TreeView with PHP 7.3. I haven't tested any other PHP Version but from the mailing list it seems that PHP 7.2 works fine.

The problem is in the AJAXTree.php file from PLA.
The tree will show the "alt" +- Text instead of an expand/collapse icon as the code for the icons does not work and since the code relies on the displayed icon name to decide on further action, no action will be carried out since no icon was loaded.

>/usr/share/ldap-account-manager/templates/3rdParty/pla/lib#` diff AJAXTree.php.old AJAXTree.php
> 68,69c65,66
<               $imgs['expand'] = array('tree_expand.png','tree_expand.png','tree_expand_corner.png',
<                       ($level > 0) ? 'tree_expand_corner.png' : 'tree_expand_corner_first.png');
---
>               $imgs['expand'] = array('tree_expand.png','tree_expand.png','tree_expand_corner.png');
>               $imgs['expand'][3] = ($level > 0) ? 'tree_expand_corner.png' : 'tree_expand_corner_first.png';
71,72c68,69
<               $imgs['collapse'] = array('tree_collapse.png','tree_collapse.png','tree_collapse_corner.png',
<                       ($level > 0) ? 'tree_collapse_corner.png' : 'tree_collapse_corner_first.png');
---
>               $imgs['collapse'] = array('tree_collapse.png','tree_collapse.png','tree_collapse_corner.png');
>               $imgs['collapse'][3] = ($level > 0) ? 'tree_collapse_corner.png' : tree_collapse_corner_first.png';

The issue is that code with inline-conditioning the $level variable results not in an Array but returns UNKNOWN.
I'm no expert on PHP7, so my local quick fix was to just build the array with the three static entries and add the fourth value with the condition.

Now an array will be successfully build and the tree can be expanded/collapsed.

@gruberroland
Copy link
Contributor

Fixed with
716d119

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

No branches or pull requests

2 participants