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

category-create fails with "Comparisons of text column conditions are not allowed" #439

Open
romangarcia opened this issue May 31, 2023 · 0 comments

Comments

@romangarcia
Copy link

  • moosh version: moosh_moodle41_2023010400
  • moodle version: 4.1
    • database: MySQL
  • php version:
  • operating system: MacOS host / Bitnami Moodle container

Actual behaviour

Creating a category if doesn't exist, return ID otherwise, fails:
MAIN_CAT=$(moosh category-create -r -p 0 -v 1 -d "Test" test | tail -n 1)

logs error:

[31-May-2023 02:18:17 UTC] Default exception handler: Comparisons of text column conditions are not allowed. Please use sql_compare_text() in your query. Debug:
Error code: textconditionsnotallowed
* line 685 of /lib/dml/moodle_database.php: dml_exception thrown
* line 1458 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
* line 66 of /opt/moosh/Moosh/Command/Moodle39/Category/CategoryCreate.php: call to moodle_database->get_records()
* line 41 of /opt/moosh/Moosh/Command/Moodle39/Category/CategoryCreate.php: call to Moosh\Command\Moodle39\Category\CategoryCreate->find_category()
* line 364 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Category\CategoryCreate->execute()

Expected behaviour

Returns the ID of the created OR existing category

Steps to reproduce

I would guess simply running moosh category-create -r -p 0 -v 1 -d "Test" test should reproduce.
The error was mentioned here as a wont-fix wrt Moodle DB library: https://moodle.org/mod/forum/discuss.php?d=263229

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

1 participant