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

Recursive REST API calls when connecting to the same environment in maintenance mode #58

Open
jensschuppe opened this issue Sep 20, 2022 · 1 comment
Milestone

Comments

@jensschuppe
Copy link
Collaborator

Steps to reproduce:

  • Add a CiviMRF profile to connect to the same Drupal installation
  • Enable the CiviMRF Views submodule
  • Add a CiviMRF Views Dataset
  • Enable maintenance mode
  • Flush caches (e.g. via the "Flush cache" button on the Views Datasets configuration page
  • (with a debugger, notice endless calls to the CiviCRM REST API endpoint)

This is due to the maintenance mode enabling a Drupal renderer routine that initializes the theme, which in turn calls the Views module's hook_views_data() implementations, including CiviMRF's that then tries to issue getfields calls to the CiviCRM API.

There should be some kind of a discovery mechanism before issueing an API call (or running the hook_views_data() implementation at all, when connecting to the same environment and the current request has been issued from this code. This would probably involve introducing signed requests (with a uuid).

@jensschuppe
Copy link
Collaborator Author

This might be mitigated by the API user needing permission to use the website in maintenance mode as otherwise those requests would be blocked before they can cause recursion.

@jensschuppe jensschuppe added this to the 2.1.0 milestone Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant