Missing cacheversion on upgrade gives errors

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

Bug Description

When upgrading from old version that doesn't have cacheversion set we get this error

[WAR] 21 (lib/htmlpurifier/HTMLPurifier/Config.php:901) Value for HTML.DefinitionRev is of invalid type, should be int invoked on line 3598 in file /home/robertl/htdocs/mahara-devel/mahara/htdocs/lib/web.php

It doesn't stop the upgrade from progressing, so I'll mark this bug as low priority, but could freak user out when upgrading their sites.

It would be good to allow get_config() function to take a $default value option, similar to how param_alpha() works.

This way we can set a default value before the upgrade sets the correct value

So I'm thinking get_config('cacheversion', 0); would return value '0' rather than false so that htmlpurifier does not complain but still allows for the upgrade to set the cacheversion as expected.

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

Reviewed: https://reviews.mahara.org/6359
Committed: https://git.mahara.org/mahara/mahara/commit/d7c297f1c83ee153c1c496f091b70b819cab2a26
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit d7c297f1c83ee153c1c496f091b70b819cab2a26
Author: Robert Lyon <email address hidden>
Date: Tue Apr 19 13:06:51 2016 +1200

Bug 1571910: Set placeholder cacheversion before upgrade

Allow get_config to supply a default so that system can handle misisng
config values during upgrade from older sites that are meant to be set
duing upgrade, eg 'cacheversion'

behatnotneeded - upgrade issue

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

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

Patch for "16.04_STABLE" branch: https://reviews.mahara.org/6410

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

Reviewed: https://reviews.mahara.org/6410
Committed: https://git.mahara.org/mahara/mahara/commit/a26871c334891c60f2a2703d85ddd0c1895e044d
Submitter: Aaron Wells (<email address hidden>)
Branch: 16.04_STABLE

commit a26871c334891c60f2a2703d85ddd0c1895e044d
Author: Robert Lyon <email address hidden>
Date: Tue Apr 19 13:06:51 2016 +1200

Bug 1571910: Set placeholder cacheversion before upgrade

Allow get_config to supply a default so that system can handle misisng
config values during upgrade from older sites that are meant to be set
duing upgrade, eg 'cacheversion'

behatnotneeded - upgrade issue

Change-Id: Ieaea390d57c18f3bc3e0808026ec1e76636bcc15
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit d7c297f1c83ee153c1c496f091b70b819cab2a26)

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.