Posts: 31
Threads: 9
Joined: Sep 2009
Reputation:
0
Hey!
So I previously had a form that only would let people whom had a field marked to yes to be able to be shown in a view.
And then I changed the Submission Accounts feature to use that view, and if they were not enabled, they wouldn't be able to login.
It was for a HR system, like Employee Self-Service.
I have a question. Ever sense the change in the Filters page for views, ALL my filters are gone (although they are in MySQL) however, I can't add any new ones either.
Anytime I do and click Update, it returns like there was never any filter there.
I've been swearing and examining everything for the last 5 days, but I give in. Does anyone else here know what that means? Did I not update correctly, or is anyone else having this issue?
-Axel
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Hey Axel,
Hmm... it almost sounds like maybe the DB didn't get updated.
Try this: compare your view_filters and views tables with the following (sorry for the PHP, I just copied it from the installation script). Do they look the same (i.e. have the same columns)?
Code: $g_sql[] = "CREATE TABLE %PREFIX%view_filters (
filter_id mediumint(8) unsigned NOT NULL auto_increment,
view_id mediumint(8) unsigned NOT NULL,
filter_type enum('standard', 'client_map') NOT NULL default 'standard',
field_id mediumint(8) unsigned NOT NULL,
operator enum('equals','not_equals','like','not_like','before','after') NOT NULL default 'equals',
filter_values mediumtext NOT NULL,
filter_sql mediumtext NOT NULL,
PRIMARY KEY (filter_id)
) TYPE=InnoDB DEFAULT CHARSET=utf8";
$g_sql[] = "CREATE TABLE %PREFIX%views (
view_id smallint(6) NOT NULL auto_increment,
form_id mediumint(8) unsigned NOT NULL,
access_type enum('admin','public','private','hidden') NOT NULL default 'public',
view_name varchar(100) NOT NULL,
view_order smallint(6) NOT NULL default '1',
num_submissions_per_page smallint(6) NOT NULL default '10',
default_sort_field varchar(255) NOT NULL default 'submission_date',
default_sort_field_order enum('asc','desc') NOT NULL default 'desc',
may_add_submissions enum('yes','no') NOT NULL DEFAULT 'yes',
may_edit_submissions enum('yes','no') NOT NULL default 'yes',
may_delete_submissions enum('yes','no') NOT NULL default 'yes',
has_client_map_filter enum('yes','no') NOT NULL default 'no',
has_standard_filter enum('yes','no') NOT NULL default 'no',
PRIMARY KEY (view_id)
) TYPE=InnoDB DEFAULT CHARSET=utf8";
- Ben
Posts: 31
Threads: 9
Joined: Sep 2009
Reputation:
0
Dec 12th, 2009, 10:56 PM
(This post was last modified: Dec 12th, 2009, 11:11 PM by axel.)
Hrm.
I glanced at the SQL, and apparently it's missing that SQL lines.
Do I need to run an Update Script to correct that?
-Axel
Okay. I added the filters, and it seems to be fixed.
Thank you.
-Axel
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Dec 13th, 2009, 10:09 AM
(This post was last modified: Dec 13th, 2009, 10:09 AM by Ben.)
Huh. I wonder how that happened... I just looked over the upgrade code and those changes should have been added. Hmm! This is a bit worrying. Anyone else encountered the same problem?
I'd just add the new fields manually via phpMyAdmin or whatever database management you're using. The order of the columns isn't important, but I'd suggest adding them in the order specified in the SQL code I posted for consistency.
The only new fields are:
view_filters table:
filter_type enum('standard', 'client_map') NOT NULL default 'standard'
views table:
has_client_map_filter enum('yes','no') NOT NULL default 'no'
has_standard_filter enum('yes','no') NOT NULL default 'no'
Let me know how it goes.
If this is pretty new to you, back up the database first just in case (it never hurts and it can be a real life-saver sometimes!)
- Ben
|