Hi,

I upgraded 6.x-2.2 to 6.x-2.3 and contexts for mobile device in context condition stopped working. Then, I downgraded to 6.x-2.2 again and it started working again.

Am I missing something on upgrade process? Or, is this a bug? I can't provide any suggestions yet since I'm new to Mobile Tools and Context API.

Thanks :)

CommentFileSizeAuthor
#1 context_fix-1185974-1.patch588 bytesjustin2pin

Comments

justin2pin’s picture

Status: Active » Needs review
StatusFileSize
new588 bytes

Not sure if this is the same issue, but when I initially installed mobile_tools -- before upgrading context -- I white screened because the earlier version of context did not use the function context_get_plugin(). The attached patch uses function_exists("context_get_plugin") rather than module_exists("context"), which will at least prevent a fatal PHP error.

To get context integration, you'll still need to upgrade to the latest stable context release.

gantenx’s picture

It's different issue. Well, it looks like I didn't clearly say what the problem was. :-P

I was using Context 6.x-3.0 and Mobile Tools 6.x-2.2 to detect client's device. My system detected devices correctly until I updated Mobile Tools to 6.x-2.3 version. There was no error message appeared. It just failed in device detection.

:)

danielphenry’s picture

just hit this one as well. Any ideas what is causing this?

danielphenry’s picture

Got it. Real simple fix so I didn't bother to create a patch

in mobile_tools.module
function mobile_tools_init
line 217

   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']);
      }
   }

Should be:

   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']);
      }
   }

Just a problem of using the wrong polarity in the if statement.

bachbach’s picture

#4 works for me, thanks !

barraponto’s picture

Status: Needs review » Closed (duplicate)