Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with moodle 3.2 and oracle #97

Open
npizarrod opened this issue Oct 30, 2017 · 2 comments
Open

problems with moodle 3.2 and oracle #97

npizarrod opened this issue Oct 30, 2017 · 2 comments

Comments

@npizarrod
Copy link

I am working with moodle 3.2.3+ and Oracle database. When you add a Assign, the following error appears. And it does not allow to navigate the course.
Debug info: ORA-00933: SQL command not properly ended
SELECT a.id, count(1) AS submissionsenabled
FROM m_m_assign a
JOIN m_m_assign_plugin_config ac ON ac.assignment = a.id
WHERE a.course = :o_param1
AND ac.name='enabled'
AND to_char(ac.value) = '1'
AND ac.subtype='assignsubmission'
AND plugin!='comments'
GROUP BY a.id;
[array (
'o_param1' => '2',
)]
Error code: dmlreadexception

Stack trace:
line 479 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 277 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
line 1179 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
line 214 of /theme/snap/classes/activity.php: call to oci_native_moodle_database->get_records_sql()
line ? of unknownfile: call to theme_snap\activity::assign_meta()
line 41 of /theme/snap/classes/activity.php: call to call_user_func()
line 532 of /theme/snap/classes/output/core/course_renderer.php: call to theme_snap\activity::module_meta()
line 230 of /theme/snap/classes/output/core/course_renderer.php: call to theme_snap\output\core\course_renderer->module_meta_html()
line 63 of /theme/snap/classes/output/core/course_renderer.php: call to theme_snap\output\core\course_renderer->course_section_cm()
line 954 of /course/renderer.php: call to theme_snap\output\core\course_renderer->course_section_cm_list_item()
line 333 of /theme/snap/classes/output/format_section_trait.php: call to core_course_renderer->course_section_cm_list()
line 388 of /theme/snap/classes/output/format_section_trait.php: call to theme_snap\output\format_topics_renderer->course_section()
line 56 of /course/format/topics/format.php: call to theme_snap\output\format_topics_renderer->print_multiple_section_page()
line 282 of /course/view.php: call to require()

@gthomas2
Copy link
Contributor

I don't have an oracle db that I can use to test against. However, I'm guessing it's because the SQL has a semi colon at the end which might suggest to Oracle that another statement is expected.

Could you please try removing the semi colon inside the string on line 213 of this file:

theme/snap/classes/activity.php

So:

              GROUP BY a.id;";

becomes

              GROUP BY a.id";

Please let me know if this fixes the problem. Thanks

@npizarrod
Copy link
Author

Thank you very much, but another error appears. The prefix of the name of the tables is repeated and it does not recognize them.
Example:
m_m_assign / m_assign
m_m_assign_plugin_config /m_assign_plugin_config

help!

Debug info: ORA-00942: table or view does not exist
SELECT a.id, count(1) AS submissionsenabled
FROM m_m_assign a
JOIN m_m_assign_plugin_config ac ON ac.assignment = a.id
WHERE a.course = :o_param1
AND ac.name='enabled'
AND to_char(ac.value) = '1'
AND ac.subtype='assignsubmission'
AND plugin!='comments'
GROUP BY a.id
[array (
'o_param1' => '2',
)]
Error code: dmlreadexception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants