Example plugin issue

Bug #1356563 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Aaron Wells

Bug Description

https://mahara.org/interaction/forum/topic.php?id=6412

Mahara 1.10dev:

Basically if the sample module is installed and is not hidden then the setting, messages, and Logout menus are not displayed. If I hide the module then they are.

Tags: regression
Changed in mahara:
assignee: nobody → Aaron Wells (u-aaronw)
milestone: none → 1.10.0
Revision history for this message
Aaron Wells (u-aaronw) wrote :

I was able to replicate the issue. Here's the underlying error:

[WAR] 9c (lib/mahara.php:1577) call_user_func_array() expects parameter 1 to be a valid callback, class 'PluginModuleSample' does not have a method 'menu_items'
Call stack (most recent first):

    log_message("call_user_func_array() expects parameter 1 to be a...", 8, true, true, "/home/aaronw/www/mahara/htdocs/lib/mahara.php", 1577) at /home/aaronw/www/mahara/htdocs/lib/errors.php:439
    error(2, "call_user_func_array() expects parameter 1 to be a...", "/home/aaronw/www/mahara/htdocs/lib/mahara.php", 1577, array(size 3)) at Unknown:0
    call_user_func_array(array(size 2), array(size 0)) at /home/aaronw/www/mahara/htdocs/lib/mahara.php:1577
    call_static_method("PluginModuleSample", "menu_items") at /home/aaronw/www/mahara/htdocs/lib/web.php:2696
    right_nav() at /home/aaronw/www/mahara/htdocs/lib/web.php:516
    smarty() at /home/aaronw/www/mahara/htdocs/admin/index.php:65

[WAR] 9c (lib/web.php:2697) array_merge(): Argument #2 is not an array
Call stack (most recent first):

    log_message("array_merge(): Argument #2 is not an array", 8, true, true, "/home/aaronw/www/mahara/htdocs/lib/web.php", 2697) at /home/aaronw/www/mahara/htdocs/lib/errors.php:439
    error(2, "array_merge(): Argument #2 is not an array", "/home/aaronw/www/mahara/htdocs/lib/web.php", 2697, array(size 8)) at Unknown:0
    array_merge(array(size 12), null) at /home/aaronw/www/mahara/htdocs/lib/web.php:2697
    right_nav() at /home/aaronw/www/mahara/htdocs/lib/web.php:516
    smarty() at /home/aaronw/www/mahara/htdocs/admin/index.php:65

Changed in mahara:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Aaron Wells (u-aaronw) wrote :

The problem was that a subsequent patch added a requirement that every module has to implement a public static "menu_items()" method. I've pushed a fix patch, which provides an empty implementation of this method.

tags: added: regression
Revision history for this message
Aaron Wells (u-aaronw) wrote :

The gerrit patch didn't get posted to this bug for some reason: https://reviews.mahara.org/#/c/3629/

Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3629
Committed: http://gitorious.org/mahara/mahara/commit/2dd9526a8fa6b3be3654f507f49049c57357ef86
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 2dd9526a8fa6b3be3654f507f49049c57357ef86
Author: Aaron Wells <email address hidden>
Date: Thu Aug 14 08:38:53 2014 +1200

Adding a default empty "menu_items()" method for interactions & modules

Bug 1356563

Change-Id: Ic238ab691e1738e5e28f13606c7da4862d1b4d9c

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.