when I update my drupal to 4.6.2,I can't use advance search.

Location /drupal/trip_search/advanced
Message Invalid argument supplied for foreach() in /home/mars/public_html/drupal/includes/tablesort.inc on line 160.

Comments

nedjo’s picture

Hmm. I haven't worked with 4.6.2 yet. Any hints as to the source of this error would be appreciated.

mr700’s picture

I did not upgrade but I see the same error with mysql 4.1.11 (latin1) and php 5.0.3 going to drupal/trip_search/advanced shows the following warnings (repeated two times):

warning: Invalid argument supplied for foreach() in /srv/www/html/drupal/includes/tablesort.inc on line 160.
warning: Invalid argument supplied for foreach() in /srv/www/html/drupal/includes/tablesort.inc on line 198.
warning: Invalid argument supplied for foreach() in /srv/www/html/drupal/includes/theme.inc on line 639.

I get the warnings only when entering the advanced search. Hope this helps.

Fransie’s picture

Using Drupal 4.6.2, MySQL 4.1.12 and PHP 5.0.4.
I get exactly the same errors as mr700 when using the advanced search option in trip_search.

Arek’s picture

I have the same errors as mr700 but when I upgrading drupal there was error:

warning: Invalid argument supplied for foreach() in /database/updates.inc on line 2149

so that ussue can be in drupal, not in trip_search

rjl’s picture

Am also having the same errors as mr700 in new installation of 4.6.3, reported this in the installation forum as http://drupal.org/node/29809 a few days ago, there is no resolve on that thread either.
Thanks for you assistance.

nedjo’s picture

Looks like the problem is likely related to a change in the parameters for theme_table(), see http://drupal.org/node/22218. In particular:

// Drupal 4.6
theme('table', '', $rows);
// Drupal 4.7
theme('table', array(), $rows);

It looks like this change crept into the 4.6.x upgrades, and that we therefore need to upgrade by changing the line

    $group = theme('table', '', $rows);

in function trip_search_form() to

    $group = theme('table', array(), $rows);

I'm not able to test this right away--can someone confirm if this change solves the issue?

moshe weitzman’s picture

i'm sure that will fix it.

Stomp Dancer’s picture

nedjo, the code you gave came out of the code block and with me being a beginner to php I don't want to try it without being 100% sure. What file would the changes need to be done in anyway?

nedjo’s picture

Version: 4.6.x-1.x-dev » master
Status: Active » Fixed

Fix applied to 4.6 and CVS head.

Anonymous’s picture

pem’s picture

Status: Fixed » Closed (fixed)