Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

GM 2.2 Search User Form Does Not Function

Quote Reply
GM 2.2 Search User Form Does Not Function
Hi,

The Search User Form does not function. No matter whatever i do, upon clicking the button nnothing happens.

Any Clues on how to get it functional. This has also been there in 2.2RC1 which I had mentioned alongwith the mass mail bug. The mass mail bug is fixed but the search still is not functional....

Anup
Quote Reply
Re: [anup123] GM 2.2 Search User Form Does Not Function In reply to
I just tried searching for users in the latest CVS copy and it works. It also works on a 2.2.0 copy too. Which form exactly are you talking about. I looked at your mass mail bug thread and didn't see anything regarding a bug in the search forms.

Adrian
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi Adrian.

In the masss mail bug thread, to Jason's suggestion of using the search utility in the mass mail (selected users) i had put this as reply:

>I keep clicking the button but seems that search does not start at all .....

The Search Users form in the Admin with all the table columns from users and dgraph table. This has stopped functioning after the upgrade to 2.2.0 I am not sure of reasons but it does not function. Whatever i want to search and when i click the button, there is nothing happening at all. Search does not start.

Thnx

Anup
Quote Reply
Re: [anup123] GM 2.2 Search User Form Does Not Function In reply to
Well I can't duplicate it here. You'll have to give me access to your admin if you want me to figure out what's going on.

Adrian
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi,

It works OK in a clean install. Problem is wrt upgrade from 2.1.0 to 2.2.0 where the Search User form is not working at all. I am trying to figure it out but could it be because of position of the attributes? The clean install and the upgrade install webmail_users.def files have different content wrt position of attributes...

Anup
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi Adrian,

On the upgraded install (live install), the following works:

http://mydomain.com/...h&do=search_form

http://mydomain.com/...s&do=search_form

but when the two are taken together (the default user search form):

http://mydomain.com/...s&do=search_form

Then the search does not work at all.

Any clues on this?

Anup
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi Adrian,

I have debugged it. The observations ( a deviation from the earlier version) is:

From the def files (users and dgraph) i had to remove the additional columns added to the dgraph and users table. Once i remove them from the def file (not from the database as i cannot ... it already has records) the search starts working. Any workaround to have the search working with the updated def files also?

[edit] By updated def file is meant that the def files have details of additional columns added to the dgraph and users table ... these are columns added in addition to GM installation ... or is it a 2.2 bug[/edit]

Anup

Last edited by:

anup123: Nov 25, 2003, 8:03 PM
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function -- Is there a limitation on number of attributes? In reply to
Hi Adrian.

I carried on from my previous post and did the debug on a test installation. The findings are as follows:

webmail_dgraph has 14 columns (extra added by me since begining).

webmail_users has 21 columns (instead of 17 by default).

webmail_dgraph.def changes
  • updated the dgraph.def file to include all the attributes.=>Search Did Not Work.
  • manually removed the extra attributes one by one. =>Search Did Not work as long as there were >12 attributes in the dgraph.def file.
  • no matter which extra attributes were added in the def file (by hand) the search user form worked fine as long as there were 12 attributes in the def file. Beyond that it failed. By failed is meant that on clicking the Search Button nothing really happened.


webmail_users.def changes
  • With the above in place updated the users.def file =>Search Did Not Start
  • Removed All The extra attributes from the def file and then added one =>Search Functions
  • Added another one to the def file and search failed.
  • The failure is independent of the extra attribute added to def file. No matter whatever is added, search functions with upto 18 defined in users.def file (with 12 already there in the dgraph.def file)


Check on total attributes in search form (based on dgraph.def+users.def)

Just to check whether the failure was occuring on a comination of attributes exceeding 30 (dgraph.def+users.def). So reduced the dgraph.def by one extra attribute and added one additional attriubute to users.def file. The search functioned.

So upto 30 attributes in dgraph.def and users.def the search functions no matter which def file is being updates.

Why should the Search Fail (the form simply does not move on addition of 31st filed) beyond 30 attributes total (irrespective of which def file it is coming from) or is this a Bug?

