Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My site was upgrading from D6 to D7 with this module previously installed in D6. So it also being upgrade from 6.x to 7.x.
When I try to perform any invalid term, these error come out.
Notice: Undefined index: host in search404_search_engine_query() (line 96 of /home/parasolx/domains/parasolx.net/public_html/sites/all/modules/search404/search404.module).
Notice: Undefined index: query in search404_search_engine_query() (line 97 of /home/parasolx/domains/parasolx.net/public_html/sites/all/modules/search404/search404.module).
i have tried uninstall and re-install, but these error still come out.
Comment | File | Size | Author |
---|---|---|---|
#7 | search404.module.patch | 505 bytes | joelstein |
Comments
Comment #1
picsofle CreditAttribution: picsofle commentedI get the same error.
Comment #2
skaduWanted to confirm I am experiencing the same problem. This issue seems to occur when users try to visit a page directly on the site. Line 94 ( $parsed_url = parse_url($_SERVER['HTTP_REFERER']); ) assumes that you have been referred to the page by a search engine. When the following lines attempt to get the host and query information from the $parse_url array, they return undefined. It seems that parse_url stops at [path] if there was no referrer, instead of crating the full array (http://php.net/manual/en/function.parse-url.php).
My fix was to check to see if the keys were set in the parsed url and if they were assign them to the $remote_host and $query variables, otherwise, I set those variables to nothing. This seems to have removed the notices. Not sure if this way you want to handle it within the module or not.
Comment #3
Peter Bowey CreditAttribution: Peter Bowey commentedSee entry at http://drupal.org/node/1111918
Peter Bowey
Comment #4
zyxware CreditAttribution: zyxware commentedThanks for the report. I have fixed this in the latest 7.x-1.x dev branch.
Comment #6
joostvdl CreditAttribution: joostvdl commentedI downloaded the dev release, but I still suffer this issue:
Comment #7
joelstein CreditAttribution: joelstein commentedMe too, I don't see this changed at all in dev. Attached is a two-line patch which fixes the issue.
Comment #8
rootworkThis also was not changed in the latest dev for me. The patch in #7 fixed it for me.
Comment #9
carusen CreditAttribution: carusen commentedI have this issue as well.
The patch seems to have fixed the issue. Shouldn't it be applied to an official release and save others the trouble of patching stuff by themselves?
Comment #10
rootworkWell, the point was that it hasn't even been applied to the dev release. But yes, that would be ideal.
Comment #11
zyxware CreditAttribution: zyxware commentedSorry about the mixup. The patch has been applied in the 7.x-1.x branch and should be available in the dev release in 24 hrs.
http://drupalcode.org/project/search404.git/blobdiff/9670197a0f8a6374dc8...
Comment #12
zyxware CreditAttribution: zyxware commentedComment #14
viktor.mastoridis CreditAttribution: viktor.mastoridis commentedOn Drupal 7 I am getting these Notices although I patched the two various patches mentioned here and on another similar topic. I also installed the dev-module, but no joy there either. I get these error messages when I enter a wrong web-address manually. And I can't seem to be able to disable the php notices anyway, as I am on a shared hosting plan (site5)
Comment #15
viktor.mastoridis CreditAttribution: viktor.mastoridis commentedI couldn't solve the above mentioned errors in Drupal 7, so I emailed the support staff of site5.com (my host) who placed a php.ini file in the /public_html folder with:
display_errors = Off
It didn't help.
I was still getting the notices (and complaining:-), till another member of their staff edited the settings.php file and added this line:
ini_set('error_reporting', E_ALL & ~E_NOTICE);
Now the notices are gone.
I provide this in case someone needs a quick fix for the Notices in Drupal 7 created by the Search 404 module;