Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-04-27 18:30:27
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Plugin search feature doesn't work in IE or Chrome but does in Firefox
I’ve been developing a plugin based on txp_link.php in Firefox. It works with Firefox.
The admin side works fine. On the public or client side, I’m having trouble. A very similar listing and search routine (with necesary changes) is used on both sides, but editing and adding entries can only be done on the admin side.
When I try the public side in Google Chrome or Internet Explorer, I can get some of it to work, but most of the searches (anything except show all entries) will take the browser to the home page of the site.
This is odd, given that almost all of this is programming runs on the server, not in the browser. Shouldn’t it work the same in any browser?
Any idea of what could be causing this?
These lines from unsuccessful and successful traces seem to show the difference:
[SQL (0.000880002975464): insert into txp_log set `time`=now(),page='/index.php?search_method=azw_lm_table1_field1&crit=an&event=azw_lm&step=&search=Go',ip='141.157.19.146',host='pool-141-157-19-146.balt.east.verizon.net',refer='',status='200',method='GET']
[SQL (0.000358104705811): insert into txp_log set `time`=now(),page='/people-on-file?event=azw_lm&search_method=azw_lm_show_all',ip='141.157.19.146',host='pool-141-157-19-146.balt.east.verizon.net',refer='',status='200',method='GET']
The first shows that the search is redirecting back to the home page, but the second redirects to the correct section.
They are sent from different search forms on the page. I’ll show the HTML and longer traces below.
————————-
First I’ll show the top of the trace on a search that went to the home page when it should have returned to the listing page (didn’t work):
<!-- Runtime: 0.1580 -->
<!-- Query time: 0.108397 -->
<!-- Queries: 37 -->
<!-- Memory: 3146Kb, <txp:comments_invite wraptag="p" /> -->
<!-- txp tag trace:
[SQL (0.00844216346741): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.00809502601624): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.0035228729248): SHOW TABLES LIKE 'custom_fields']
[SQL (0.00574278831482): select azw_lm_table2_field2 from azw_lm_table2 where 1=1 ORDER BY azw_lm_table2_id]
[SQL (0.00129199028015): select page, css from txp_section where name = 'default' limit 1]
[SQL (0.00136303901672): select host from txp_log where ip='141.157.19.146' limit 1]
[SQL (0.000880002975464): insert into txp_log set `time`=now(),page='/index.php?search_method=azw_lm_table1_field1&crit=an&event=azw_lm&step=&search=Go',ip='141.157.19.146',host='pool-141-157-19-146.balt.east.verizon.net',refer='',status='200',method='GET']
[SQL (9.08374786377E-5): select user_html from txp_page where name='static_page']
[Page: static_page]
.... etc.
Here's the html for that search:
<form method="get" action="index.php" class="search-form"><p><label for="azw_lm-search">Search</label> <select id="azw_lm-search" name="search_method" class="list">
<option value="azw_lm_table1_field1" selected="selected">Last Name</option>
<option value="azw_lm_table1_field2">First Name</option>
<option value="azw_lm_table1_fields345">Units</option>
</select> <input type="text" name="crit" value="" size="15" class="edit" /><input type="hidden" name="event" value="azw_lm" /><input type="hidden" name="step" value="" /><input type="submit" name="search" value="Go" class="smallerbox" /></p></form>
------------------
Here's a beginning of a trace in which the page returned all entries (it worked):
><!-- Runtime: 0.0673 -->
<!-- Query time: 0.033294 -->
<!-- Queries: 32 -->
<!-- Memory: 3118Kb, end of textpattern() -->
<!-- txp tag trace:
[SQL (0.000226020812988): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.000728130340576): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.000502109527588): SHOW TABLES LIKE 'custom_fields']
[SQL (0.000351905822754): select azw_lm_table2_field2 from azw_lm_table2 where 1=1 ORDER BY azw_lm_table2_id]
[SQL (0.000163078308105): select name from txp_section where `name` like 'people-on-file' limit 1]
[SQL (0.000884056091309): select page, css from txp_section where name = 'people-on-file' limit 1]
[SQL (0.00032901763916): select host from txp_log where ip='141.157.19.146' limit 1]
[SQL (0.000358104705811): insert into txp_log set `time`=now(),page='/people-on-file?event=azw_lm&search_method=azw_lm_show_all',ip='141.157.19.146',host='pool-141-157-19-146.balt.east.verizon.net',refer='',status='200',method='GET']
[SQL (0.000291109085083): select user_html from txp_page where name='29ers_on_file']
[Page: 29ers_on_file]
.... etc.
And here’s the html code for the link that did that:
<p><strong><a href="?event=azw_lm&search_method=azw_lm_show_all">Show All Entries</a></strong></p></div>
<p style="text-align: center; font-weight: bold;">1057 entries found</p>
I could show you the TXP code, if that helps.
What do you think is going on?
Last edited by azw (2009-04-27 18:38:25)
Offline
#2 2009-04-28 08:41:19
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: Plugin search feature doesn't work in IE or Chrome but does in Firefox
UPDATE:
It all works on my localhost server (on a Win Vista machine), so it seems as though there is a setting difference between the localhost and live servers. I’m in over my head on that one. If anyone has an idea of what’s set differently, I’d love to know.
It also appears that in Firefox, the links (or actions on the forms) change to include the section on the public side. In IE and Chrome, they don’t, so the browser goes to the home page.
The forms are created using the admin side functions rather than public tags, so I suppose there’s a problem on the public side because $step and $event don’t have the same utility as on the admin side. I’ll probably have to adapt the form functions to include the section in the action and place the new functions in my plugin.
Last edited by azw (2009-04-28 08:41:48)
Offline