function domain_conf_variable_get() crashes and burns when the cache table has been cleared of the row for cid == 'variables' before variable_get_domain_conf() is ever called. This is a rare situation, but possible.

variable_get_domain_conf() depends on function _domain_conf_load_primary() for variables defined by the variables table. However, it only looks in the cache. If something is not in the cache, it just returns an empty value (not even an empty array). Because it does this, the array_merge() of _domain_conf_load_primary()'s return value and the domain-specific settings from the domain_conf table results in a bug, which means not even values strictly from the domain_conf table will be returned by domain_conf_variable_get().

I've attached a patch that just looks to the variables table if the cache is empty for whatever reason. It's taken against the version tagged DRUPAL-6--2-0-RC8

Finally, I want to suggest, perhaps as a separate issue, that the cache table should probably not be queried directly unless your name is cache_get, cache_set, or cache_clear_all(). The reason for this is that a site might be using caching system altogether that doesn't involve using core Drupal's cache implementation, but just its API's function signatures (e.g., Cache router http://drupal.org/project/cacherouter ).

CommentFileSizeAuthor
domain_conf.module.diff.txt1.45 KBankur

Comments

agentrickard’s picture

I think we already fixed this.

See #469856: Display site slogan in view? and mark this as duplicate if appropriate. (See the patch in #22)

agentrickard’s picture

Status: Needs review » Closed (duplicate)