upgrade problem with having the settings array

Bug #1372188 reported by Robert Lyon on 2014-09-21
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Robert Lyon

Bug Description

Now that we have a 'settings' array in check_upgrades() (see Bug 1367998) it can never return false so if we do something like

        if ($data = check_upgrades('blocktype.text')) {

it will fail if it's already installed as it returns the 'settings' array

So we need to add to the upgrade_plugin() function a check to see if $upgrade->name has been passed otherwise bail out

Aaron Wells (u-aaronw) wrote :

Hm, check_upgrades() should only add the "settings" array to the output if it is run with a null parameter, not if it's run for a specific plugin like in your example. I'll take a look, maybe it's not acting the way I meant it to.

Aaron Wells (u-aaronw) on 2014-09-22
tags: added: regression
description: updated

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

commit d4b6416f496e022f1f54e6bcc4b1906a48ccd3e9
Author: Aaron Wells <email address hidden>
Date: Mon Sep 22 18:43:11 2014 +1200

Make check_upgrade() return an empty array if requested plugin doesn't need an update

Bug 1372188: If you supply a component for check_upgrade() to query and the component
doesn't need an upgrade, it's supposed to return an empty array. It was instead returning
an array with a "settings" component.

Change-Id: I01d2406605eacb0b48681317beb969311a06064b

Robert Lyon (robertl-9) on 2014-09-22
Changed in mahara:
status: In Progress → 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