Duplicate "New New document/spreadsheet/presentation/diagram" office entries in the + menu
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
1. Have a Nextcloud server with both office connectors present: richdocuments (Collabora Online) enabled, and the shipped office (Euro-Office) app installed (it ships bundled with Hub 26).
2. Open the Nextcloud Android app and browse to any folder.
3. Tap the "+" button (Add to Nextcloud).
4. Scroll through the list of New-file options.
### Expected behaviour
The Android app should show a single set of office file-creation entries in the "+" menu (New document / New spreadsheet / New presentation), matching what the desktop web interface displays. There should be no duplicated "New New …" entries, and every entry should create a working file without a file-extension error.
### Actual behaviour
The Android "+" menu shows two sets of office entries instead of one. First a correct set (New document / New spreadsheet / New presentation), then a duplicate set prefixed "New New" (New New document / New New spreadsheet / New New presentation / New New diagram).
The correct set works and creates files normally via Collabora. The "New New …" duplicate set fails — tapping any of those entries produces a wrong/invalid file-extension error (the error doesn't state what the extension should be).
This occurs only in the Android app. The desktop web "+" menu is unaffected and shows a single correct set. The duplication persists on a fresh device with no prior cache, and after a server restart, app cache clear, and account re-login, so it is not client-side caching. Disabling the shipped office (Euro-Office) app server-side does not remove the duplicate entries in the app.
### Android version
15 and 12 respectively, (2 phones tested)
### Device brand and model
moto g stylus 5G (2024) and moto g power (2022)
### Stock or custom OS?
Stock
### Nextcloud android app version
34.0.1 for both phones
### Nextcloud server version
Nextcloud Hub 26 Spring (34.0.1) on Ubuntu 24.04.2 LTS installed with Snap
### Using a reverse proxy?
Yes
### Android logs
First cat is filter in studio from Nextcloud startup, second is the plus tapped and New New Document is selected then the filename screen shows up.
[GOOD CLICK and BAD Click at the end - android package com.nextcloud.client logcat.txt](https://github.com/user-attachments/files/30031129/GOOD.CLICK.and.BAD.CLick.ant.the.end.-.android.package.com.nextcloud.client.logcat.txt)
[BAD CLICK only- android package com.nextcloud.client logcat.txt](https://github.com/user-attachments/files/30031164/BAD.CLICK.only-.android.package.com.nextcloud.client.logcat.txt)
### Server error logs
```bash
{"reqId":"MqN6oUXWjmLCfXMEVTig","level":3,"time":"2026-07-15T02:49:42+00:00","remoteAddr":"REDACTED","user":"REDACTED","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/files/api/v1/directEditing/templates/richdocuments/document?format=json","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/34.0.1","version":"34.0.1.2","message":"Cannot use object of type OCA\\Richdocuments\\DirectEditing\\OfficeTemplate as array in file '/lib/private/DirectEditing/Manager.php' line 91","exception":{"Previous":{"Exception":"Error","Message":"Cannot use object of type OCA\\Richdocuments\\DirectEditing\\OfficeTemplate as array","File":"/lib/private/DirectEditing/Manager.php","Line":91,"Trace":"getTemplates() -> array_map() at Manager.php:90 <- DirectEditingController->templates() at line 142"}}}
```
### Additional information
You've got two overlapping "root cause / server error" blocks stitched together, plus a claim I flagged as unverified ("Web and iOS use different code paths…"). Here's the cleaned-up, de-duplicated version:
Server configuration
Nextcloud Server: 34.0.1 (Snap package, LXC container on Proxmox)
richdocuments (Collabora Online): 11.0.1 — enabled, connected to a self-hosted Collabora CODE server
office (Euro-Office connector): 1.0.0 — shipped/core app, disabled
Reverse proxy: Nginx Proxy Manager
Server error (from logs)
When the Android app requests the Direct Editing template list, the server returns HTTP 500 with a fatal error:
GET /ocs/v2.php/apps/files/api/v1/directEditing/templates/richdocuments/document
Exception: Cannot use object of type OCA\Richdocuments\DirectEditing\OfficeTemplate as array
Location: lib/private/DirectEditing/Manager.php line 91
Trace: DirectEditingController->templates() → Manager->getTemplates() → array_map (Manager.php:90)
The error occurs in core's DirectEditing\Manager::getTemplates() while processing an OCA\Richdocuments\DirectEditing\OfficeTemplate — array_map over the templates hits an object where an array is expected. Reproduced three times, all from Nextcloud-android/34.0.1. Versions: server 34.0.1.2, richdocuments 11.0.1. (Root cause not confirmed beyond the trace — flagging for maintainers whether this is a richdocuments or server-side issue.)
Platform comparison
Web interface "+" menu: single correct set, works.
iOS Nextcloud app: unaffected — single correct set, same as web.
Android Nextcloud app: shows duplicated "New New …" entries; the second set triggers the 500 above.
Only the Android client is observed hitting the failing directEditing/templates endpoint; web and iOS do not trigger the error in testing.
Key findings
Reproduced on two Android devices (Moto G Stylus 2024 and Moto G 2022), including one with no prior use of the app.
Persists after clearing app cache, logout/login, app reinstall, and server restart.
Disabling the shipped office (Euro-Office) app does not change the behavior; office cannot be uninstalled (shipped/core app), only disabled.
Started after the Hub 26 / Euro-Office rollout.
Logs
Logcat: for the working (non-duplicate) entries, the app calls GET /ocs/v2.php/apps/richdocuments/api/v1/templates/{type} and file creation succeeds.
Server log: tapping a "New New …" entry issues GET .../directEditing/templates/richdocuments/document, which throws the OfficeTemplate as array fatal error (full trace in the Server error logs field).
Contributor guide
Research direction
Reproduce the Android + menu behavior and inspect the two template requests described in the report. Start with lib/private/DirectEditing/Manager.php around line 91 and compare the working richdocuments templates endpoint with the failing directEditing/templates endpoint. Done means one set of office entries is shown and every entry creates a valid file without the extension error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- api, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100