Nextcloud 32 + OnlyOffice Apps 9.12.0 : undefined method OC\Server::getSystemTagObjectMapper()

Hello,

I’m a system admin which encouter an error after upgrading my Nextcloud instance, Only Office App and OnlyOffice server.

Here are the versions used :

  • Nextcloud 32 (Docker)
  • OnlyOffice App 9.12.0
  • OnlyOffice Server 9.2 (Docker)

Nextcloud and OnlyOffice server are working : webui is available and when I connect Nextcloud to OnlyOffice through OnlyOffice app, it works.

Then OnlyOffice icons are present when I want to create a new document. But If I open the new document I’ve got an empty page and in the nextcloud logs I’ve got this error : Call to undefined method OC\Server::getSystemTagObjectMapper().

In the Nextcloud release notes for version 32 it seems that the correct method is OCP\Server and not OC anymore : Upgrade to Nextcloud 32 — Nextcloud latest Developer Manual latest documentation. And in this file '/var/www/html/apps/onlyoffice/lib/Controller/EditorApiController.php I can find this line twice : $fileTags = OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], "files")[$fileId]; (with OC::$server).

I’m not sure about that because I’m not really a php developper but OnlyOffice App 9.12.0 seems not to be compatible with Nextcloud 32 although it is written compatible in Nextcloud App store (ONLYOFFICE - Apps - App Store - Nextcloud).

Can you help me with that please ?

Thank you, best regards,

Hello @virtualfloppy

I have just tested Nextcloud 32.0.3 with latest version of Document Server and connector app (9.2.1 and 9.12.0 respectively) and everything works as expected. If I create a new file, new tab opens with the editor.

Can you try reinstalling the connector app in your Nextcloud instance? I’d recommend removing the ../apps/onlyoffice directory, then installing the connector again as an approach.

Hi,
I had the same problem, and after reading the error message and the EditorAPIController.php file, I realized it was related to watermarks. As you pointed out, it calls the deprecated getter getSystemTagObjectMapper() :

      if ($watermarkSettings["allTags"]) {
            $tags = $watermarkSettings["allTagsList"];
            $fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], "files")[$fil>
            foreach ($fileTags as $tagId) {
                if (in_array($tagId, $tags)) {
                    return $watermarkText;
                }

Until an update is released, if you have watermarks enabled in the OnlyOffice app options on Nextcloud, try disabling them, and it should work; it did for me.

Hi,
Thank you for your answers, I’ll try to disable watermarks and I’ll be back asap.
Best regards,

Hi,
I’ve just tried to disable watermarks and It works !
@GuillaumeP thanks a lot for your feedback.

I hope that we can have a fix soon.

Best regards,

1 Like