moodle mahara submissions appear to have a limit

moodle mahara submissions appear to have a limit

by Charles Horton -
Number of replies: 2

moodle 3.4.3+, php 7.1.23, windows server 2016 

mahara 18.04.2, 7.0.30, windows server 2016 

We have been running mahara submissions for at least 5 years but I don't think I have come across this before. 

The link between the two systems appears to be running fine, the sso and key rotating works, however we have had a number of users say that their pages are not being listed on the assignment submission page. On further investigation , the affected users seem to have more than 4 pages on mahara, those with less work fine. I have backtracked the usual suspects (apache.conf, php.ini etc) and they seem fine. 

The only error I can find is 

[12-Nov-2018 10:30:59 Europe/London] PHP Notice:  None of our keys could open the payload from host https://xxxx.xxx.ac.uk  with id 3. in E:\public_html\mnet\xmlrpc\client.php on line 230

Back tracing that it seems the payload seems to be garbage for those with a list larger than 4, under 4 it comes back properly formed.

Anybody come across this before?

Average of ratings: -
In reply to Charles Horton

Re: moodle mahara submissions appear to have a limit

by Michele Balazs -

Hi

Did you fix this ?

In reply to Michele Balazs

Re: moodle mahara submissions appear to have a limit

by Charles Horton -

I did in the end, after a lot of debugging and following the data I traced the issue to PHP's parse in /mnet/xmlrpc/xmlparser.php function not liking the payload after it got to a certain size and it was generating unpredictable outputs. To fix it I added to the parse function

//add

$data_len = strlen($data);

$data_offset = 0;

$chunk_size = 4194304; // 4m

while ($data_offset < $data_len )

{

$data_to_parse = substr($data, $data_offset, $chunk_size);

$data_offset += $chunk_size;


// Parse!

if (!$p=xml_parse($this->parser, $data_to_parse, ($data_offset > $data_len)))

{

$this->error_code = xml_get_error_code($xml);

$this->error_string = xml_error_string($this->error_code);

$return = false;

}

}//end of add

        // comment out line below

// $p = xml_parse($this->parser, $data);


I know its a core hack but it seems to do the job.


Hope this maybe helps someone.