Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal: "Notice: Undefined index: ismobiledevice in at_get_browser() (line 217 of C:\***\adaptivetheme\at_core\inc\get.inc). "
browscap_get_browser() doesnt't provide this array property.
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedThe fact is this gets reported often for modules and themes that use browscap_get_browser() and none of us know why, it seems to strike some installations but for the most part not.
All I can suggest is tell us what browser/s etc you get this with (how to reproduce) and we add it to the collective knowledge of this problem.
Comment #2
Dzintars CreditAttribution: Dzintars commentedNotice: Undefined index: ismobiledevice in at_get_browser() (line 217 of
/sites/all/themes/adaptivetheme/at_core/inc/get.inc).
Notice: Undefined index: ismobiledevice in at_get_browser() (line 217 of
/all/themes/adaptivetheme/at_core/inc/get.inc).
Notice: Undefined index: ismobiledevice in at_get_browser() (line 217 of
/all/themes/adaptivetheme/at_core/inc/get.inc).
Notice: Undefined index: ismobiledevice in browscap_block_block_list_alter() (line 78 of /sites/all/modules/browscap_block/browscap_block.module).
Notice: Undefined index: ismobiledevice in at_get_browser() (line 217 of
/sites/all/themes/adaptivetheme/at_core/inc/get.inc).
Notice: Undefined index: ismobiledevice in at_get_browser() (line 217 of
/sites/all/themes/adaptivetheme/at_core/inc/get.inc).
This is Notice of my site
Comment #3
overbid CreditAttribution: overbid commentedI use Colora and got this error but just enable Adeptivetheme this bug is gone away
Comment #4
deweweb CreditAttribution: deweweb commentedhave the same problem with AT theme and At panels everywhere. any suggestions?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedI didn't get it until I uninstalled, then reinstalled browscap. Thought I checked all of the same settings, but Mozilla Firefox now has this same error. Is it possibly a setting that I overlooked?
Comment #6
Jeff Burnz CreditAttribution: Jeff Burnz commentedComment #7
ashtronaut CreditAttribution: ashtronaut commentedI had this same problem. I believe this issue is caused because The Browser Capabilities Project Is Closed!
The fix is here (This made my errors go away)
Comment #8
Cyclodex CreditAttribution: Cyclodex commentedFor me it was an issue in browscap, the URL seems to be wrong, changing the url fixed for me this issue.
My DB table "browscap" had about 66 entries, which is wrong. It should be more, so I came across comment 2 in #1852184: Browscap error parsing when trying to fetch browscap data which fixed the list, and therefore my browser now matches again.
But I also think to rely on the
$browser['ismobiledevice']
is a bit unhappy. Probably the module should first check forisset/!empty
and throw an error into watchdog instead.Comment #9
robertgarrigos CreditAttribution: robertgarrigos commentedThis comment fixed the issue: https://drupal.org/comment/8668147#comment-8668147
Comment #10
astutonetHi.
I'm starting a new clean project, using Browscap module and Adaptivetheme and I am also having this same issue.
I did some research for possible solutions and so far none of the suggestions was able to solve the problem of my installation.
Components:
D 7.27, Browscap 7.x-2.1, AdaptiveTheme 7.x-3.x-dev e AT Commerce 7.x-3.x-dev.
Registered Error:
"Notice: Undefined index: ismobiledevice in at_get_browser() (line 228 of C:\wamp\www\mysite\sites\all\themes\adaptivetheme\at_core\inc\get.inc)."
Browsers for testing:
Firefox 28.0, Chrome 34.0, IE 10, Opera 12.16. The same error was logged in use of all the browsers in question.
Changes already processed:
My tests have been performed as described in #7 and #9 (all results of my research suggest changes to the file browscap/import.inc, but the changes were not able to solve the issue).
As can be seen in https://drupal.org/node/2232795, there were changes in the operation of the Browscap module. Occurs that the Adaptivetheme depends of the Browscap module for perfect operation.
Note: This issue only affects new installations.
Any idea?
Tks.
Comment #11
Jeff Burnz CreditAttribution: Jeff Burnz commentedNo it doesn't, you can use Mobile Detect.
Comment #12
astutonetComment #13
astutonetOk, but this don't solve this issue. Any solution, please??!!
Comment #14
Jeff Burnz CreditAttribution: Jeff Burnz commentedI think it is well covered that the issue is with Browscap module, not with this theme, or any other project that attempts to leverage this broken module, when we started using Browscap it worked very well, however since then the module nor the Browscap lib (afaict) has been that well maintained , after considerable time waiting for things to resolve they did not so we now rely on Mobile Detect module.
Mobile Detect does solve the issue, it's why I spent CONSIDERABLE time integrating it and getting this theme to at least have a viable option for doing device detection, with group device detection to boot.
Understand this - not a single user has posted an issue about Mobile Detect since I did this, clearly it works and gets the job done.
Sorry, but reopening this issue with exasperated over punctuation is NOT the way forward - the onus is on you to understand the issue from a technical and implementation standpoint - indeed I and others have explained and discussed this over multiple threads on this site. Others have attempted to post solutions that worked for some, not for others - that is my experience in a nutshell with Browscap - it works for some, not for others, I said that right at the beginning of this issue.
I do not have a magic wand with which to swish over your site and it will somehow miraculously start working. OK?
Comment #15
astutonetOk, to some extent you are right. But...
I think we live in a community, where some things require explanation and the simple fact of retaining information does not help anyone.
For example, the solution proposed in #7 above works effectively, if after applying the patches, you access the page of Browscap module (in admin/config/system/browscap) and click in refresh browscap data.
After that, everything will work perfectly.
This is my tip ;-b
Good luck!
Comment #16
crutch CreditAttribution: crutch commentedBrowscap continues to be a big pain. After making the necessary code updates, it may help to disable and then re-enable the module. That did the trick this time.
What I ended up with browscap@import.inc
Comment #17
manoloka CreditAttribution: manoloka commentedNo improvements with this issue?
I'm getting the same notice;
Notice: Undefined index: ismobiledevice in at_get_browser() (line 228 of /usr/home/mysite/www/sites/all/themes/adaptivetheme/at_core/inc/get.inc).
Comment #18
undersea time CreditAttribution: undersea time commentedThere was only one thing that worked for me after trying almost everything suggested here for the same notice - I manually cleared the cache_browscap table and that seems to have taken care of it. This might be why uninstalling and reinstalling the browscap module fixes it. (I couldn't uninstall the module because of other dependencies.) I hope this helps some people.
Comment #19
WormFood CreditAttribution: WormFood as a volunteer commentedI'm updating the status of this, because I can reproduce this problem, and it has absolutely nothing to do with AdaptiveTheme, and everything to do with browscap.
You can do the following to reproduce this problem:
1. Disable browscap.
2. Uninstall browscap, to clear the browscap database.
3. Enable browscap, but don't update it. Verify the browscap config page says "Current browscap data version: Never fetched." (when I first did this, I couldn't access the browscap config page, even tho it was enabled. I had to disable it, and enable it again, before it'd work right).
4. Observe the warning message is present.
5. Update the browscap database.
6. Observe warning message is no longer present.
Note: When I enabled browscap with Drush, it also downloaded, and updated the browscap database at the same time. When I enabled browscap through the web based interface, it didn't seem to try to download/update the browscap database.
Browscap is a PIG, as of version 7.x-2.2. My problems were caused by not being able to update the browscap database. When first installed, browscap has no database of devices, to determine your browser capabilities. It downloads this database, over the web, and imports it into the Drupal database. That would be great, if it actually worked all the time. The problem is, the process to download and install the browscap database is so slow, and memory intensive, it kept failing for me. I had to increase my ram (in php settings) from 150 megs, to 180 megs, and increase the execution timeout from 30 to 60 seconds, in order to be able to update browscap from the web based interface. Drush worked for me, because it's a CLI app, and gets different PHP settings than the web page does. Cron never seemed to have updated the browscap database. Once browscap is updated, at least once, this problem goes away. That is why this problem affects new installations.
What I have documented above, clearly shows this problem is related to browscap not updating it's database, so anyone else with this problem, can start looking at browscap for a fix.
PS. This page comes up pretty high on Google, when searching for this problem, which is why I've taken the time to clearly document this, so other people with this same problem will have a clear understanding of what exactly the problem really is.