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.
Getting this notice: Notice: Undefined index: url in httprl_send_request() (line 491 of /sites/all/modules/httprl/httprl.module).
I have a script that goes through URLs 100 at a time and gets the page data. I guess something is happening when it is mapping the redirects.
I logged the variables to see what the values were in the failed cases. Here's an example if it helps (logged on line 491 above the if statement):
$info['redirect_url'][0] - http://toppietrips.com/
$values['url'] - undefined
$values['redirect_url'][0] - http://www.mobilephonefinder.com.au/mobile-phones/htc/
Comment | File | Size | Author |
---|---|---|---|
#9 | httprl-1278482-9.patch | 569 bytes | mikeytown2 |
#1 | httprl-1278482-1.patch | 679 bytes | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedThat's a strange error you encountered. Reason is I set the URL in the array. Code in question:
My only guess is that unsetting the $redirects in the loop is causing issues. Patch below addresses this theory. Please test and let me know.
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedComment #3
modstore CreditAttribution: modstore commentedThanks for the fast reply.
This patch doesn't seem to help though, as $values is set, just not the url value for some reason. I will try and put together a test set of urls that causes this problem when I get a chance.
Cheers.
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedComment #5
modstore CreditAttribution: modstore commentedok, I finally got to testing this, and here is a snippet that will give the error, also, it seems there is no response for the url in this case either.
After running this, I only get a response for the second URL, and there is notices in the log.
Comment #6
modstore CreditAttribution: modstore commentedAny update on this at all?
Comment #7
modstore CreditAttribution: modstore commentedI did some debugging, and the headers Host variable is not being updated to the redirect host, so I made the following change. Not sure if there is a problem with always overriding this variable, but works now for my tests.
Comment #8
modstore CreditAttribution: modstore commentedComment #9
mikeytown2 CreditAttribution: mikeytown2 commentedI actually use that code there; but thanks for pointing me in the right place. I've fixed the code, this patch has been committed.
Comment #10
modstore CreditAttribution: modstore commentedGreat thanks mate, this module makes my project much more efficient. Keep up the good work.