nextcloud / tables

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

fix: properly delete rows in views #826

Closed enjeck closed 9 months ago

enjeck commented 9 months ago

This PR fixes an issue with deleting rows in a view.

Steps to reproduce:

Error traces: ``` master-nextcloud-1 | {"reqId":"Tc9DQHagtkcXkVMZz29Q","level":3,"time":"2024-02-07T11:07:32+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"tables","method":"DELETE","url":"/index.php/apps/tables/view/17/row/522","message":"Array","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","version":"29.0.0.5","data":{"app":"tables"}} master-nextcloud-1 | {"reqId":"Tc9DQHagtkcXkVMZz29Q","level":3,"time":"2024-02-07T11:07:32+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"tables","method":"DELETE","url":"/index.php/apps/tables/view/17/row/522","message":"Update row is not allowed.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","version":"29.0.0.5","exception":{"Exception":"Exception","Message":"Update row is not allowed.","Code":0,"Trace":[{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":133,"function":"delete","class":"OCA\\Tables\\Service\\RowService","type":"->","args":[522,17,"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/Errors.php","line":16,"function":"OCA\\Tables\\Controller\\{closure}","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":134,"function":"handleError","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"destroyByView","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[522,17]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"destroyByView"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"destroyByView"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\RowController","destroyByView",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["17","522","tables.row.destroyByView"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/view/17/row/522"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/apps/tables/lib/Service/RowService.php","Line":442,"message":"Update row is not allowed.","exception":{},"CustomMessage":"Update row is not allowed."}} master-nextcloud-1 | {"reqId":"Tc9DQHagtkcXkVMZz29Q","level":2,"time":"2024-02-07T11:07:32+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"tables","method":"DELETE","url":"/index.php/apps/tables/view/17/row/522","message":"An internal error or exception occurred: OCA\\Tables\\Service\\RowService - delete: Update row is not allowed.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","version":"29.0.0.5","data":{"app":"tables"}} ```
juliusknorr commented 9 months ago

Needs one small fix for the php codestyle check. 😉 You can likely autofix that by running composer run cs:fix

github-actions[bot] commented 9 months ago

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!