Best practice forum (Archived)

Program coding error detected

 
Sarah Cao
Program coding error detected
by Sarah Cao - Monday, 25 November 2013, 3:52 PM
 

I have an instance on 2.2.20, and get the following message: Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified. 

It appears when there are exceptions for time allowance. 'All users' was selected and then 'dismiss and take no action' when this error pops up and the exceptions were not acted on. It also appears when attempting to 'override and add program'.

Has this been fixed in an update already or is it a new bug? I saw in the 2.2.21 release notes "T-10875 Remove unresolved exceptions when users are unassigned from a Program" and wanted to check if it was the same. 

Simon Coggins
Re: Program coding error detected
by Simon Coggins - Monday, 25 November 2013, 4:08 PM
Group Totara

Hi Sarah,

It's a bit difficult to say if that's the same bug. Would you be able to turn debugging to developer level (Admin > Development > Debugging) then revisit the page and post a screenshot of the full error you get?

That would help us narrow down the exact cause and work out if it's the same issue or not.

Many thanks,

Simon

Sarah Cao
Re: Program coding error detected
by Sarah Cao - Tuesday, 26 November 2013, 10:03 AM
 

Hi Simon,

Here is the debug message:

Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified.

More information about this error

Stack trace:
    • line 1055 of /lib/dml/mysqli_native_moodle_database.php: coding_exception thrown
    • line 1111 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
    • line 233 of /totara/program/program_exception.class.php: call to mysqli_native_moodle_database->update_record()
    • line 143 of /totara/program/program_exception.class.php: call to prog_exception->dismiss_exception()
    • line 270 of /totara/program/program_exception.class.php: call to prog_exception->handle()
    • line 70 of /totara/program/exception/resolve.php: call to time_allowance_exception->handle()

 

Best,

Sarah

 

Sarah Cao
Re: Program coding error detected
by Sarah Cao - Monday, 2 December 2013, 9:03 AM
 

Any idea if this was fixed in an update or new?

 

Simon Coggins
Re: Program coding error detected
by Simon Coggins - Monday, 2 December 2013, 1:23 PM
Group Totara

That looks like a new bug, we will get someone to take a look now.

Simon

? ?
Re: Program coding error detected
by ? ? - Thursday, 9 January 2014, 5:06 PM
 

Hi Sarah,

Apologies for the delay on this one.

It looks like your issue is related to the fix in 2.2.21 and is due to assignment records not being properly cleared up when users are unassigned, so the code is attempting to remove an exception that doesn't really exist.

I'd recommend an upgrade to 2.2.23 as both 2.2.21 and 2.2.23 contain fixes in this area. 2.2.23 also contains various Security fixes for both Totara and Moodle so you are probably best to upgrade to at least that point anyway - the latest 2.2 is 2.2.26.

Hope that helps,

Ciaran