am getting this error after upgrading to latest dev (24 April 2011):

Fatal error: Call to undefined function mobile_tools_is_mobile_site() in /var/www/drupal7/sites/all/modules/mobile_tools/mobile_tools.module on line 818

i fixed it by modifying line 817, changing mobile_tools_is_mobile_site() to mobile_tools_is_mobile_device():

function mobile_tools_node_load($node, $types) {
  if (mobile_tools_is_mobile_device() && variable_get('mobile_tools_enable_build_mode', 0)) {
    $node->build_mode = 'mobile_tools';
  }
}
CommentFileSizeAuthor
#7 undefined_function-1137384.patch625 byteshansyg

Comments

toxiclung’s picture

Status: Active » Needs review
ajtoelle’s picture

Status: Needs review » Reviewed & tested by the community

Had same issue, this fix worked for me.

jlaurin’s picture

When i do this solution, i have two whites bars at the top and the bottom...

Anyone else have this?

Anonymous’s picture

@jlaurin: I get the same white bars. Don't understand what's the reason...

paul_gregory’s picture

@jlaurin & @redo - I also got bars output to the page that turned out to be a pair of <pre></pre> tags left in the code whilst someone was debugging. Commenting out lines 734 and 736 of mobile_tools.module fixed the issue for me.

function mobile_tools_html_head_alter(&$head_elements){
 //print '<pre>';
 //print_r($head_elements);
 //print '</pre>';
  $site = mobile_tools_site_type();
  if(variable_get('mobile_tools_add_header', 1) && $site == 'mobile'){
    $head_elements['viewport'] = array(
      '#type' => 'html_tag',
      '#tag' => 'meta',
      '#attributes' => array(
        'name' => 'viewport',
        'content' => 'user-scalable=no, width=device-width, maximum-scale=1.0',
      ),
    );
    
    $head_elements['apple_mobile_web_app_capable'] = array(
      '#type' => 'html_tag',
      '#tag' => 'meta',
      '#attributes' => array(
        'name' => 'apple-mobile-web-app-capable',
        'content' => 'yes',
      ),
    );
    
    $head_elements['HandheldFriendly'] = array(
      '#type' => 'html_tag',
      '#tag' => 'meta',
      '#attributes' => array(
        'name' => 'HandheldFriendly',
        'content' => 'true',
      ),
    );
  }  
}
hansyg’s picture

The fix in the issues description worked for me.

i fixed it by modifying line 817, changing mobile_tools_is_mobile_site() to mobile_tools_is_mobile_device():

I was going to make a patch but this looks good to go yes?

hansyg’s picture

StatusFileSize
new625 bytes

I made the patch anyway. Attached. If you give me a commit bit I would be happy to implement.

~ Hans

toxiclung’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

cool :D

akoepke’s picture

Updated to the latest dev version and there is some debug code which was left partially active.

The code below was taken directly from the dev version I just downloaded.


function mobile_tools_html_head_alter(&$head_elements){
  print '<pre>';
 //print_r($head_elements);
  print '</pre>';

I noticed this because the content appearing before the doctype declaration causes IE 9 to go into Quirks mode. The result of this is that my site suddenly looked totally screwed in IE.

chrylarson’s picture

thank you, toxiclung changing from site to device worked for me as well.

minoroffense’s picture

Status: Patch (to be ported) » Closed (fixed)