Skip to content

Conversation

@TamaroWalter
Copy link
Collaborator

Note: Please fill out all relevant sections and remove irrelevant ones.

🔀 Purpose of this PR:

  • Fixes a bug
  • Updates for a new Moodle version
  • Adds a new feature of functionality
  • Improves or enhances existing features
  • Refactoring: restructures code for better performance or maintainability
  • Testing: add missing or improve existing tests
  • Miscellaneous: code cleaning (without functional changes), documentation, configuration, ...

📝 Description:

Until now only the settings of the letter and time filter were saved in the database. After a little bit of thinking, the course filter settings can be stored too. Until now the problem was that the course filter has a dynamic amount of courses. Courses may change (new courses appear, old courses are removed).

Instead of saving a value for each course or opening new tables that matches a course to a userid (which is the clean relational-way), a trick is used. A new attribute in the table saves a stringified version of a JSON object that stores the setting of each course that shows content in townsquare with courseid => true/false.


📋 Checklist

Please confirm the following (check all that apply):

  • I have phpunit and/or behat tests that cover my changes or additions.
  • Code passes the code checker without errors and warnings.
  • Code passes the moodle-ci/cd pipeline on all supported Moodle versions or the ones the plugin supports.
  • Code does not have var_dump() or var_export or any other debugging statements (or commented out code) that
    should not appear on the productive branch.
  • Code only uses language strings instead of hard-coded strings.
  • If there are changes in the database: I updated/created the necessary upgrade steps in db/upgrade.php and
    updated the version.php.
  • If there are changes in javascript: I build new .min files with the grunt amd command.

@TamaroWalter TamaroWalter force-pushed the feature/coursepreferences branch from e561931 to d40d395 Compare November 15, 2025 17:33
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