Best practice forum (Archived)

Filtering on a new report causing error - Totara 2.2.4

 
? ?
Filtering on a new report causing error - Totara 2.2.4
by ? ? - Monday, 24 September 2012, 9:19 AM
 

Hi
I've just created a new report on our partner site which initially displayed the expected result. When I attempted to filter the data, I was shown an 'error reading from database' message. This is now displayed consistantly when attempting to view the report with the same user, in the same firefox browser. I was also able to reproduce this using Chrome too with a different user.

Our Support has reported "the problem is related to the query that generates the report with that filter. All the other filters are working, but when you use that filter, the query fails because of the reason below and requires develop work to resolve:

Debug info: ERROR: invalid input syntax for integer: "29,30,31" SELECT COUNT(*) FROM mdl_cohort_members base LEFT JOIN mdl_pos_assignment position_assignment ON (position_assignment.userid = base.userid AND position_assignment.type = 1) WHERE ( 1=1 ) AND position_assignment.positionid = $1

Before I engage our team here to resolve, has anyone else experienced or reported such an issue? 

Thanks
James

David Curry (Core Developer)
Re: Filtering on a new report causing error - Totara 2.2.4
by David Curry (Core Developer) - Monday, 24 September 2012, 9:10 PM
Group Totara

Hi James,

I haven't been able to recreate this here. Could you tell me which report and what filters you were using (and anything else relevant) so I can look into it?

Cheers
David

? ?
Re: Filtering on a new report causing error - Totara 2.2.4
by ? ? - Wednesday, 26 September 2012, 3:34 AM
 

Hi David

I was testing the Audience Management function and created a very simple report with source 'Cohort_Members' called Training Team to report on those users within the Audience. 

It was really simple and only displayed the Users Fullnames and Participants Current Position (basic) which displayed the information from an Audience.  It was when I filtered on Participants Current Position (basic) = 'Head of Learning of Learning and Development/Training Manager (all her children)'.  Which I clicked Search to view the report displaying the same message.

Does that help?

Cheers

James

David Curry (Core Developer)
Re: Filtering on a new report causing error - Totara 2.2.4
by David Curry (Core Developer) - Wednesday, 26 September 2012, 9:23 PM
Group Totara
Hi James,

Looking into this further I found a patch that should have fixed this in 2.2.3, can you double check your version of totara? settings>site administration>notifications just under the big totara logo there should be the totara version.
If you are on 2.2.3 or higher please check that this change has been made in the code.
/totara/reportbuilder/filters/select.php lines #171 and #177 should both read ...$DB->get_in_or_equal(...  instead of the old $param = $value.

Let me know how you get on. and unless you have javascript turned off for a specific reason there is always the non basic version of that filter to try.

Cheers
David
? ?
Re: Filtering on a new report causing error - Totara 2.2.4
by ? ? - Friday, 28 September 2012, 1:50 AM
 

Hi David

It looks like this is 2.2.0 (not sure where I got 2.2.4 from!) so will look to schedule an upgrade to 2.2.3 or higher.

Will let you know how we get on.

Thanks again

James

David Curry (Core Developer)
Re: Filtering on a new report causing error - Totara 2.2.4
by David Curry (Core Developer) - Sunday, 30 September 2012, 6:18 PM
Group Totara

Hey James,

You didn't pull the version number out of thin air, Totara 2.2.0 is built on Moodle 2.2.4, people get them mixed up all the time. I believe we made some improvements to how the two show up just last patch to make it less confusing.

Cheers
David