I'm using two different urls and two different contexts for the desktop and mobile version of the site.

One is named 'sitewide-context', the other 'mobile-sitewide-context'.
Inside 'sitewide-context' I have a context condition.
~mobile-*
That code basically tells 'sitewide-context' not to kick in when the 'mobile-sitewide-context' is on.

When I updated the module to 6.x-2.x-dev, the 'mobile-sitewide-context' stopped turning on. Only the 'sitewide-context' was appearing.

I also tried selecting a combination of mobile device contexts inside the context conditions area.

Originally it was just..
Context for mobile devices:
Mobile

But now it is..
Context for mobile devices:
Mobile
Desktop
iPhone
iPod
iPad
Android
Opera Mini
BlackBerry

Adding the specific devices in the context might have broken something in the context settings page. Will investigate further..

Comments

dlin’s picture

Not sure if this will help but I found the working context code before the upgrade:

   if(module_exists('context')){
      $plugin = context_get_plugin('condition', 'mobile');
      if(mobile_tools_site_type() == 'mobile'){
        $plugin->execute('mobile');
      }
   }

The new code inside 6.x-2.x-dev that is broken:

   if(module_exists('context')){
      $plugin = context_get_plugin('condition', 'mobile');
      if(!$plugin){
        $device = mobile_tools_get_device();
        $plugin->execute($device['type']);
        $plugin->execute($device['group']);
      }
   }

That code is being called inside the init() so this context bug may be related to this issue http://drupal.org/node/1118108 - "Call to a member function execute() on a non-object in ../contrib/mobile_tools/mobile_tools.module on line 221". After clearing cache I received the same execute() error.

dlin’s picture

Assigned: dlin » Unassigned
Status: Active » Fixed

Believe twom has already or will fix the dev version.
Instead of:

if(!$plugin)

Was fixed with:

if(is_object($plugin))

Status: Fixed » Closed (fixed)

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

tstackhouse’s picture

Version: 6.x-2.x-dev » 6.x-2.3

This is still not in a released version over a year later...