Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
rullzer merged 1 commit intomasterfrom
fix/oca-search-monkey-patch
Aug 31, 2020
Merged

Declare OCA.Search directly, not via a monkey patch#22511
rullzer merged 1 commit intomasterfrom
fix/oca-search-monkey-patch

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 <[email protected]>
@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