Font upload results in warning

Bug #1939471 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Doris Tam

Bug Description

The upload of a font results in the following warning:

[WAR] 5d (admin/site/font/install.php:326) Trying to access array offset on value of type null
Call stack (most recent first):

    log_message("Trying to access array offset on value of type nul...", 8, true, true, "/home/kristina/code/mahara/htdocs/admin/site/font/...", 326) at /home/kristina/code/mahara/htdocs/lib/errors.php:521
    error(8, "Trying to access array offset on value of type nul...", "/home/kristina/code/mahara/htdocs/admin/site/font/...", 326, array(size 20)) at /home/kristina/code/mahara/htdocs/admin/site/font/install.php:326
    addfontform_submit(object(Pieform), array(size 15)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:568
    Pieform->__construct(array(size 4)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:168
    Pieform::process(array(size 4)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:5452
    pieform(array(size 4)) at /home/kristina/code/mahara/htdocs/admin/site/font/install.php:136

-----------------

To replicate:

1. Go to Admin menu -> Configure site -> Fonts -> Install font.
2. Follow the instructions for uploading a Google font and upload the Zip file.

Expected result: The font is installed without error messages.
Actual result: The font is installed but an error message is produced.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :
Changed in mahara:
assignee: nobody → Doris Tam (doristam)
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/11923

Revision history for this message
Doris Tam (doristam) wrote :

This error is caused by there not being a licence file amongst the google font zip. In Mahara, in the licence column of the skin_fonts database table it is not a required field so I've updated the logic to match.

Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11923
Committed: https://git.mahara.org/mahara/mahara/commit/10bfdf898dff1e02060adb791ca44d828cdf6fb5
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 10bfdf898dff1e02060adb791ca44d828cdf6fb5
Author: Doris Tam <email address hidden>
Date: Tue Aug 17 11:27:12 2021 +1200

Bug 1939471: Match requirement for font licence file to db.

Not all Google font zip files come with a licence file. Our database table
'skin_fonts' doesn't have a constraint for either so I've
eased the logic to match. Otherwise, the form will throw an error
complaining about licence values missing.

Change-Id: I63801d017ad3fa89e4ab2e2f9c375f46b10fdb17

Robert Lyon (robertl-9)
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

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.