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

Fix site capability transient filter issue #94

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

arunshenoy99
Copy link
Member

Proposed changes

  1. Moves the filter from the BH plugin's bootstrap.php file to the data module, where other filters are located, and includes the is_callable check. This approach is much safer.
  2. Addresses an issue where the current code caused the code in SiteCapabilities.php to be unreachable. As a result, capabilities from the Hiive API were never retrieved, leaving canMigrateSite as the only capability set on any customer site.
  3. Updates the code to use the pre_set_transient filter, which is a much safer option in this case (given 2). This filter checks for an empty value only when the transient is being set in the database, ensuring it is set only for sites where the Hiive API has failed.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@arunshenoy99 arunshenoy99 changed the title Fix/site capability transient issue Fix site capability transient filter issue Aug 16, 2024
@circlecube circlecube merged commit 3a0515f into main Aug 16, 2024
7 checks passed
@circlecube circlecube deleted the fix/site-capability-transient-issue branch August 16, 2024 14:15
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