I use the mobile theme. When viewed by Internet Explorer or an iPhone, the following error message is received:

•Notice: Undefined index: HTTP_USER_AGENT in mobile_theme_detect_php() (line 106 of /home/phoebusl/public_html/sites/all/modules/mobile_theme/mobile_theme.module).
•Notice: Undefined index: HTTP_USER_AGENT in mobile_theme_detect_php() (line 112 of /home/phoebusl/public_html/sites/all/modules/mobile_theme/mobile_theme.module).
•Notice: Undefined index: HTTP_USER_AGENT in mobile_theme_detect_php() (line 129 of /home/phoebusl/public_html/sites/all/modules/mobile_theme/mobile_theme.module).

CommentFileSizeAuthor
#4 HTTP_USER_AGENT-1399068-4.patch3.14 KBguenoz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

natuk’s picture

I get this error appearing in the logs as well, but I am not sure what client causes it.

guenoz’s picture

My website just started to get those errors as well..

trante’s picture

I also have this problem.

guenoz’s picture

a patch to get rid of those errors in the log

tunic’s picture

Status: Active » Needs review

Same problem here.

Patch from #4 removes warning, but I wonder if it removes functionality too. Patch checks if $_SERVER['HTTP_USER_AGENT'] is set, and if not no detection is made. If iPhone and IE seems to not send this header, how to detect those device? The patch just ignore them.

I've not tested the code live, just read it.

Anyway I change status to needs review because I'm not sure how detection works.

mchamps’s picture

Hi,
I'm getting the error continuously. Has there been any progress made?
Cheers.

Stephen Ollman’s picture

Issue summary: View changes

Errors is still being reported.

Notice: Undefined index: HTTP_USER_AGENT in mobile_theme_detect_php()
Notice: Undefined index: HTTP_ACCEPT in mobile_theme_detect_php()

bigmonmulgrew’s picture

+1

Getting this too. While the patch in 4 is ok to make my logs look cleaner it would be nice to get a solution for if we do not detect the user agent.