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

Declare OCA.Search directly, not via a monkey patch #22511

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

ChristophWurst
Copy link
Member

Apps could use OCA.Search very early on a page load without a problem
prior to Nextcloud 20 (current master). Since the unified search work
moved some code around, it now was added later, resulting in TypeError: OCA.Search is not a constructor errors if the apps did not wrap their
calls in a DOMLoaded event handler.

To ensure existing code continues to work without modification, this
patch moves the declaration of the OCA.Search API to where we defined
OCA, instead of monkey-patching it later on.

Apps could use OCA.Search very early on a page load without a problem
prior to Nextcloud 20 (current master). Since the unified search work
moved some code around, it now was added later, resulting in `TypeError:
OCA.Search is not a constructor` errors if the apps did not wrap their
calls in a `DOMLoaded` event handler.

To ensure existing code continues to work without modification, this
patch moves the declaration of the `OCA.Search` API to where we defined
`OCA`, instead of monkey-patching it later on.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@rullzer rullzer merged commit 7c8a8dc into master Aug 31, 2020
@rullzer rullzer deleted the fix/oca-search-monkey-patch branch August 31, 2020 09:04
@rullzer rullzer mentioned this pull request Sep 1, 2020
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants