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

Cannot add second note to the same page #21

Open
brankovukasovic opened this issue Aug 4, 2023 · 0 comments
Open

Cannot add second note to the same page #21

brankovukasovic opened this issue Aug 4, 2023 · 0 comments

Comments

@brankovukasovic
Copy link

brankovukasovic commented Aug 4, 2023

Environment
Moodle 4.1
Database: PostgreSQL
PHP 8.1
Plugin version: 2022050903 release 1.1.1

Steps to reproduce:

  1. Visit some page
  2. Add a note (everything is ok)
  3. Try to add another note on the same page

Expected result:
You are able to add another note.

Actual result:
dmlreadexception it thrown.

`ERROR: trailing junk after parameter at or near "$3O"
LINE 3: contextid = $2 AND pageurl = $3ORDER BY timecreated DESC
^
SELECT * FROM mdl_ltool_note_data
WHERE userid = $1 AND
contextid = $2 AND pageurl = $3ORDER BY timecreated DESC
[array (
0 => '2',
1 => 101,
2 => 'https://moodle401.local/course/view.php?id=5',
)]
Error code: dmlreadexception

  • line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
  • line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
  • line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
  • line 285 of /local/learningtools/ltool/note/lib.php: call to pgsql_native_moodle_database->get_records_sql()
  • line 258 of /local/learningtools/ltool/note/lib.php: call to ltool_note_get_contextuser_notes()
  • line 244 of /local/learningtools/ltool/note/lib.php: call to ltool_note_load_context_notes()
  • line 8059 of /lib/moodlelib.php: call to ltool_note_output_fragment_get_note_form()
  • line 423 of /lib/external/externallib.php: call to component_callback()
  • line 261 of /lib/externallib.php: call to core_external::get_fragment()
  • line 81 of /lib/ajax/service.php: call to external_api::call_external_function()
    ERROR: trailing junk after parameter at or near "$3O"
    LINE 3: contextid = $2 AND pageurl = $3ORDER BY timecreated DESC
    ^
    SELECT * FROM mdl_ltool_note_data
    WHERE userid = $1 AND
    contextid = $2 AND pageurl = $3ORDER BY timecreated DESC
    [array (
    0 => '2',
    1 => 101,
    2 => 'https://moodle401.local/course/view.php?id=5',
    )]
    Error code: dmlreadexception
  • line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
  • line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
  • line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
  • line 285 of /local/learningtools/ltool/note/lib.php: call to pgsql_native_moodle_database->get_records_sql()
  • line 258 of /local/learningtools/ltool/note/lib.php: call to ltool_note_get_contextuser_notes()
  • line 244 of /local/learningtools/ltool/note/lib.php: call to ltool_note_load_context_notes()
  • line 8059 of /lib/moodlelib.php: call to ltool_note_output_fragment_get_note_form()
  • line 423 of /lib/external/externallib.php: call to component_callback()
  • line 261 of /lib/externallib.php: call to core_external::get_fragment()
  • line 81 of /lib/ajax/service.php: call to external_api::call_external_function()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant