get_default_category() not robust enough

Bug #1315960 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Robert Lyon

Bug Description

when testing out a new plugin I found the check in View->get_default_category() caused problems if there was nothing set with sort order = 0 or if the blocktypes of the item with sort order = 0 were hidden on extensions page.

The problem stems from not trying to get the first item in array but the item with key = 0.

will add patch for fix

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3313

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3313
Committed: http://gitorious.org/mahara/mahara/commit/7af04a15caa0845f1a0edfa4be5e87079dd65c2c
Submitter: Yuliya Bozhko (<email address hidden>)
Branch: master

commit 7af04a15caa0845f1a0edfa4be5e87079dd65c2c
Author: Robert Lyon <email address hidden>
Date: Mon May 5 11:02:03 2014 +1200

Default category first item not always key '0' (Bug #1315960)

If no category with key = '0' it causes an error so we need to get
first item in array rather than item with key = 0

Change-Id: I4c8adc45944704205fccbdaa3259ad27998b9430
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → 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.