get_default_category() not robust enough

Bug #1315960 reported by Robert Lyon on 2014-05-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
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

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) on 2014-07-08
Changed in mahara:
status: Confirmed → Fix Committed
Aaron Wells (u-aaronw) on 2014-10-21
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers