vfremaux / moodle-block_use_stats

Time based use stats block
6 stars 6 forks source link

Error Reading from Database - Debug info: ORA-00920: invalid relational operator #5

Open Claire7179 opened 11 years ago

Claire7179 commented 11 years ago

Any ideas on how to overcome this? I installed the report training session and the block use stats successfully. I go to put the use stats on the course page and this error pops up. Debug info: ORA-00920: invalid relational operator

SELECT id, course, action, time, module, userid, cmid FROM m_log WHERE time > :o_param1 AND time < :o_param2 AND ((course = 1 AND action = 'login') OR (1 )) AND userid = 88084 ORDER BY time

[array ( 'o_param1' => 1377786166, 'o_param2' => 1377786166, )] Error code: dmlreadexception Stack trace: line 423 of \lib\dml\moodle_database.php: dml_read_exception thrown line 272 of \lib\dml\oci_native_moodle_database.php: call to moodle_database->query_end() line 1088 of \lib\dml\oci_native_moodle_database.php: call to oci_native_moodle_database->query_end() line 66 of \blocks\use_stats\locallib.php: call to oci_native_moodle_database->get_recordset_sql() line 83 of \blocks\use_stats\block_use_stats.php: call to use_stats_extract_logs() line 292 of \blocks\moodleblock.class.php: call to block_use_stats->get_content() line 238 of \blocks\moodleblock.class.php: call to block_base->formatted_contents() line 951 of \lib\blocklib.php: call to block_base->get_content_for_output() line 1003 of \lib\blocklib.php: call to block_manager->create_block_contents() line 353 of \lib\blocklib.php: call to block_manager->ensure_content_created() line 9 of \theme\formal_white\layout\general.php: call to block_manager->region_has_content() line 847 of \lib\outputrenderers.php: call to include() line 777 of \lib\outputrenderers.php: call to core_renderer->render_page_layout() line 240 of \course\view.php: call to core_renderer->header()

vfremaux commented 11 years ago

Hi Claire, could you please precise what is your Database engine ? thanks

vfremaux commented 11 years ago

ORA Would seem you are running under Oracle, or ?

Claire7179 commented 11 years ago

Hi, We are using Oracle version 10.

I hope this helps,

CLAIRE

Erika31 commented 5 years ago

Just replace : ... (1 $courseclause)) ... With : ... (1=1 $courseclause)) ...

In the 2 SQL strings in "locallib.php", function "use_stats_extract_logs"... ;-)

vfremaux commented 5 years ago

Changes commited from 3.5 to 3.7