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

[#911] fix sql cleaning #912

Merged
merged 1 commit into from
Dec 9, 2024
Merged

[#911] fix sql cleaning #912

merged 1 commit into from
Dec 9, 2024

Conversation

matthewhilton
Copy link
Contributor

@matthewhilton matthewhilton commented Dec 9, 2024

Closes #911

Summary

It was clean_param being called when PARAM_TEXT that mangles the <= in the sql. I checked a similar plugin report_customsql, and it used PARAM_RAW

Testing

  • Manually tested by putting in the SQL from the issue linked above into step definitions, saved, and confirmed no longer removes the text after the <=
  • (side note, I attempted to add a unit test for this which appears possible https://moodledev.io/docs/4.5/apis/subsystems/form#unit-testing but I could not get it to work properly and it does not seem worth it to spend any longer)

** Cherry picks**

Copy link
Contributor

@Peterburnett Peterburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We need to allow carets, all other poweful syntax for SQL is already allowed in PARAM_TEXT eg ; ' "

@Peterburnett Peterburnett merged commit 4ff66ed into MOODLE_401_STABLE Dec 9, 2024
15 checks passed
@Peterburnett Peterburnett deleted the fix-sql-format branch December 9, 2024 04:53
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

Successfully merging this pull request may close these issues.

2 participants