The tables schema are as follows:

#
# Table structure for table `webmail_dgraph`
#

CREATE TABLE webmail_dgraph (
dgraph_userid int(10) unsigned NOT NULL default '0',
dgraph_email varchar(75) NOT NULL default '',
dgraph_first_name varchar(25) NOT NULL default '',
dgraph_last_name varchar(25) NOT NULL default '',
dgraph_address varchar(100) NOT NULL default '',
dgraph_city varchar(75) NOT NULL default '',
dgraph_state varchar(50) NOT NULL default '',
dgraph_zip varchar(10) NOT NULL default '',
dgraph_country varchar(50) NOT NULL default '',
dgraph_tempid varchar(15) NOT NULL default '',
dgraph_subdate date default '2003-04-04',
dgraph_actdate date default '2003-04-04',
dgraph_rdate date default '2004-04-04',
dgraph_tel varchar(15) default NULL,
PRIMARY KEY (dgraph_userid),
UNIQUE KEY dgraph_tempid(dgraph_tempid)
) TYPE=MyISAM;



#
# Table structure for table `webmail_users`
#

CREATE TABLE webmail_users (
userid int(10) unsigned NOT NULL auto_increment,
email varchar(255) NOT NULL default '',
password varchar(16) binary NOT NULL default '',
users_status enum('Not Validated','Validated','Suspended') NOT NULL default 'Validated',
users_last_login int(11) default '0',
users_space_used float(12,2) NOT NULL default '0.00',
users_space_allowed float(12,2) NOT NULL default '0.00',
users_max_pop int(11) NOT NULL default '5',
users_pass_phrase varchar(255) default NULL,
users_pass_answer varchar(255) default NULL,
users_join_time int(11) NOT NULL default '0',
users_default_template varchar(255) default 'default',
users_footer enum('Yes','No') NOT NULL default 'Yes',
users_hosting_use enum('Yes','No') default 'No',
hosting_record_created datetime NOT NULL default '0000-00-00 00:00:00',
hosting_record_expires date NOT NULL default '0000-00-00',
hosting_record_updated timestamp(8) NOT NULL,
users_max_profiles int(11) NOT NULL default '10',
users_globaddr_edit int(11) NOT NULL default '0',
users_payment_level varchar(32) default NULL,
users_payment_expiry int(11) NOT NULL default '0',
PRIMARY KEY (userid),
UNIQUE KEY userunique(email),
KEY users_pass_ndx(password)
) TYPE=MyISAM;




Thnx

Anup
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi Adrian.

Could u please throw some light on this 30 attribute limit for search to fucntion. I can use the Search User form as long as the total attributes as in def file is <=30. The moment it goes beyong 30, the search form does not respond to button click/pressed. So in order to use the Search User (for mass mail to selected users/delete users etc), the only work around for me is to limit the number of attributes to <=30.

Is this a limitation or a bug?

Thnx

Anup
Quote Reply
Re: [anup123] GM 2.2 Search User Form Does Not Function In reply to
It's a bug. I'll should have a fix on Tuesday.

Adrian
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi Adrian.

Do let us know what needs to be doen on our copy to get over this bug.

Thnx

Anup
Quote Reply
Re: [anup123] GM 2.2 Search User Form Does Not Function In reply to
Hi Anup,

The problem was that the form was using a GET method. To fix this, edit admin/GMail/SQL/Admin.pm:
Code:
Index: SQL/Admin.pm
===================================================================
retrieving revision 1.54
diff -u -r1.54 Admin.pm
--- SQL/Admin.pm 23 Nov 2003 00:14:14 -0000 1.54
+++ SQL/Admin.pm 10 Dec 2003 00:19:47 -0000
@@ -908,7 +908,7 @@
print $self->{in}->header;
print $self->_start_html({ title => "Search Form" });
print $self->_header("Search Form", $msg || "Search the database to view records.");
- print $self->_start_form({ do => "search_results", db => $self->{cgi}->{db}, method => 'GET' } );
+ print $self->_start_form({ do => "search_results", db => $self->{cgi}->{db}, method => 'POST' } );
print $self->{html}->form({ mode => 'search_form', search_opts => 1 });
print "<p>", $self->_search_options;
print "<p>", $self->_buttons("Search");
@@ -936,7 +936,7 @@

print $self->_start_html({ title => "Delete Records" });
print $self->_header("Delete Records", $msg || "Search to delete records.");
- print $self->_start_form({ do => "delete_search_results", db => $self->{cgi}->{db}, method => 'GET' } );
+ print $self->_start_form({ do => "delete_search_results", db => $self->{cgi}->{db}, method => 'POST' } );
print $self->{html}->form({ mode => 'delete_search_form', search_opts => 1 });
print "<p>", $self->_search_options;
print "<p>", $self->_buttons("Search");
@@ -965,7 +965,7 @@

print $self->_start_html({ title => "Modify Record" });
print $self->_header("Modify Record", $msg || "Search to modify a record.");
- print $self->_start_form({ do => "modify_search_results", db => $self->{cgi}->{db}, method => 'GET' } );
+ print $self->_start_form({ do => "modify_search_results", db => $self->{cgi}->{db}, method => 'POST' } );
print $self->{html}->form({ mode => 'modify_search_form', search_opts => 1 });
print "<p>", $self->_search_options({ modify_mult => 1 } );
print "<p>", $self->_buttons("Search");

Adrian
Quote Reply
Re: [brewt] GM 2.2 Search User Form Does Not Function In reply to
Hi Adrian.

The Search Form now moves but no matter whatever i try to search by it always returns "No Resluts" So the problem is still not completely sorted out. In fact much after this was noticed i had tried taking the source of the form and putting up a static form replacing GET with POST na dspecifying the full path to admin.cgi and had got a similar behaviour.

---Edit---

In fact even after doing the GET/POST replacement the sorce of Email>>Selected USers still shows GET .

Also, the POST method works (just like GET method did) when i reduce the total number of variables to <= 30. So the method (get/post) isn't really helping, it's the limit of 30 which is causing all this.

---Edit---

So now that Search Form responds but does not really get me the search results what do i do next?

Thnx

Anup

Last edited by:

anup123: Dec 10, 2003, 2:38 AM
Quote Reply
Re: [anup123] GM 2.2 Search User Form Does Not Function In reply to
In Reply To:
In fact even after doing the GET/POST replacement the sorce of Email>>Selected USers still shows GET .

Did you restart Apache so mod_perl can reload the modules?

~Charlie
Quote Reply
Re: [Chaz] GM 2.2 Search User Form Does Not Function In reply to
Hi Charlie.

Yes i had restarted the apache. Inoreder to double check i restarted again and same result. Then i thought of having a peek at something where a GET is still left..... a bit of shot in the dark and then in SendEmail.pm there is this GET is sub search_form Smile

Replaced this with POST recreated the def files to include every column in the tables (using your utility), restarted apache again and then all the Search Form started Working.

So thanks a lot Adrian and Charlie.... But even the GET in SendEmail.pm needs to be replaced with POST for the debugging to be complete :)

--EDIT /admin/Gmail/Admin/SendEmail.pm--

@@ +51,7 -51,7 @@
print $IN->header;
print $admin->_start_html({ title => "Search Form" });
print $admin->_header("Search Form", $msg);
+ print $admin->_start_form({ page => "email_compose.html", action => 'GMail::Admin::SendEmail::search_results', db => [qw/users dgraph/], method => 'POST' });
- print $admin->_start_form({ page => "email_compose.html", action => 'GMail::Admin::SendEmail::search_results', db => [qw/users dgraph/], method => 'GET' });
print $admin->{html}->form({ hide => [$GT::SQL::PREFIX . 'users.users_join_time'], mode => 'search_form', search_opts => 1 });
print "<p>", $admin->_search_options;
print "<p>", $admin->_buttons("Search");

--EDIT END--

Thnx Charlie for pointing the way :)

Anup

Last edited by:

anup123: Dec 13, 2003, 10:45 AM