I have Mobiles Tools running on a production site and it works fine but I am getting an error when cron runs. In the email report that gets sent to me when the cron job is run, I get multiple warnings.

PHP Warning:  Unable to parse URL in .../sites/all/modules/mobile_tools/mobile_tools.module on line 843
PHP Warning:  array_key_exists(): The second argument should be either an array or an object in .../sites/all/modules/mobile_tools/mobile_tools.module on line 844
PHP Warning:  parse_url(http:///mobile): Unable to parse URL in .../sites/all/modules/mobile_tools/mobile_tools.module on line 715
PHP Warning:  Unable to parse URL in .../sites/all/modules/mobile_tools/mobile_tools.module on line 718

Has anyone run into this? The dev version of site running locally works fine.

CommentFileSizeAuthor
#8 mobile_tools_cron_warnings.patch464 bytesmillenniumtree

Comments

deverman’s picture

Our cron is also not running properly when mobile tools is enabled. I didn't see this warning yet but maybe our php doesn't have those warnings enabled. Does cron not work with mobile tools? That would seem unlikely there must be someway to configure it to work? I have set "cron.php" as an exception on the mobile tool page redirection text box but this still didn't work.

3rdvalve’s picture

I ran into the same problem. The cron ran fine manually but failed if run through the server's cron handling. Putting an exception in the Mobile Tools interface did not help.

I solved the problem by configuring the cron to run with the nomobile setting (http://example.com/cron.php?nomobile=true)

twom’s picture

Assigned: Unassigned » twom
ezar’s picture

Same here +1

Logs:
[Mon Aug 02 15:00:01 2010] [error] [client 188.40.96.138] PHP Notice: Undefined index: host in /usr/local/www/apache22/data/sites/all/modules/contrib/mobile_tools/mobile_tools.module on line 727
[Mon Aug 02 15:00:01 2010] [error] [client 188.40.96.138] PHP Notice: Undefined index: host in /usr/local/www/apache22/data/sites/all/modules/contrib/mobile_tools/mobile_tools.module on line 730
[Mon Aug 02 15:00:01 2010] [error] [client 188.40.96.138] PHP Warning: strpos() [function.strpos]: Empty delimiter in /usr/local/www/apache22/data/sites/all/modules/contrib/mobile_tools/mobile_tools.module on line 752

Regards,
eZar.

twom’s picture

Status: Active » Fixed

This should be fixed in the dev version by replacing the reference to $_SERVER['SERVER_NAME'] to $_SERVER['HTTP_HOST'] plus an extra check if the value is set.

Feel free to test!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

armyofda12mnkeys’s picture

Just curious, is this fixed in 6.x-2.1?
I wasn't sure as it looks very recent update and it was fixed in dev on august 18th so I assumed it would be fixed in that release (not working for me so I am going to use ?nomobile=true for now).

millenniumtree’s picture

StatusFileSize
new464 bytes

Fixed in 6.x-2.x-dev as of the 2011-Jun-24 commit.
NOT fixed in even 6.x-2.3

I really hate having to install -dev versions on PRODUCTION sites.
Anyone who has this in 6.x-2.3 and doesn't want to use the -dev, here's a very tiny patch.

mherchel’s picture

I'm getting the this error even after upgrading today to the latest dev version (6.x-2.x-dev from 2011-Jun-23)

[24-Feb-2012 13:20:01] PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/gatortai/public_html/includes/bootstrap.inc on line 1165
[24-Feb-2012 13:20:01] PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/gatortai/public_html/includes/bootstrap.inc on line 1165
[24-Feb-2012 13:20:01] PHP Warning:  parse_url(http://) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in /home/gatortai/public_html/sites/default/modules/mobile_tools/mobile_tools.module on line 646
[24-Feb-2012 13:20:01] PHP Warning:  array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in /home/gatortai/public_html/sites/default/modules/mobile_tools/mobile_tools.module on line 647
[24-Feb-2012 13:20:01] PHP Warning:  parse_url(http://) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in /home/gatortai/public_html/sites/default/modules/mobile_tools/mobile_tools.module on line 646
[24-Feb-2012 13:20:01] PHP Warning:  array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in /home/gatortai/public_html/sites/default/modules/mobile_tools/mobile_tools.module on line 647
[24-Feb-2012 13:20:01] PHP Warning:  parse_url(http://) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in /home/gatortai/public_html/sites/default/modules/mobile_tools/mobile_tools.module on line 646
[24-Feb-2012 13:20:01] PHP Warning:  array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in /home/gatortai/public_html/sites/default/modules/mobile_tools/mobile_tools.module on line 647