When maps is enabled, after sharing a document, unshare is not working/possible.
This has been observed by others and found out that that this package was the culprit from Reddit.
I expected the share to be removed.
Exception Undefined constant OCP\Share::SHARE_TYPE_USER in file '/var/www/html/custom_apps/maps/lib/Hooks/FileHooks.php' line 154
/var/www/html/lib/private/AppFramework/App.phpLine 153
OC\AppFramework\Http\Dispatcher->dispatch(
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareAPIController"
},
"deleteShare"
)
/var/www/html/lib/private/Route/Router.phpLine 321
OC\AppFramework\App::main(
"OCA\\Files_Sharing\\Controller\\ShareAPIController",
"deleteShare",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "ocs.files_sharing.shareapi.deleteshare",
"id": "11"
}
)
/var/www/html/ocs/v1.phpLine 61
OC\Route\Router->match(
"/ocsapp/apps/files_sharing/api/v1/shares/11"
)
/var/www/html/ocs/v2.phpLine 8
undefinedundefinedrequire_once(
"/var/www/html/ocs/v1.php"
)
Caused by Error Undefined constant OCP\Share::SHARE_TYPE_USER
{
"reqId": "bQYQOnd3ZRj5plSeYxzX",
"level": 3,
"time": "2026-03-03T07:33:25+00:00",
"remoteAddr": "195.86.27.30",
"user": "admin",
"app": "no app in context",
"method": "DELETE",
"url": "/ocs/v2.php/apps/files_sharing/api/v1/shares/11",
"scriptName": "/ocs/v2.php",
"message": "Undefined constant OCP\\Share::SHARE_TYPE_USER in file '/var/www/html/custom_apps/maps/lib/Hooks/FileHooks.php' line 154",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0",
"version": "32.0.4.1",
"exception": {
"Exception": "Exception",
"Message": "Undefined constant OCP\\Share::SHARE_TYPE_USER in file '/var/www/html/custom_apps/maps/lib/Hooks/FileHooks.php' line 154",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 153,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareAPIController"
},
"deleteShare"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 321,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Files_Sharing\\Controller\\ShareAPIController",
"deleteShare",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "ocs.files_sharing.shareapi.deleteshare",
"id": "11"
}
]
},
{
"file": "/var/www/html/ocs/v1.php",
"line": 61,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/ocsapp/apps/files_sharing/api/v1/shares/11"
]
},
{
"file": "/var/www/html/ocs/v2.php",
"line": 8,
"args": [
"/var/www/html/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"Line": 150,
"Previous": {
"Exception": "Error",
"Message": "Undefined constant OCP\\Share::SHARE_TYPE_USER",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/private/legacy/OC_Hook.php",
"line": 85,
"function": "preUnShare",
"class": "OCA\\Maps\\Hooks\\FileHooks",
"type": "->",
"args": [
{
"0": "And 4 more entries, set log level to debug to see all entries",
"id": "11",
"itemType": "file",
"itemSource": 96841,
"shareType": 3,
"shareWith": ""
}
]
},
{
"file": "/var/www/html/lib/private/Share20/LegacyHooks.php",
"line": 47,
"function": "emit",
"class": "OC_Hook",
"type": "::",
"args": [
"OCP\\Share",
"pre_unshare",
{
"0": "And 4 more entries, set log level to debug to see all entries",
"id": "11",
"itemType": "file",
"itemSource": 96841,
"shareType": 3,
"shareWith": ""
}
]
},
{
"file": "/var/www/html/lib/private/Share20/LegacyHooks.php",
"line": 27,
"function": "preUnshare",
"class": "OC\\Share20\\LegacyHooks",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 220,
"function": "OC\\Share20\\{closure}",
"class": "OC\\Share20\\LegacyHooks",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 56,
"function": "callListeners",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
},
{
"__class__": "Closure"
}
],
"*** sensitive parameters replaced ***",
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
"line": 67,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
"*** sensitive parameters replaced ***",
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
"line": 79,
"function": "dispatch",
"class": "OC\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
"*** sensitive parameters replaced ***",
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/lib/private/Share20/Manager.php",
"line": 2098,
"function": "dispatchTyped",
"class": "OC\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/lib/private/Share20/Manager.php",
"line": 1135,
"function": "dispatchEvent",
"class": "OC\\Share20\\Manager",
"type": "->",
"args": [
"*** sensitive parameters replaced ***",
"before share deleted"
]
},
{
"file": "/var/www/html/apps/files_sharing/lib/Controller/ShareAPIController.php",
"line": 565,
"function": "deleteShare",
"class": "OC\\Share20\\Manager",
"type": "->",
"args": [
{
"__class__": "OC\\Share20\\Share"
}
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 204,
"function": "deleteShare",
"class": "OCA\\Files_Sharing\\Controller\\ShareAPIController",
"type": "->",
"args": [
"11"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 118,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareAPIController"
},
"deleteShare"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 153,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareAPIController"
},
"deleteShare"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 321,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Files_Sharing\\Controller\\ShareAPIController",
"deleteShare",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "ocs.files_sharing.shareapi.deleteshare",
"id": "11"
}
]
},
{
"file": "/var/www/html/ocs/v1.php",
"line": 61,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/ocsapp/apps/files_sharing/api/v1/shares/11"
]
},
{
"file": "/var/www/html/ocs/v2.php",
"line": 8,
"args": [
"/var/www/html/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/var/www/html/custom_apps/maps/lib/Hooks/FileHooks.php",
"Line": 154
},
"message": "Undefined constant OCP\\Share::SHARE_TYPE_USER in file '/var/www/html/custom_apps/maps/lib/Hooks/FileHooks.php' line 154",
"exception": [],
"CustomMessage": "Undefined constant OCP\\Share::SHARE_TYPE_USER in file '/var/www/html/custom_apps/maps/lib/Hooks/FileHooks.php' line 154"
},
"id": "69a68ed363b4d"
}
Bug description
When maps is enabled, after sharing a document, unshare is not working/possible.
This has been observed by others and found out that that this package was the culprit from Reddit.
Steps to reproduce
Expected behavior
I expected the share to be removed.
Installation method
Official All-in-One appliance
Operating system
Other
PHP engine version
None
Web server
Apache (supported)
Database engine version
None
Is this bug present after an update or on a fresh install of the server?
Fresh Nextcloud Server install
Is this bug present after an update or on a fresh install of the app?
Fresh Nextcloud Maps install (never installed before)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Browser Console
Additional info
log.txt
No response