As part of some debugging I was doing I cleared by browscap table, reset the version number and then downloaded the data to get a fresh clean copy. After doing this I noticed that the iPad was no longer being identified with browser = iPad but instead was being given the generic Mobile Safari. There was no device specific data available anymore.
When I went to the source site I downloaded the php_browscap.ini file and saw that the contents no longer include this device information. This is now included in the full_php_browscap.ini file instead.
I have included a patch that updates this module to use the full file. I think having more data available is not a bad thing and restores the functionality that we used to have with previous versions of the data.
Comment | File | Size | Author |
---|---|---|---|
#18 | browscap-configurable_urls-1788720-18.patch | 4.29 KB | ron_s |
full_browscap_ini.patch | 887 bytes | akoepke |
Comments
Comment #1
mondrake+1 - works for me, but would let more reviews before RTBC
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commentedIt looks like the Full browscap.ini file might be overkill for most projects and could cause performance problems until #484346: Improve performance of useragent lookup is fixed.
I think the best way forward would be to provide an administration interface which gives site administrators the ability to select which Browscap database is used for useragent detection information.
Comment #3
mondrakeHi,
a patch for this. It implements:
Comment #4
tedbow#3 works good for me.
Comment #5
mondrakeTitle change to make this issue more clear.
Comment #6
Ignigena CreditAttribution: Ignigena commentedRedacted.
Comment #7
AlfTheCat CreditAttribution: AlfTheCat commentedWorks brilliantly,
Note the domain change of browscap project (see: http://tempdownloads.browserscap.com/moved.php?BrowsCapINI), the URL's now should read:
http://browscap.org/version-number
http://browscap.org/stream?q=Lite_PHP_BrowsCapINI
(I'm using the lite version but you can alter this url for other versions, see: http://browscap.org/)
Thanks!
Comment #8
AohRveTPV CreditAttribution: AohRveTPV commentedURLs out of date
Comment #9
AohRveTPV CreditAttribution: AohRveTPV commentedThis change would let a user with the
administer browscap
permission cause the site to request an arbitrary URL, which is dangerous. As such,'restrict access' => TRUE
should be added tobrowscap_permission()
.Comment #10
AohRveTPV CreditAttribution: AohRveTPV commentedPatch in #3 looks mostly good, but seems confusing in two regards:
1. The distinction between "refresh Browscap data" and "force reload" seems like it could be unclear to an administrator.
2. Changing URLs could cause a situation where it is unknown from which URL the data was downloaded. For instance, I download
...PHP_BrowsCapINI
version 1234 and switch the data URL to...Full_PHP_BrowsCapINI
. The version still says 1234, but for which URL is that?Here is an updated patch which I think is simpler. When a URL is changed it just deletes the existing Browscap data and resets the version to 0 (i.e., "Never fetched"). This removes the need for a new button, and prevents any confusion over which URL the downloaded data comes from.
Other changes in this patch:
1. Update default URLs.
2. Rename variables from
browscap_current_version_url
andbrowscap_current_data_url
tobrowscap_version_url
andbrowscap_data_url
. I think the word "current" is unneeded here, and the URLs also do not have to point to current Browscap data anyway.3. Incorporate suggested change from #9.
4. Remove "from main repository" from URL field descriptions. These URLs do not necessarily have to point to the main http://browscap.org repository.
Comment #11
AohRveTPV CreditAttribution: AohRveTPV commentedPatch no longer applies.
Comment #12
AohRveTPV CreditAttribution: AohRveTPV commentedComment #13
Ted51 CreditAttribution: Ted51 commentedI have Browscap-7.x-2.2 and adaptivetheme-7.x-3.2 installed on my project. All was working fine until now. Since the last automatic update by drupal cron of Browscap useragent information to the last version (5037), the module cannot not detect Mobile browsers. On mobiles, I get the same blocks as the desktops.
Deinstall and reinstall Browscap to dowwload a clean data don't solve this issue. An alternative for me can be to download another version of Browscap data using the administration interface of Browscap, but it seems like #10 and #12 cannot be applied on the current 7.x-2.x-dev version of Browscap using patch command. I hope it is the good thread for these two issues.
Comment #14
AohRveTPV CreditAttribution: AohRveTPV commentedThis updated patch should apply.
Comment #15
AohRveTPV CreditAttribution: AohRveTPV commentedComment #16
HongPong CreditAttribution: HongPong commentedBrowscap 6.x has an old URL that's not working. It should probably be updated to a URL at browscap.org .
Comment #17
AohRveTPV CreditAttribution: AohRveTPV commentedHongPong, you are right but that is a different issue, #2171549: Can't dowload last Browscap.ini RC from http://browscap.org/. It is already fixed in 6.x-2.x-dev. A new 6.x-2.x release is needed. I created an issue for this: #2423209: Make AohRveTPV the maintainer for 6.x branch (so he can make new releases, change status, etc.).
This issue is to add the ability for administrators to configure download URLs themselves.
Comment #18
ron_s CreditAttribution: ron_s commentedThe patch in #14 no longer works with the most recent version of 7.x-2.x-dev. A new version is attached for review.