Skins not showing after upgrade

Bug #1877001 reported by Robert Lyon
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
19.10
Fix Released
High
Unassigned
20.04
Fix Released
High
Unassigned
20.10
Fix Released
High
Robert Lyon

Bug Description

When upgrading from an older site to 19.10+ site the skins stop showing on pages

and there are error messages in the logs regarding this

* error(8, "Undefined index: view_block_header_font", "/var/www/skin/style.php", 82, array(size 68)) at /var/www/skin/style.php:82

We need an upgrade step to add in blank values for the 2 new fields

view_block_header_font
view_block_header_font_color

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

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

commit 4dafcd904f8f814ce5898e2794f8dce1eb102713
Author: Robert Lyon <email address hidden>
Date: Wed May 6 10:30:47 2020 +1200

Bug 1877001: Sorting out old skins when upgrading

Now that we have some new fields

Change-Id: Ic7f153e498a58af161c87cc1f0f35e132948aac1
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 "20.04_STABLE" branch: https://reviews.mahara.org/10962

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

Reviewed: https://reviews.mahara.org/10962
Committed: https://git.mahara.org/mahara/mahara/commit/65f6920800727dbcb4c57b5f0d3aaa8417a07bec
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 20.04_STABLE

commit 65f6920800727dbcb4c57b5f0d3aaa8417a07bec
Author: Robert Lyon <email address hidden>
Date: Wed May 6 10:30:47 2020 +1200

Bug 1877001: Sorting out old skins when upgrading

Now that we have some new fields

Change-Id: Ic7f153e498a58af161c87cc1f0f35e132948aac1
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 "19.10_STABLE" branch: https://reviews.mahara.org/10963

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

Reviewed: https://reviews.mahara.org/10963
Committed: https://git.mahara.org/mahara/mahara/commit/86671b0f1c0f51e4bf73ebfa9c7a6658cf7578f0
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 19.10_STABLE

commit 86671b0f1c0f51e4bf73ebfa9c7a6658cf7578f0
Author: Robert Lyon <email address hidden>
Date: Wed May 6 10:30:47 2020 +1200

Bug 1877001: Sorting out old skins when upgrading

Now that we have some new fields

Change-Id: Ic7f153e498a58af161c87cc1f0f35e132948aac1
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 "master" branch: https://reviews.mahara.org/10964

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

Reviewed: https://reviews.mahara.org/10964
Committed: https://git.mahara.org/mahara/mahara/commit/04382251a5e08325835be3b747dfa35b2f9ba5cc
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 04382251a5e08325835be3b747dfa35b2f9ba5cc
Author: Robert Lyon <email address hidden>
Date: Fri May 8 14:00:09 2020 +1200

Bug 1877497: Sorting out problems with skin export / import

This is a follow on for Bug 1877001

Fixed:
- using a defaultviewskin array so tha
1) all options are in one place
2) when importing older skins it sets missing values
3) when editing an older skin it only saves keys for what we have
defined in default options

- adding header_background_image to the export

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

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 20.10.0 → none
Revision history for this message
Ghada El-Zoghbi (ghada-z) wrote :

Hi @robert,

We're applied all these fixes and we're still seeing the error in the error logs:

Aug 9 15:35:04 cff35e4bccaa ecs_mahara_prod: 2021/08/09 15:35:04 [error] 216#216:
*2055 FastCGI sent in stderr: "PHP message: [WAR] 8b (skin/style.php:82) Undefined index: view_block_header_font
#012PHP message: Call stack (most recent first):
#012PHP message: * log_message(string(size 39), integer, true, true, string(size 28), integer) at /var/www/site/lib/errors.php:515
#012PHP message: * error(integer, string(size 39), string(size 28), integer, array(size 67)) at /var/www/site/skin/style.php:82
#012PHP message:
#012PHP message: [WAR] 8b (lib/errors.php:853) Failed to get a recordset:
postgres8 error: [-2: ERROR: syntax error at or near "LIMIT"
#012PHP message: [WAR] 8b (lib/errors.php:853) LINE 1: SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2
#012PHP message: [WAR] 8b (lib/errors.php:853) ^] in EXECUTE("SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2")Command was: SELECT * FROM "skin_fonts" WHERE "name" = ?
#012PHP message: Call stack (most recent first):
#012PHP message: * log_message(string(size 333), integer, true, true) at /var/www/site/lib/errors.php:89
#012PHP message: * log_warn(string(size 333)) at /var/www/site/lib/errors.php:85
#012PHP message: * SQLException->__construct(string(size 333)) at /var/www/site/lib/dml.php:541
#012PHP message: * get_recordset_sql(string(size 45), false, integer, integer) at /var/www/site/lib/dml.php:360
#012PHP message: * get_record_sql(string(size 45), array(size 0), integer) at /var/www/site/lib/dml.php:329
#012PHP message: * get_record(string(size 10), string(size 4), null) at /var/www/site/lib/skin.php:606
#012PHP message: * Skin::get_css_font_family_from_font_name(null) at /var/www/site/skin/style.php:82
#012PHP message:
#012PHP message: [WAR] 8b (lib/dml.php:541) Failed to get a recordset: postgres8 error: [-2: ERROR: syntax error at or near "LIMIT"
#012PHP message: [WAR] 8b (lib/dml.php:541) LINE 1: SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2
#012PHP message: [WAR] 8b (lib/dml.php:541) ^] in EXECUTE("SELECT * FROM "skin_fonts"

I think the fix needs to also apply to htdocs/lib/skins.php line 601:

if ($font === '') {

=>

if (empty($font)) {

That should catch it when it's null, '', or not set.

Thank you.
Ghada

no longer affects: mahara
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.