7.x-1.4 ver of Mobile Switch
After install I get
Notice: Undefined index: ismobiledevice in mobile_switch_boot() (line 80 of /home/site/public_html/sites/all/modules/mobile_switch-7.x-1.4/mobile_switch/mobile_switch.module).
Notice: Undefined index: ismobiledevice in mobile_switch_boot() (line 80 of /home/site/public_html/sites/all/modules/mobile_switch-7.x-1.4/mobile_switch/mobile_switch.module).
Notice: Undefined index: ismobiledevice in mobile_switch_boot() (line 91 of /home/site/public_html/sites/all/modules/mobile_switch-7.x-1.4/mobile_switch/mobile_switch.module).
Tried looking into this but I hit a roadblock while tracking 'ismobiledevice'
Can't see where this is set
In Browscap 7.1.3 I can no reference to this and yet in mobile_switch module it states
"The default value is FALSE. If the
browscap value 'ismobiledevice' are 1
the value is TRUE."
Where is 'ismobiledevice' set?
Comments
Comment #1
thedosmann commentedComment #2
thedosmann commentedOK, so 'ismobiledevice' is a product of php get_browser function and is a part of the array returned from the function. The browsercap module for Drupal attempts circumvent some issues with this and one of those circumvents is to replace the php browscap.ini with a database table. The problem is the drupal module for this points to .http(s)://browsers.garykeith.com/versions/version-number.asp. for the initial import and update of this info. That url now states "The Browser Capabilities Project is closed."
I understand this is EOL but may be taken up by another kind soul. I can imagine keeping the data up to date is quite a task as well as the integration itself so Kudos to GaryK for his hard work.
Meanwhile the modules that depend on this module as required are dead also and requiring a module that is , for now, EOL and not working is a major bug. So please update your install instructions and requirements. I'm updating priority to fit this issue.
Comment #3
DSN commentedsame Here.
Please help me asap.
Notice: Undefined index: ismobiledevice in mobile_switch_boot() (line 80 of C:\wamp\www\public_html\sites\all\modules\mobile_switch\mobile_switch.module).
Notice: Undefined index: ismobiledevice in mobile_switch_boot() (line 80 of C:\wamp\www\public_html\sites\all\modules\mobile_switch\mobile_switch.module).
Notice: Undefined index: ismobiledevice in mobile_switch_boot() (line 91 of C:\wamp\www\public_html\sites\all\modules\mobile_switch\mobile_switch.module).
Comment #4
thedosmann commentedThe project has been assumed by another kind soul; so for now the issue can be fixed by replacing the urls in import.inc in the browscap module. I understand this is a browscap module issue but as it affects this module I thought I would post the info:
In import.inc in the browscap folder change the $current_version url to :
http://tempdownloads.browserscap.com/versions/version-number.php
(both https and http, as no https is offered right now, need changed)
In import.inc in the browscap folder change the $browscap_data url to :
http://tempdownloads.browserscap.com/stream.php?BrowsCapINI
(both https and http, as no https is offered right now, need changed)
More info can be found at http://drupal.org/project/browscap
I assume this module 'mobile switch' will update install instructions at some point but I'll leave this issue open.
Comment #5
carsonwNote that after you perform what's outlined in #4, you will need to navigate to "admin/config/system/browscap" and click ""Refresh browscap data"
Comment #6
mmontado commentedAfter I change import.inc to download from http://tempdownloads.browserscap.com/stream.php?BrowsCapINI as says thedosmann, I get a parsing error (warning: error parsing _browscap_import()).
I solved the issue coping the table browscap from another site and downgrading to version 7.x 1.3 of the module.
In the meantime, I disabled the automatic update at the browscap settings, waiting the relaunch of the Browser Capabilities Project (https://groups.google.com/forum/#!topic/browscap/pk_dkkqdXzg)
Comment #7
kingfisher64 commentedCould someone clarify #4 a bit more to stop:
Notice: Undefined index: ismobiledevice in at_get_browser() (line 217 of sites\all\themes\adaptivetheme\at_core\inc\get.inc).Where do I apply "5015" to of sites/all/modules/browscap/import.inc - and what am I doing with tempdownloads.browserscap.com/stream.php?BrowsCapINI file?
My apologies for a lack of knowledge, but I don't know how to fix this error with the current set of instructions. If it's possible could someone upload patched/fixed versions of files.
Many thanks your time is appreciated
Comment #8
quiptime commentedQuick fix in AT Core theme
File get.inc
Change code from
to
Comment #9
kingfisher64 commented#8 - brilliant, thanks quiptime that worked lovely.
Comment #10
crutch commentedThis removed the error for #7
Additionally, getting a database timeout when clicking refresh BC data.
Comment out https requests at both locations in import.inc, because it is not needed, resolves timeout issue.
However this remains, "current browscap data version: Never fetched."
Comment #11
Anonymous (not verified) commentedHi !
I had to modify mobile_switch.module in order to make it run :
I check the existence of the browscap_get_browser function because I kept having the following message in error.log (error 500) :
PHP Fatal error: Call to undefined function browscap_get_browser() in /var/www/mysite/sites/all/modules/mobile_switch/mobile_switch.module on line 216As I’m not sure if what I did is right or wrong, I didn’t make a patch.
Comment #12
quiptime commented@zigazou,
the "PHP Fatal error: Call to undefined function browscap_get_browser()" error:
Please take a look at this issue
http://drupal.org/node/1848416#comment-6775550
Comment #13
quiptime commented@zigazou,
the upcomming MSw branch 1 releases will use module load before call the function browscap_get_browser().
The reason:
Browscap branch 2+ will no longer be a "bootstrap" module.
Thanks for your assictance.
Comment #14
quiptime commentedFixed in 7.x-1.5.
Comment #16
purabdk commentedYou need to use the following code: this will solve the issue.
Comment #17
david137 commentedWhat path/file is this fix for?
Comment #18
Jooblay.net commentedwow ok thanks #11 and #16 power to the drop!)
browscap started fetching after the following mod...
sites/all/modules/mobile_switch/mobile_switch.module just below 224 so 225:)
224 $browser = browscap_get_browser(NULL, TRUE);
225//****************************************mod**********************************************
226 // Mobile switch apparently expects ismobiledevice to be either '1' or '0'
227 // but browscap returns 'true' or 'false' (not the boolean values but strings !)
228 if($browser['ismobiledevice'] == 'true') {
229 $browser['ismobiledevice'] = '1';
230 } else if($browser['ismobiledevice'] == 'false') {
231 $browser['ismobiledevice'] = '0';
232 }
233//***************************************************end mod********************************
Remember to note this mod for further discussion in a mod.txt file @ sites/all so that you can keep track of mods you have done in the middle of the night....:)
thanks for everyone in the drupal community i cannot tell you how much thanks and tons of respect is due:)
Ok more on this... at this time we can not seem to get this little patch to update the browscap "Current browscap data version: Never fetched." It worked well on our dev ubuntu server running 12.04 lts LAMP but not on the production CentOS...