The logic to determine whether to subvert the display of the "sudo" button uses is_array to test $sudo_roles, which presumably used to be FALSE when there were no sudo roles available, but which now returns array() in such a case. This patch corrects the problem by replacing is_array() with !empty(); however, there is a php oddity in that variable assignment is allowed within is_array(), but it is disallowed within a call to empty(). This patch therefore needed to increase the verbosity of the existing code slightly. The form chosen was selected to minimize the size of the resulting diff; a nested-if structure might be more pleasing for the final result.

CommentFileSizeAuthor
sudo-button.patch759 bytesgreg.1.anderson

Comments

dnotes’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Closing 6.x issues.