Skins not exporting / importing header image

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

Bug Description

Problems being fixed under this bug report are

Use the central default viewskin array from lib/skin.php when creating / updating / importing a skin so that any missing info can be supplied by default array

Exporting a skin with a header_background_image doesn't get added to the export and therefore not imported either

Revision history for this message
Robert Lyon (robertl-9) wrote :

This is a follow on for Bug 1877001

Changed in mahara:
importance: Undecided → High
status: New → In Progress
milestone: none → 20.10.0
Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :
Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Rangi Daymond (rangid) wrote :

Hi Robert - as mentioned in gerrit patchset #5, attached is the 19.04 site skin export file that was imported prior to edit.
Note: the font that was chosen for both the heading and text fonts was "Book antiqua".

Revision history for this message
Rangi Daymond (rangid) wrote :

Hi Robert - this is the 19-04 export file that should've provided a background image file.

Revision history for this message
Rangi Daymond (rangid) wrote :
Download full text (3.6 KiB)

Hi Robert - below are the messages displayed in response to me selecting the "Import" button after selecting the attached export file (created yesterday in Rel 19.10).
Note: I currently have patchset#8 applied.
Thank you, Rangi

[WAR] 28 (lib/errors.php:859) Failed to get a recordset: postgres8 error: [-2: ERROR: syntax error at or near "LIMIT"
LINE 1: SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2
                                                      ^] in adodb_throw(SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2, )Command was: SELECT * FROM "skin_fonts" WHERE "name" = ?
Call stack (most recent first):
log_message("Failed to get a recordset: postgres8 error: [-2: E...", 8, true, true) at /home/rdaymond/code/mahara/htdocs/lib/errors.php:95
log_warn("Failed to get a recordset: postgres8 error: [-2: E...") at /home/rdaymond/code/mahara/htdocs/lib/errors.php:859
SQLException->__construct("Failed to get a recordset: postgres8 error: [-2: E...") at /home/rdaymond/code/mahara/htdocs/lib/dml.php:540
get_recordset_sql("SELECT * FROM "skin_fonts" WHERE "name" = ? ", false, -1, 2) at /home/rdaymond/code/mahara/htdocs/lib/dml.php:359
get_record_sql("SELECT * FROM "skin_fonts" WHERE "name" = ? ", array(size 0), 1) at /home/rdaymond/code/mahara/htdocs/lib/dml.php:328
get_record("skin_fonts", "name", null) at /home/rdaymond/code/mahara/htdocs/lib/skin.php:723
Skin::get_path_to_previewfile(null, "text") at /home/rdaymond/code/mahara/htdocs/lib/skin.php:1093
Skin::generate_thumbnail(23) at /home/rdaymond/code/mahara/htdocs/lib/skin.php:266
Skin->commit() at /home/rdaymond/code/mahara/htdocs/lib/skin.php:170
Skin::create(array(size 5)) at /home/rdaymond/code/mahara/htdocs/skin/import.php:310
importskinform_submit(object(Pieform), array(size 4)) at /home/rdaymond/code/mahara/htdocs/lib/pieforms/pieform.php:568
Pieform->__construct(array(size 4)) at /home/rdaymond/code/mahara/htdocs/lib/pieforms/pieform.php:168
Pieform::process(array(size 4)) at /home/rdaymond/code/mahara/htdocs/lib/mahara.php:5464
pieform(array(size 4)) at /home/rdaymond/code/mahara/htdocs/skin/import.php:61
[WAR] 28 (lib/dml.php:540) Failed to get a recordset: postgres8 error: [-2: ERROR: syntax error at or near "LIMIT"
LINE 1: SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2
                                                      ^] in adodb_throw(SELECT * FROM "skin_fonts" WHERE "name" = ? LIMIT 2, )Command was: SELECT * FROM "skin_fonts" WHERE "name" = ?
Call stack (most recent first):
get_recordset_sql("SELECT * FROM "skin_fonts" WHERE "name" = ? ", false, -1, 2) at /home/rdaymond/code/mahara/htdocs/lib/dml.php:359
get_record_sql("SELECT * FROM "skin_fonts" WHERE "name" = ? ", array(size 0), 1) at /home/rdaymond/code/mahara/htdocs/lib/dml.php:328
get_record("skin_fonts", "name", null) at /home/rdaymond/code/mahara/htdocs/lib/skin.php:723
Skin::get_path_to_previewfile(null, "text") at /home/rdaymond/code/mahara/htdocs/lib/skin.php:1093
Skin::generate_thumbnail(23) at /home/rdaymond/code/mahara/htdocs/lib/skin.php:266
Skin->commit() at /home/rdaymond/code/mahara/htdocs/lib/skin.php:170
Skin::create(array(size 5)) at /home/rdaymond/code/mahara/htdocs/skin/import.php:3...

Read more...

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:
status: In Progress → Fix Committed
Revision history for this message
Rangi Daymond (rangid) wrote :

Catalyst QA Tested - PASSED

Please see the attached:
a) executed test cases document and
b) execution spreadsheet (see next comment).

Test scenarios:
Test scenario 1: Skins exported from 19.04 can be successfully imported
to the site that has the patch applied.
Test scenario 2: Skins exported from 19.10 can be successfully imported
to the site that has the patch applied.
Test scenario 3: Skins can be successfully created, exported, and imported
to the site that has the patch applied.

Revision history for this message
Rangi Daymond (rangid) wrote :

Attached test data and execution spreadsheet for previous comment.?field.comment=Attached test data and execution spreadsheet for previous comment.

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
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/11908

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.