Skip to content
Snippets Groups Projects
  • Christoph Wurst's avatar
    e2d20953
    Declare OCA.Search directly, not via a monkey patch · e2d20953
    Christoph Wurst authored
    
    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: default avatarChristoph Wurst <christoph@winzerhof-wurst.at>
    Declare OCA.Search directly, not via a monkey patch
    Christoph Wurst authored
    
    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: default avatarChristoph Wurst <christoph@winzerhof-wurst.at>