nextcloud / tables

🍱 Nextcloud tables app
https://apps.nextcloud.com/apps/tables
GNU Affero General Public License v3.0
143 stars 24 forks source link

Ensure column is selected for view filter #1197

Closed enjeck closed 2 months ago

enjeck commented 2 months ago

Steps to reproduce

  1. Click "create view" button
  2. Click "Add new filter". Don't select any columns
  3. Save view

Expected behavior

Saves and load view

Actual behavior

Fails to save view. All tables are broken

Tables app version

No response

Browser

No response

Client operating system

No response

Operating system

No response

Web server

None

PHP engine version

None

Database

None

Additional info

Error trace {"reqId":"gKhZyE1lVjCmHWc1SSTR","level":3,"time":"2024-07-12T15:15:48+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"index","method":"GET","url":"/index.php/apps/tables/table","message":"OCA\\Tables\\Db\\Row2Mapper::getFilterExpression(): Argument #2 ($column) must be of type OCA\\Tables\\Db\\Column, null given, called in /var/www/html/apps/tables/lib/Db/Row2Mapper.php on line 286 in file '/var/www/html/apps/tables/lib/Db/Row2Mapper.php' line 310","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","version":"30.0.0.1","exception":{"Exception":"Exception","Message":"OCA\\Tables\\Db\\Row2Mapper::getFilterExpression(): Argument #2 ($column) must be of type OCA\\Tables\\Db\\Column, null given, called in /var/www/html/apps/tables/lib/Db/Row2Mapper.php on line 286 in file '/var/www/html/apps/tables/lib/Db/Row2Mapper.php' line 310","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\TableController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\TableController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["tables.table.index"]]},{"file":"/var/www/html/lib/base.php","line":988,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/table"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":146,"Previous":{"Exception":"TypeError","Message":"OCA\\Tables\\Db\\Row2Mapper::getFilterExpression(): Argument #2 ($column) must be of type OCA\\Tables\\Db\\Column, null given, called in /var/www/html/apps/tables/lib/Db/Row2Mapper.php on line 286","Code":0,"Trace":[{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":286,"function":"getFilterExpression","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[["OC\\DB\\QueryBuilder\\QueryBuilder"],null,null,""]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":263,"function":"getFilter","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[["OC\\DB\\QueryBuilder\\QueryBuilder"],[[null,null,""]]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":241,"function":"getFilterGroups","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[["OC\\DB\\QueryBuilder\\QueryBuilder"],[[[null,null,""]]]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":143,"function":"addFilterToQuery","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[["OC\\DB\\QueryBuilder\\QueryBuilder"],[[[null,null,""]]],"admin"]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":825,"function":"getWantedRowIds","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":["admin",2,[[[null,null,""]]]]},{"file":"/var/www/html/apps/tables/lib/Service/RowService.php","line":536,"function":"countRowsForView","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[["OCA\\Tables\\Db\\View",4],"admin",[["OCA\\Tables\\Db\\Column",5],["OCA\\Tables\\Db\\Column",6],["OCA\\Tables\\Db\\Column",7],["OCA\\Tables\\Db\\Column",8],["OCA\\Tables\\Db\\Column",9]]]},{"file":"/var/www/html/apps/tables/lib/Service/ViewService.php","line":409,"function":"getViewRowsCount","class":"OCA\\Tables\\Service\\RowService","type":"->","args":[["OCA\\Tables\\Db\\View",4],"admin"]},{"file":"/var/www/html/apps/tables/lib/Service/ViewService.php","line":91,"function":"enhanceView","class":"OCA\\Tables\\Service\\ViewService","type":"->","args":[["OCA\\Tables\\Db\\View",4],"admin"]},{"file":"/var/www/html/apps/tables/lib/Service/TableService.php","line":227,"function":"findAll","class":"OCA\\Tables\\Service\\ViewService","type":"->","args":[["OCA\\Tables\\Db\\Table",2]]},{"file":"/var/www/html/apps/tables/lib/Service/TableService.php","line":149,"function":"enhanceTable","class":"OCA\\Tables\\Service\\TableService","type":"->","args":[["OCA\\Tables\\Db\\Table",2],"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/TableController.php","line":39,"function":"findAll","class":"OCA\\Tables\\Service\\TableService","type":"->","args":["admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/Errors.php","line":16,"function":"OCA\\Tables\\Controller\\{closure}","class":"OCA\\Tables\\Controller\\TableController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/tables/lib/Controller/TableController.php","line":40,"function":"handleError","class":"OCA\\Tables\\Controller\\TableController","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"index","class":"OCA\\Tables\\Controller\\TableController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\TableController"],"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\TableController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\TableController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["tables.table.index"]]},{"file":"/var/www/html/lib/base.php","line":988,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/table"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","Line":310},"message":"OCA\\Tables\\Db\\Row2Mapper::getFilterExpression(): Argument #2 ($column) must be of type OCA\\Tables\\Db\\Column, null given, called in /var/www/html/apps/tables/lib/Db/Row2Mapper.php on line 286 in file '/var/www/html/apps/tables/lib/Db/Row2Mapper.php' line 310","exception":{},"CustomMessage":"OCA\\Tables\\Db\\Row2Mapper::getFilterExpression(): Argument #2 ($column) must be of type OCA\\Tables\\Db\\Column, null given, called in /var/www/html/apps/tables/lib/Db/Row2Mapper.php on line 286 in file '/var/www/html/apps/tables/lib/Db/Row2Mapper.php' line 310"}}