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

Rewrite an ugly list of constants in condition_base #101

Open
dmitriim opened this issue Jun 29, 2024 · 0 comments
Open

Rewrite an ugly list of constants in condition_base #101

dmitriim opened this issue Jun 29, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@dmitriim
Copy link
Member

dmitriim commented Jun 29, 2024

A list of constants here https://github.com/catalyst/moodle-tool_dynamic_cohorts/blob/MOODLE_404_STABLE/classes/condition_base.php#L31 is ugly and shouldn't really belong to base class.

On top of that those operator values can get mixed up if used for conflicting type of fields. E.g. date and text types operators. Like here https://github.com/catalyst/moodle-tool_dynamic_cohorts/blob/MOODLE_404_STABLE/classes/condition_base.php#L31 or here https://github.com/catalyst/moodle-tool_dynamic_cohorts/blob/MOODLE_404_STABLE/classes/local/tool_dynamic_cohorts/condition/fields_trait.php#L65

This can lead to bugs and unexpected results.

@dmitriim dmitriim added bug Something isn't working enhancement New feature or request labels Jun 29, 2024
@dmitriim dmitriim changed the title Rewrite ugly list of constants in condition_base Rewrite an ugly list of constants in condition_base Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant