← Back to team overview

mahara-contributors team mailing list archive

[Bug 1945537] Re: Problem with saving web service log message event when float is in another language

 

Testing this was difficult as it involves setting up a webservice on a
development environment.

In the current patchset I've stripped out the writing of the log into
its own method and have added a phpunit test that checks it.  It also
checks if the desired locale is available before testing so it will skip
the test if not.

We will want to add the locale to Jenkins to get this into a pass state.
As I understand it though, skipping the test should not put the phpunit
test into a "fail" state so it should still run.

Testing:
Ensure one of the locals for "Dutch" is available (see note #3 above)
Back up your DB
Run 'make phpunit'

PHPUnit isn't cleaning up its tables correctly at the moment. You will
need to restore your DB to rerun the phpunit tests.  I'll create a Bug
for the cleanup.

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1945537

Title:
  Problem with saving web service log message event when float is in
  another  language

Status in Mahara:
  In Progress

Bug description:
  Initially reported at
  https://mahara.org/interaction/forum/topic.php?id=8930

  So  for example we try to save number as 1,2345 instead of 1.2345

  We probably need to cast it via flotval somehow

  Error looks like this
  PHP Fatal error:  Uncaught SQLException: Failed to get a recordset: postgres8 error: [-1: ERROR:  invalid input syntax for type numeric: "0,12291693687439"] in EXECUTE("INSERT INTO "external_services_logs" ("id", "timelogged", "userid", "externalserviceid", "protocol", "auth", "functionname", "timetaken", "uri", "info", "ip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "external_services_logs" ("id", "timelogged", "userid", "externalserviceid", "protocol", "auth", "functionname", "timetaken", "uri", "info", "ip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (id:109,timelogged:1632941361,userid:23,externalserviceid:3,protocol:REST,auth:OTHER,functionname:module_mobileapi_upload_blog_post,timetaken:0,12291693687439,uri:/webservice/rest/server.php?alt=json,info:exception:SQLExceptionmessage:Failedtogetarecordset:postgres8error:[-1:ERROR:invalidinputsyntaxfortypenumeric:"0,11438679695129"]inEXECUTE("INSERTINTO"external_services_logs"("id","timelogged","userid","externalserviceid","protocol","auth"

  The problem looks to be related to:

  The variable "time_taken" in file:

  htdocs/webservice/lib.php

   $time_taken = $time_end - $WEBSERVICE_START;

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



References