Commit 1932d334 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1758757: setup_links() expected to be a reference, value given error



We used call_user_func() but i think we need to use
call_user_func_array() for this

behatnotneeded

Change-Id: I94dad0b59be8bab7ac6b2e1c45a6968ac4ece9fa
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent ba36e509
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -396,16 +396,9 @@ class PluginExportLeap extends PluginExport {
        foreach (plugins_installed('artefact') as $plugin) {
            $classname = 'LeapExportElement' . ucfirst($plugin->name);
            if (is_callable($classname . '::setup_links')) {
                // You must explicitly pass variables by reference when calling
                // call_user_func, or else they get copied automatically.
                // Using a dummy variable here to avoid the "Call time pass by reference
                // is deprecated" warning that php displays on the screen.
                $dummyref =& $this->links;
                call_user_func(
                call_user_func_array(
                    array($classname, 'setup_links'),
                    $dummyref,
                    array_keys($this->views),
                    array_keys($this->artefacts)
                    array(&$this->links, array_keys($this->views), array_keys($this->artefacts))
                );
            }
        }