Editing a selection column via UI fails with 500 "It is forbidden to set the Uuid from external"

Open Beginner friendly
#2,856 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, php
Domain
api, backend

Research direction

Start with apps/tables/lib/Model/SelectionOption.php:34 and trace the call from apps/tables/lib/Service/ColumnService.php:477 during the PUT update request. Reproduce the UI edit with an existing selection option, then verify that saving a newly added option succeeds without the UUID validation error or HTTP 500.

Written by the indexing model from the issue text.

Description

0. Needs triage bug
Steps to reproduce

1.Description: Nextcloud 34.0.2.1, Tables 2.2.1. When editing an existing selection column in the web UI (e.g. adding a new dropdown option), the frontend sends back the option uuids it received from the server. SelectionOption::createFromInputArray() is called without $allowPassingUuid, so the request fails with InvalidArgumentException('It is forbidden to set the Uuid from external'), surfaced as HTTP 500. Workaround: accept echoed uuids in createFromInputArray()
2.
3.

Expected behavior

Open table ---> Edit column properties ---> Add another option to a drop-down menu --->> Save edited column

Actual behavior

Open table ---> Edit column properties ---> Add another option to a drop-down menu --->> Save edited column --> Column properties not updated, error in log

Tables app version

2.2.1

Browser

Safari, Firefox

Client operating system

Mac OS X Tahoe

Operating system

Ubuntu Server 22

Web server

Apache

PHP engine version

PHP 8.3

Database

MariaDB

Additional info

Nextcloud 34.0.2.1, app: tables
PUT /index.php/apps/tables/api/1/columns/139
OCA\Tables\Errors\InternalError: It is forbidden to set the Uuid from external

thrown at: apps/tables/lib/Service/ColumnService.php:477
(root cause: apps/tables/lib/Model/SelectionOption.php:34,
SelectionOption::createFromInputArray() called without $allowPassingUuid)

#0 apps/tables/lib/Controller/Api1Controller.php(1109): OCA\Tables\Service\ColumnService->update()
#1 lib/private/AppFramework/Http/Dispatcher.php(165): OCA\Tables\Controller\Api1Controller->updateColumn()
#2 lib/private/AppFramework/Http/Dispatcher.php(78): OC\AppFramework\Http\Dispatcher->executeController()
#3 lib/private/AppFramework/App.php(137): OC\AppFramework\Http\Dispatcher->dispatch()
#4 lib/private/Route/Router.php(324): OC\AppFramework\App::main()
#5 lib/base.php(1172): OC\Route\Router->match()
#6 index.php(25): OC::handleRequest()

Dominant language
JavaScript
Stars
214
Forks
52
Avg merge
1d 10h
Merged PRs (30d)
82

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/tables

All issues in nextcloud/tables

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.