I'm trying to set the iPad theme to the desktop theme, but it is not working. I believe the issue has to do with mt_browscap.module and it's failure to identify the iPad as being in the iPad $group. This is the code that fails to identify the iPad as being in the iPad group:

// Check if the current user agent name can be found within the list of
// device groups
if (isset($user_agent['browser']) && in_array($user_agent['browser'], $groups)) {
  $device_information['group'] = array_search($user_agent['browser'], $groups);
}

Here is a print_r of the $user_agent I get here for the iPad:

Array
(
    [comment] => Mobile Safari 5.1
    [browser] => Safari
    [version] => 5.1
    [majorver] => 5
    [minorver] => 1
    [platform] => iOS
    [platform_version] => 5.0
    [alpha] => false
    [beta] => false
    [win16] => false
    [win32] => false
    [win64] => false
    [frames] => true
    [iframes] => true
    [tables] => true
    [cookies] => true
    [backgroundsounds] => false
    [javascript] => true
    [vbscript] => false
    [javaapplets] => false
    [activexcontrols] => false
    [ismobiledevice] => true
    [issyndicationreader] => false
    [crawler] => false
    [cssversion] => 3
    [aolversion] => 0
    [parent] => Mobile Safari 5.1
    [useragent] => Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3
    [browser_name_pattern] => Mozilla/5.0 (iPad*CPU*OS 5?0* like Mac OS X*)*AppleWebKit/*(*KHTML, like Gecko*)*Mobile/*
)

Which tells me that the information from browscap module has changed over time and it's no longer sufficient to check the 'broswer' key here to determine the device group.

What can be done?

Thanks,
Matt

Comments

johngonole’s picture

Yea, I can confirm same for my site. IPAD users are switched to the mobile theme I'm using and I've checked the box so that they would be switched to my nonmobile theme. But it simply isn't working. can't code so I can't fix

apaderno’s picture

Version: 6.x-2.7 » 6.x-2.x-dev
Status: Active » Closed (outdated)

I am closing this issue, as it's for a Drupal version no longer supported.