# Bug NEX-300 - Nextcloud integration_openproject 2.4.4 bug when deleting files via link share

Project: Stream Nextcloud app "OpenProject Integration"
Status: closed
URL: https://community.openproject.org/work_packages/NEX-300

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | Nextcloud Integration 2.4.6 |
| Observed in versions | Nextcloud Integration 2.4.0 |
| Bug found in version (deprecated) | Nextcloud Integration 2.4.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee | Sagar Gurung |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Run `integration_openproject` in Nextcloud 27.0.2
2.  Share a folder by link with *Allow upload and editing* permissions
3.  put some files in the folder
4.  visit the link share (without logged in session in Nextcloud) and try to delete a file
5.  see error.

### What is the buggy behavior?

  - Deleting files via link share is not possible when `integration_openproject` 2.4.4 is enabled

### What is the expected behavior?

1.  Deleting files via link share should be possible when  `integration_openproject` is enabled

### **Logs**

``` log
Sep 21 09:59:08 nc01 Nextcloud[102374]: {"reqId":"2URIM9IjfPr51oH9aFbK","level":3,"time":"2023-09-21T09:59:08+02:00","remoteAddr":"2003:...","user":"--","app":"webdav","method":"DELETE","url":"/public.php/webdav/easyroam/easyroam_root_ca.pem","message":"{\"Exception\":\"Error\",\"Message\":\"Call to a member function getUID() on null\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php\",\"line\":86,\"function\":\"handle\",\"class\":\"OCA\\\\OpenProject\\\\Listener\\\\BeforeNodeInsideOpenProjectGroupfilderChangedListener\",\"type\":\"->\",\"args\":[[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"]]},{\"file\":\"/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php\",\"line\":251,\"function\":\"__invoke\",\"class\":\"OC\\\\EventDispatcher\\\\ServiceEventListener\",\"type\":\"->\",\"args\":[[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"],\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\",[\"Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher\"]]},{\"file\":\"/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php\",\"line\":73,\"function\":\"callListeners\",\"class\":\"Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher\",\"type\":\"->\",\"args\":[[[\"Closure\"],[\"Closure\"],[\"Closure\"]],\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\",[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"]]},{\"file\":\"/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php\",\"line\":94,\"function\":\"dispatch\",\"class\":\"Symfony\\\\Component\\\\EventDispatcher\\\\EventDispatcher\",\"type\":\"->\",\"args\":[[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"],\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"]},{\"file\":\"/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php\",\"line\":106,\"function\":\"dispatch\",\"class\":\"OC\\\\EventDispatcher\\\\EventDispatcher\",\"type\":\"->\",\"args\":[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\",[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"]]},{\"file\":\"/var/www/html/nextcloud/lib/private/Files/Node/HookConnector.php\",\"line\":149,\"function\":\"dispatchTyped\",\"class\":\"OC\\\\EventDispatcher\\\\EventDispatcher\",\"type\":\"->\",\"args\":[[\"OCP\\\\Files\\\\Events\\\\Node\\\\BeforeNodeDeletedEvent\"]]},{\"file\":\"/var/www/html/nextcloud/lib/private/legacy/OC_Hook.php\",\"line\":105,\"function\":\"delete\",\"class\":\"OC\\\\Files\\\\Node\\\\HookConnector\",\"type\":\"->\",\"args\":[[true,\"/Test/easyroam/easyroam_root_ca.pem\"]]},{\"file\":\"/var/www/html/nextcloud/lib/private/Files/View.php\",\"line\":1257,\"function\":\"emit\",\"class\":\"OC_Hook\",\"type\":\"::\",\"args\":[\"OC_Filesystem\",\"delete\",[true,\"/Test/easyroam/easyroam_root_ca.pem\"]]},{\"file\":\"/var/www/html/nextcloud/lib/private/Files/View.php\",\"line\":1126,\"function\":\"runHooks\",\"class\":\"OC\\\\Files\\\\View\",\"type\":\"->\",\"args\":[[\"delete\"],\"/Test/easyroam/easyroam_root_ca.pem\"]},{\"file\":\"/var/www/html/nextcloud/lib/private/Files/View.php\",\"line\":692,\"function\":\"basicOperation\",\"class\":\"OC\\\\Files\\\\View\",\"type\":\"->\",\"args\":[\"unlink\",\"/easyroam/easyroam_root_ca.pem\",[\"delete\"]]},{\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php\",\"line\":536,\"function\":\"unlink\",\"class\":\"OC\\\\Files\\\\View\",\"type\":\"->\",\"args\":[\"/easyroam/easyroam_root_ca.pem\"]},{\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php\",\"line\":179,\"function\":\"delete\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php\",\"line\":281,\"function\":\"delete\",\"class\":\"Sabre\\\\DAV\\\\Tree\",\"type\":\"->\",\"args\":[\"easyroam/easyroam_root_ca.pem\"]},{\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php\",\"line\":89,\"function\":\"httpDelete\",\"class\":\"Sabre\\\\DAV\\\\CorePlugin\",\"type\":\"->\",\"args\":[[\"Sabre\\\\HTTP\\\\Request\"],[\"Sabre\\\\HTTP\\\\Response\"]]},{\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":472,\"function\":\"emit\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[\"method:DELETE\",[[\"Sabre\\\\HTTP\\\\Request\"],[\"Sabre\\\\HTTP\\\\Response\"]]]},{\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":253,\"function\":\"invokeMethod\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[[\"Sabre\\\\HTTP\\\\Request\"],[\"Sabre\\\\HTTP\\\\Response\"]]},{\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":321,\"function\":\"start\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php\",\"line\":123,\"function\":\"exec\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/nextcloud/public.php\",\"line\":81,\"args\":[\"/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/html/nextcloud/apps/integration_openproject/lib/Listener/BeforeNodeInsideOpenProjectGroupfilderChangedListener.php\",\"Line\":53,\"message\":\"Call to a member function getUID() on null\",\"exception\":{},\"CustomMessage\":\"Call to a member function getUID() on null\"}","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","version":"27.0.2.1"}
```

### Environment information

*Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs*

**OpenProject installation type**

- [ ] Hosted cloud edition
- [x] Packaged installation
    - RHEL
- [ ] Docker All-in-one container
- [ ] Docker-compose installation
- [ ] Other (please specify)

**OpenProject version**

  - integration\_openproject 2.4.4
  - Nextcloud 27.0.2

**Browser**

- [x] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Language**

*German, English*
