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

[FAU-441] feat: update modified value if any of degree program properties were updated #147

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

shvlv
Copy link
Contributor

@shvlv shvlv commented Sep 4, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature.

What is the current behavior? (You can also link to an open issue here)
https://inpsyde.atlassian.net/browse/FAU-441

What is the new behavior (if this is a feature change)?
I wouldn't say I like the coupling of the new functionality with the cache module, but now the cache module is the single place where we have all hooks triggered for any degree program data changes. Decoupling the functionality is a huge and dangerous refactoring effort. Anyway, we already have a cache module coupled with revision functionality and the degree program output plugin can't work without a cache at all (at least for degree program overviews). So our "cache" is not a secondary but a core functionality now 🤷‍♂️ .

The same is true for extracting helper repositories. We have many domain-related repositories, so creating new repositories just to wrap the get_posts invocation doesn't make much sense.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.

Other information:

Copy link
Collaborator

@tyrann0us tyrann0us left a comment

Choose a reason for hiding this comment

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

Thank you for working on this! LGTM.
What do you think of adding @wp-hooks to the updateModifiedDate callback, maybe even to all caching-related add_action callbacks according to the Boy Scout rules?

Copy link
Collaborator

@amiut amiut left a comment

Choose a reason for hiding this comment

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

Thank you

@shvlv
Copy link
Contributor Author

shvlv commented Sep 4, 2024

What do you think of adding @wp-hooks to the updateModifiedDate callback, maybe even to all caching-related add_action callbacks according to the Boy Scout rules?

I've just tried, but I'm not sure it adds clarity 😄

For our custom event handlers, we get the event object as a param, so it's self-explanatory - public function updateModifiedDate(CacheInvalidated $event): void. We have dynamic events for WordPress events, and update_option_{$prefixedOption} and edited_{$key} are not helpful. WhenDegreeProgramTermUpdated::invalidateCache is used in different contexts.

Maybe we can stay it as is.

@shvlv shvlv merged commit 904bc7d into dev Sep 4, 2024
8 checks passed
@tyrann0us tyrann0us deleted the FAU-441 branch September 4, 2024 10:18
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.

3 participants