Warning Undefined property: stdClass::$name on upgrade

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

Bug Description

We have a mechanism where is the database information about a plugin is newer than the plugin's file information we:
 (in production mode) warn the user before upgrade
 (not in production mode) display the problem on admin dashboard after upgrade

But there is a problem if the plugin doesn't set a display name or a fallback $config->name

We need to allow the plugin to display it's path name so as to be slightly helpful.

To test:
Have a fully upgraded site then:
1) Set the config version back one day, eg:
UPDATE config SET value = value::int - 100 WHERE field = 'version';

2) Update a plugin's installed value forward one day, eg:
UPDATE artefact_installed SET version = version::int + 100 WHERE name = 'resume';
UPDATE search_installed SET version = version::int + 100 WHERE name = 'elasticsearch';

Before patch - you should see warning when not in production mode

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Robert Lyon (robertl-9)
milestone: none → 18.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8549
Committed: https://git.mahara.org/mahara/mahara/commit/a1970027b0c5a0e01aad1f223e6f3f276237d8db
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit a1970027b0c5a0e01aad1f223e6f3f276237d8db
Author: Robert Lyon <email address hidden>
Date: Thu Mar 1 07:16:52 2018 +1300

Bug 1752389: Undefined property: stdClass::$name on upgrade

This is when plugins are out of sync and the plugin doesn't have
$config->name defined

We should fall back to the plugin path as the name

behatnotneeded

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

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