upgrade problem with having the settings array

Bug #1372188 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
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')) {
            upgrade_plugin($data);
        }

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

Tags: regression
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/3708

Revision history for this message
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)
tags: added: regression
description: updated
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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)
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.