← Back to team overview

mahara-contributors team mailing list archive

[Bug 1606435] Re: Not sending enough parameters to "useroverquotathreshold" lang string

 

To replicate (case 1):

1. Log in as admin
2. Go to "Contents -> Files" and upload a 1 MB file.
3. Go to "Administration -> Institutions" and click "Add institution" to create a new institution.
4. Give the new institution the name "Institution A" and save it.
5. Go to "Administration -> Institutions -> Members" and add the admin user to Institution A.
6. Go to "Administration -> Institutions" and click the edit link for Institution A, to go to the edit config page.
7. Set "Default quota" to 500 Kilobytes, and "Update user quotas" to "Yes".
8. Click "Submit"

Expected result: You see a notification telling you that you are now over the quota.
Actual result: You see the "Too few parameters" warning message in the error logs, and you see an empty pink session message area on the page.

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1606435

Title:
  Not sending enough parameters to "useroverquotathreshold" lang string

Status in Mahara:
  In Progress

Bug description:
  The lang string "useroverquotathreshold" in artefact.file.php expects
  three sprintf parameters, but in the two places we use it, we only use
  one parameter. As a result, it prints a warning message to the error
  logs, and the string it should print is replaced with an empty string.

  Here's the warning message:

   [WAR] 37 (lib/mahara.php:1418) sprintf(): Too few arguments
   Call stack (most recent first):
     * log_message("sprintf(): Too few arguments", 8, true, true, "/home/aaronw/www/mahara/htdocs/lib/mahara.php", 1418) at /home/aaronw/www/mahara/htdocs/lib/errors.php:489
     * error(2, "sprintf(): Too few arguments", "/home/aaronw/www/mahara/htdocs/lib/mahara.php", 1418, array(size 3)) at Unknown:0
     * sprintf("User %s has arrived at %s%% percent of their %s qu...", "user1 user1 (user1)") at Unknown:0
     * call_user_func_array("sprintf", array(size 2)) at /home/aaronw/www/mahara/htdocs/lib/mahara.php:1418
     * format_langstring("User %s has arrived at %s%% percent of their %s qu...", array(size 1), "en.utf8") at /home/aaronw/www/mahara/htdocs/lib/mahara.php:505
     * get_string_location("useroverquotathreshold", "artefact.file", array(size 1)) at /home/aaronw/www/mahara/htdocs/lib/mahara.php:294
     * get_string("useroverquotathreshold", "artefact.file", "user1 user1 (user1)") at /home/aaronw/www/mahara/htdocs/admin/users/edit.php:405
     * edituser_site_submit(object(Pieform), array(size 16)) at Unknown:0
     * call_user_func_array("edituser_site_submit", array(size 2)) at /home/aaronw/www/mahara/htdocs/lib/pieforms/pieform.php:540
     * Pieform->__construct(array(size 6)) at /home/aaronw/www/mahara/htdocs/lib/pieforms/pieform.php:161
     * Pieform::process(array(size 6)) at /home/aaronw/www/mahara/htdocs/lib/mahara.php:4730
     * pieform(array(size 6)) at /home/aaronw/www/mahara/htdocs/admin/users/edit.php:265

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1606435/+subscriptions


References