Errors on Calculation Tab

Errors on Calculation Tab

by Kimber Warden -
Number of replies: 5

When I click on the Calculation Tab, the page displays but I get these errors:

Warning: array_shift() expects parameter 1 to be array, object given in /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/component.class.php on line 76

Warning: Invalid argument supplied for foreach() in /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/component.class.php on line 78


When I click on the Add button, the page does not display and I just get an otherwise blank screen that says:

Warning: array_shift() expects parameter 1 to be array, object given in /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/component.class.php on line 76

Warning: Invalid argument supplied for foreach() in /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/component.class.php on line 78

Warning: array_shift() expects parameter 1 to be array, object given in /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/sum/plugin.class.php on line 68

Warning: Invalid argument supplied for foreach() in /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/sum/plugin.class.php on line 70

Warning: Cannot modify header information - headers already sent by (output started at /var/www/moodle2-dev/moodle/blocks/configurable_reports/components/calcs/component.class.php:76) in /var/www/moodle2-dev/moodle/blocks/configurable_reports/editplugin.php on line 203


What do I need to do? I'm using Moodle 2.2.

Average of ratings: -
In reply to Kimber Warden

Re: Errors on Calculation Tab

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Plugin developers Picture of Testers

Hi Kimber,

this was fixed in the last version

You can download it here:

https://github.com/jleyva/moodle-block_configurablereports/zipball/MOODLE_21_STABLE

Please, give me some feedback if it doesn't work for you

Regards

In reply to Juan Leyva

Re: Errors on Calculation Tab

by Kimber Warden -

Oh, cool. Sometimes it's hard to find the latest versions of blocks!

Do I just overwrite the contents of my existing /configurable_reports folder? Or do I need to uninstall the old block and then install the new one?

In reply to Kimber Warden

Re: Errors on Calculation Tab

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Plugin developers Picture of Testers

Just overwrite

Regards

In reply to Juan Leyva

Re: Errors on Calculation Tab

by Trent Vu -

Hello, I've been looking for a solution to this error I'm getting and this is the closest forum topic to what I'm experiencing with my Moodle 2.2 version.

I'm getting an error which I'm pasting below:

Warning: array_shift() expects parameter 1 to be array, null given in /home/content/23/9273223/html/Moodle/course/lib.php on line 2438

It points me to the print_course function.  I did add a new div for this function to highlight courses within a specific category the same color.  Here's what I added:

echo html_writer::start_tag('div', array('class'=>'category'. $course->id));

And then I closed it at the end with:

echo html_writer::end_tag('div'); // End of category background div

Any thoughts to why I'm getting this error?

In reply to Juan Leyva

Re: Errors on Calculation Tab

by Sarah Hasanloo Nikfar -

Hi,

When I do 'Creating a SQL Report ' first sample from:

docs.moodle.org/25/en/blocks/configurable_reports   ---> Creating a SQL Report

Add this query (Courses activity):

SELECT COUNT(l.id) hits, l.course courseId, c.fullname coursename
FROM prefix_log l INNER JOIN prefix_course c ON l.course = c.id
GROUP BY courseId
ORDER BY hits DESC

Go to Calculations Tab

Add a Sum calculation, choose the hits column
Go to Plot

Add a Pie graph, choosing coursename as Name and hits as value

So, here you have a report with a Graph and calculations based on a SQL Query.

I can't see calculations based on a SQL Query  because of this error:

Coding error detected, it must be fixed by a programmer: PHP catchable fatal error

please help me!