You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whiteboard hangs its viewer integration off the viewer's load event:
lib/Listener/LoadViewerListener.php:12: use OCA\Viewer\Event\LoadViewer;
lib/AppInfo/Application.php: registers that listener for LoadViewer
The listener also provides the initial state the whiteboard needs (maxFileSize, disableExternalLibraries, autoUploadOnDisconnect, isAdmin, orgTemplatesSupported).
Warning
This fails quietly. OCA\Viewer\Event\LoadViewer stops existing, so the listener never fires.
Both the script and that initial state stop being provided, with no error, and whiteboards
stop opening in the viewer.
The work is to move what the listener does onto an event that still exists. Registering the
handler belongs in a script loaded with \OCP\Util::addInitScript(), so it is in place before
the Files list takes its first snapshot of the available actions, and the initial state can go
on BeforeTemplateRenderedEvent alongside it. Handlers are also custom elements now rather
than Vue components handed to the viewer. See the registration walkthrough.
OCA.Viewer is gone in Viewer 7.0.0. The viewer ships as the @nextcloud/viewer library rather than a
bundled app, and nextcloud/server#63954 removes the viewer app from Nextcloud 36 altogether.
Roughly what it looks like:
import{canView,getViewer}from'@nextcloud/viewer'// OCA.Viewer.open({ path }) / ({ fileInfo, list })getViewer().open(nodes,file)// @nextcloud/files nodesgetViewer().openFolder(folder,file)// when a path is all you have, let it fetch// OCA.Viewer.mimetypes.includes(mime) / availableHandlerscanView(node)
The part that is not a rename is that the viewer takes @nextcloud/files nodes now, not fileinfo objects or path strings. Importing the package is also all it takes to get the viewer
onto the page: no LoadViewer event to dispatch, and nothing to check about whether the app is
enabled.
Important
There is no compatibility shim, which was a deliberate call, so this is a real port rather
than a rename. Nothing breaks until the server PR lands; after that these calls throw on
Nextcloud 36.
Whiteboard hangs its viewer integration off the viewer's load event:
lib/Listener/LoadViewerListener.php:12:use OCA\Viewer\Event\LoadViewer;lib/AppInfo/Application.php: registers that listener forLoadViewerThe listener also provides the initial state the whiteboard needs (
maxFileSize,disableExternalLibraries,autoUploadOnDisconnect,isAdmin,orgTemplatesSupported).Warning
This fails quietly.
OCA\Viewer\Event\LoadViewerstops existing, so the listener never fires.Both the script and that initial state stop being provided, with no error, and whiteboards
stop opening in the viewer.
The work is to move what the listener does onto an event that still exists. Registering the
handler belongs in a script loaded with
\OCP\Util::addInitScript(), so it is in place beforethe Files list takes its first snapshot of the available actions, and the initial state can go
on
BeforeTemplateRenderedEventalongside it. Handlers are also custom elements now ratherthan Vue components handed to the viewer. See the
registration walkthrough.
OCA.Vieweris gone in Viewer 7.0.0. The viewer ships as the@nextcloud/viewerlibrary rather than abundled app, and nextcloud/server#63954 removes the
viewerapp from Nextcloud 36 altogether.Roughly what it looks like:
The part that is not a rename is that the viewer takes
@nextcloud/filesnodes now, notfileinfoobjects or path strings. Importing the package is also all it takes to get the vieweronto the page: no
LoadViewerevent to dispatch, and nothing to check about whether the app isenabled.
Important
There is no compatibility shim, which was a deliberate call, so this is a real port rather
than a rename. Nothing breaks until the server PR lands; after that these calls throw on
Nextcloud 36.
Tip
The developer manual covers the migration under
Critical changes
(being added in nextcloud/documentation#15597), and the
README
has the full before/after table. Happy to help with the port, just ping me.
👾 This issue was written with the help of Claude Code.