So there's an interesting code comment in drupal_system_listing().

The 'profiles' directory contains pristine collections of modules and themes as organized by a distribution. It is pristine in the same way that /modules is pristine for core; users should avoid changing anything there in favor of sites/all or sites/ directories.

In other words, the comments imply that if you want to override a module included in a profile with a newer version, you should put it in sites/all or sites/<config> directories.

However, drupal_system_listing() actually looks for modules in this order: (later searches override earlier searches)

  1. modules
  2. sites/all/modules
  3. profiles/<current-profile>/modules
  4. <current-config>/modules (like sites/default/modules or sites/org.example/modules)

Which means that modules in sites/all/modules cannot override the older, out-of-date versions of themselves in profiles directory.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JohnAlbin’s picture

Status: Active » Needs review
Issue tags: +Quick fix
FileSize
1.07 KB

Simple patch.

Crell’s picture

This could probably be backported to D6, too. Subscribing. :-)

catch’s picture

Status: Needs review » Reviewed & tested by the community

Simple patch, impossible to write a test for. RTBC.

dman’s picture

catch - June 3, 2009 - 10:46
"Simple patch, impossible to write a test for. RTBC."

... we'll put that on your tombstone.
;-)

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Makes sense. Committed to HEAD.

Interestingly, this doesn't apply to D6:

webchicks-macbook-pro:6x webchick$ patch -p0 < sites-all-override-480044-1.patch 
patching file includes/common.inc
Reversed (or previously applied) patch detected!  Assume -R? [n] 

However, I can see with my own two eyes that it's not fixed there, so I guess this needs a re-roll?

JohnAlbin’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.09 KB

New patch for D6.

eabrand’s picture

Just tested. It works!

eabrand’s picture

Status: Needs review » Reviewed & tested by the community
Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Although I was a little bit concerned that existing sites possibly depending on this order might break, after much thinking I figured there would probably be a very limited number of sites and they should not hold us back from having a solid core setup supporting distributions, so they can thrive. Committed to Drupal 6!

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

Automatically closed -- issue fixed for 2 weeks with no activity.