Open ocbroadband opened 6 years ago
Hmm, sorry you're having trouble, I've never seen that before. Testing locally it's working fine.
Could you check your PHP error logs to see if it provides any additional information?
One thought: how many fields are in your View? If it's a very high number, possibly there's a server configuration that limits the size of the POST request... but I'm surprised it would result in a 500 error.
I have tailed the log when I attempt to perform the update, however, I'm not quite sure how to interpret it. Here's a copy of the log which I redacted with url/path replacements and environment.
PHP Version | 7.2.7 MySQL Version | 5.6.34-log
[Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'may_copy_submissions' in 'field list' in /home/xxxxx/xxxxx/ft/global/code/Database.class.php:71, referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: Stack trace:, referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: #0 /home/xxxxx/xxxxx/ft/global/code/Database.class.php(71): PDO->prepare('\n UP...'), referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: #1 /home/xxxxx/xxxxx/ft/global/code/Views.class.php(748): FormTools\Database->query('\n UP...'), referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: #2 /home/xxxxx/xxxxx/ft/global/code/Views.class.php(702): FormTools\Views::updateViewMainSettings('3', Array), referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: #3 /home/xxxxx/xxxxx/ft/admin/forms/edit/page_edit_view.php(30): FormTools\Views::updateView('3', Array), referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: #4 /home/xxxxx/xxxxx/ft/admin/forms/edit/index.php(122): require_once('/home/xxxxx/ocs...'), referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: #5 {main}, referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2 [Thu Sep 06 21:00:50 2018] [warn] [client x.x.x.x] mod_fcgid: stderr: thrown in /home/xxxxx/xxxxx/ft/global/code/Database.class.php on line 71, referer: https://www.xxxxx.xxx/ft/admin/forms/edit/index.php?page=edit_view&view_id=3&edit_view_tab=2
Thanks - actually that does explain it. In recent FT versions a new may_copy_submissions field
was added to the views table, but in your case it's not there. Hmm! I'll look into this, but in the meantime you can just run this SQL command on your database. That should fix the problem:
ALTER TABLE ft_views ADD may_copy_submissions ENUM('yes','no') NOT NULL DEFAULT 'no'
AFTER may_add_submissions
^^ Please change "ftviews" to whatever your views table is called (the `ft` prefix is configurable).
N.B. if anyone else encounters this issue, would you mind commenting on this post?
Ok, so I ran the above against my ft3 install(ft3_), and it looks like it added the column. I re-attempted to update the view(s), and they update successfully now. Thank you Ben!
No problem, glad it fixed it! Very puzzling how it was ever an issue, so I'll just leave this ticket open in case anyone else encounters it.
v3.0.6 - Attempting to add a new row to a view, which it does successfully, but when I click 'update', the page thats returned is a 500 error. If I hit refresh, the page comes back fine, but the update doesn't occur. If I create a new view with all the fields, then it pulls in all the rows I needed fine.
Update: This appears to be the same issue across anything regarding views, and updating the number of columns or fields to be displayed in a view.