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.
The cache table schema changed in Drupal 7, but the cache_browscap table was not updated to reflect this change. This does not result in any obvious errors, but if you use the schema module or do other database schema comparisons, the difference shows up.
The attached patch corrects the problem.
Comment | File | Size | Author |
---|---|---|---|
#8 | browscap-cache_table_update-2225743-8.patch | 855 bytes | AohRveTPV |
#7 | browscap-cache_table_update-2225743-7.patch | 857 bytes | AohRveTPV |
#5 | browscap-cache_table_update-2225743-5.patch | 1.03 KB | AohRveTPV |
#4 | browscap-cache_table_update-2225743-4.patch | 1.01 KB | AohRveTPV |
#1 | browscap-cache_table_update-2225743-1.patch | 507 bytes | AohRveTPV |
Comments
Comment #1
AohRveTPV CreditAttribution: AohRveTPV commentedHello, I think this patch is a little simpler. Rather than get the new
cache_browscap
schema in a different way thanbrowscap_schema()
, we can re-usebrowscap_schema()
.Also I capitalized Browscap in the function comment for consistency with another comment in the .install.
Comment #2
AohRveTPV CreditAttribution: AohRveTPV commentedComment #3
gregglesFrom Updating tables: hook_update_N() functions:
;)
Comment #4
AohRveTPV CreditAttribution: AohRveTPV commentedMakes sense. The original patch seems to be a fine way to do this, then. However,
browscap_schema()
is currently defining the cache table usingdrupal_get_schema_unprocessed()
, which also causes the problem referenced in #3. This patch also changesbrowscap_schema()
to define the cache table in the same way as the original patch, without duplicating code.Comment #5
AohRveTPV CreditAttribution: AohRveTPV commentedChanged function name
_browscap_cache_7201()
to_browscap_schema_cache_7201()
for consistency withsystem_schema_cache_7052()
.Comment #6
AohRveTPV CreditAttribution: AohRveTPV commentedOn second thought, it would probably be clearer to just duplicate code between
hook_schema()
andhook_update_N()
. Will prepare an alternative patch.Comment #7
AohRveTPV CreditAttribution: AohRveTPV commentedThis is Kevin Rogers' patch with an additional change:
browscap_install()
is changed to also usesystem_schema_cache_7054()
for consistency and to avoid the problem mentioned in #3. Specifically, the problem is thatbrowscap_install()
currently usesdrupal_get_schema_unprocessed('system', 'cache')
. If the system cache schema changes, Browscap users will have different cache schemas depending on when they installed the module, which is probably a situation best avoided.Comment #8
AohRveTPV CreditAttribution: AohRveTPV commentedRemoved accidental blank line versus #7.
Comment #9
AstonVictor CreditAttribution: AstonVictor at DevBranch commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks