nextcloud / nextcloud/tables

Required sort parameters are missing

Open
#2,380 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
214
Forks
52
Avg merge
1d 10h
Merged PRs (30d)
82

Description

Steps to reproduce

When one creates an app from a view that does not contain the Value it is sorted by, that app will fail to load the table in the App for accounts that do not have access to this value that is required to sort that view.. Instead a blank page with Title and description of the App will be rendered.

After adding the Value the view ist sorted by to the view itself, the App shows the view but still shows two Errors to the user. These Errors are:

Could not load shared views
and

Could not load shared views. Unknown Error

In The logs:

{"reqId":"3WPVFQB05LXqs7aaUsMG","level":3,"time":"2026-03-09T12:16:17+01:00","remoteAddr":"46.142.37.73","user":"testthorsten","app":"index","method":"GET","url":"/apps/tables/view","scriptName":"/index.php","message":"Required sort parameters are missing","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36","version":"32.0.6.1","exception":{"Exception":"InvalidArgumentException","Message":"Required sort parameters are missing","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/tables/lib/Db/View.php","line":142,"function":"createFromInputArray","class":"OCA\\Tables\\Model\\SortRuleSet","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/custom_apps/tables/lib/Db/View.php","line":195,"function":"getSortArray","class":"OCA\\Tables\\Db\\View","type":"->","args":[]},{"function":"jsonSerialize","class":"OCA\\Tables\\Db\\View","type":"->","args":[]},{"file":"/var/www/html/lib/public/AppFramework/Http/JSONResponse.php","line":66,"function":"json_encode","args":[[{"__class__":"OCA\\Tables\\Db\\View","id":26},{"__class__":"OCA\\Tables\\Db\\View","id":27},{"__class__":"OCA\\Tables\\Db\\View","id":42},{"__class__":"OCA\\Tables\\Db\\View","id":91},{"__class__":"OCA\\Tables\\Db\\View","id":92},"And 18 more entries, set log level to debug to see all entries"],4194305,2048]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":163,"function":"render","class":"OCP\\AppFramework\\Http\\JSONResponse","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Tables\\Controller\\ViewController"},"indexSharedWithMe"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\ViewController","indexSharedWithMe",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"tables.view.indexsharedwithme"}]},{"file":"/var/www/html/lib/base.php","line":1091,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/view"]},{"file":"/var/www/html/index.php","line":25,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/tables/lib/Model/SortRuleSet.php","Line":39,"message":"Required sort parameters are missing","exception":[],"CustomMessage":"Required sort parameters are missing"},"id":"69aeac12609b6"}

Expected behavior

The value the view is sorted by does not need to be PArt of the view but sorting will still work for shared views in Applications. No error will be shown when loading an App.

Actual behavior

see reproduction

Tables app version

1.0.5

Browser

Version 145.0.7632.75 (Official Build, ungoogled-chromium) (64-Bit)

Client operating system

No response

Operating system

No response

Web server

None

PHP engine version

None

Database

None

Additional info

Nextcloud Hub 32.0.6

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.

Research direction

Reproduce the shared-view failure through the tables.view.indexsharedwithme endpoint, then inspect lib/Db/View.php around getSortArray and jsonSerialize and lib/Model/SortRuleSet.php around createFromInputArray. Verify the case where a view's sort value is not included in the shared view. Done means the app loads shared views and sorting works without either reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.