Fix pass by reference warning to _admin_select_check_access() in PHP 8.0+

Created on 15 August 2023, over 1 year ago

Problem/Motivation

In PHP 8.0 and above an E_WARNING is emitted because the array_map callback expects the parameter to be passed by reference: https://www.php.net/manual/en/function.array-map.phprefsect1-function.ar...

This happens when function _admin_select_check_access(&$item) is called by admin_select_get_admin_select_info() which calls $info = array_map('_admin_select_check_access', $info);.

Steps to reproduce

Use the module with PHP 8.0+

Proposed resolution

Remove the parameter reference. It is not needed, _admin_select_check_access() already returns $info.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇦🇺Australia fenstrat Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024