Problem/Motivation

Projects that contain multiple modules are listed on the updates page only once, and show the version of the parent module, regardless of the versions of the child modules. This means a user could have outdated versions of the sub-modules on their site without realising.

Steps to reproduce

  1. Install a contributed project with multiple modules
  2. Download an older version of the project
  3. Replace one of the sub-modules with the older version
  4. Check the updates page and confirm it displays the version of the parent module only
  5. In this example, the site is running Metatag 8.x-1.14, and Metatag: Dublin Core 8.x-1.12. The updates page shows:

Proposed resolution

If there is a mismatch between modules in a project, show a warning message on the updates page that links to the status report page with more information on the issue, e.g.:

And on the status report page, include a warning:

(These messages are just first suggestions, I have not put too much thought into the actual text)

Remaining tasks

  1. Agree on approach
  2. Write patch with tests
  3. Review

User interface changes

On the status report page,

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Original report by [username]

Over at http://drupal.org/node/165778 we debugged a support problem where update_status appeared to be displaying the wrong version for the site's currently installed cck. The problem was that old versions of cck included date.module directly inside the cck directory, but that's since been moved into a separate project. When the user upgraded to the later version of CCK, the old date.info file was left in their directory with the stale version, and that confused update_status.

It'd be nice if inside update_status_get_projects(), when we've found another module for an existing project we know about, we should compare the version field in the .info file to the one we're using as the canonical one for the project. If they disagree, we should record that fact some how, and display it on the available updates report. A trivial approach would be to just append the mismatched version string to the module name we store, so you'd see something like this:

Includes: content, date (5.x-1.0-beta), nodereference, number, text, ...

Comments

nancydru’s picture

Perhaps my feature request to show the directory would play into this?

David_Rothstein’s picture

Note that it is not just version strings that have this problem, but also datestamps (see http://drupal.org/node/227644).

David_Rothstein’s picture

Project: Update Status » Drupal core
Version: 5.x-2.x-dev » 6.x-dev
Component: User interface » update.module
Category: feature » bug

Actually, I just checked that this occurs in Drupal 6 core too, and it does.

Feel free to change back if you disagree, but I think this qualifies as a bug. If I am running (for some stupid reason) a "mixed" version of Drupal, with some modules up to date and some modules out of date and potentially insecure, Update Status should not tell me that everything is OK -- it should tell me that there's a problem. What happens now is that it picks one module from the project at random (I think it uses the one that comes first alphabetically) and uses that module to assign the overall project version number. It really should check all of them to be safe.

So am I correct that the following is the desired behavior?

  • Check all modules in the project and use the earliest version string it finds as the project's version string (same thing for the datestamp, just in case).
  • If all modules don't have the same version, display that on the available updates report, as above.
dww’s picture

Yeah, I guess we could call this a bug. ;) However, I'm not going to roll a patch for D6 core until I get some more support on the idea that this is a bug and the fix will be committed to DRUPAL-6 when it's ready. Should be relatively easy, and it should even be possible to fix this without breaking the string freeze.

David_Rothstein’s picture

Version: 6.x-dev » 7.x-dev
Status: Active » Needs review
StatusFileSize
new4.85 KB

Hm, I had intended to write a patch for this weeks ago.. but better late than never ;)

The attached patch is for 7.x and does two things:

1. Assigns the overall project information based on the oldest module it finds, to maximize the chances of catching out-of-date code. (And if several modules have the same datestamp, it attempts to choose between them by picking the one with the "earliest" version string.)

2. If there is any version mismatch, all the version strings get printed out on the update report.

In the vast majority of cases, the version mismatch will also generate an error on the update report, since the older module will be out of date. In a few edge cases, though, I think you could still get the "up to date" checkmark telling you the project is OK (for example, if your project contains modules from two separate supported versions of the project, e.g., 6.x-1.0 and 6.x-2.0). I'm not sure it's really worth the effort required to deal with that, though.

As for eventually porting this to 6.x, I think the first part of the patch is undeniably a bug fix that should be backported.... right? But the second part (printing the version strings to the screen) is less so.

dww’s picture

Status: Needs review » Needs work

Cool, thanks. I'll have to take a much closer look at this than I have time for right now. In particular, it's important that these changes happen in a way that will allow CVS deploy to keep working, which I haven't yet verified.

One minor thing I noticed from a very quick skim of the patch: _update_unknown_version_string() should probably be theme_update_unknown_version().

It'd also be nice to do this in a way that doesn't break any t() strings, but I'm not sure that's possible with your attempted strong tags. Perhaps we don't need strong. Perhaps just the presence of a version string in that list will be enough to grab people's attention?

David_Rothstein’s picture

Status: Needs work » Needs review
StatusFileSize
new5.43 KB

Here is a new patch using theme_update_unknown_version()... definitely a good idea, thanks.

About breaking t() strings, I figured that since this patch is for 7.x, we don't need to worry about that (??). If this gets backported to 6.x, then I agree, we should definitely get rid of the <strong> tags (but I'm not sure that part of the patch will get backported anyway?). The <strong> tags certainly aren't crucial either way, but it's a little bit nice to have it highlight for you which of your modules is the one causing the version mismatch, I think.

For CVS Deploy, I reviewed the code a bit, and I think this patch won't have any effect on checkouts of official project releases. For dev versions, it looks like the changes it makes to the datestamp calculation will make the bug at http://drupal.org/node/227644 appear more often than it currently does. (My hope was to fix that bug after this one anyway, though.) I think this might be inevitable, though... for a CVS checkout, a project's datestamp really should be set to the newest one it finds in all the sub-modules, but here, we want the exact opposite behavior. So I think CVS Deploy would just need to be patched to override what is happening here and do its own calculation of the overall project datestamp.

gábor hojtsy’s picture

The change with %includes to !includes should not be that big of a problem, there were such small changes before. As long as the usability / correctness of the information is worth it (and it looks like it does), such small changes are workable IMHO.

dries’s picture

I agree that this would be nice to have. I haven't tested the patch yet, so it is not clear how well the information is presented.

dww’s picture

Excellent. If both core committers are ok with a minor string breakage for this, I can resume work here. I've basically just been on hold with this pending a decision that it was worth the time. I'll try to get to this (and some other, related update.module patches) in the near future so we can fix these up in core. Yay. ;)

David_Rothstein’s picture

StatusFileSize
new20.45 KB

Here is a screenshot showing what this patch currently does. If we did it without breaking strings, the screenshot would look exactly the same, but the offending module(s) -- in this case the comment module -- would not have their version strings in bold.

Note that the versions only get printed for sites which have a mismatch, but the string breakage would happen for everyone, so that might be something to keep in mind for Drupal 6.

dries’s picture

Thanks for the screenshot, David. That is really helpful.

I think it looks good, but I'm not sure it is 100% intuitive. That said, it is better than nothing, and I'm not sure how else to present this information.

gábor hojtsy’s picture

I think it is good with the bolding even if that brakes this short string, as it is important to show there. We broke such short strings before.

David_Rothstein’s picture

Dries, I agree it isn't quite perfect yet. Here are a couple things I can think of that might make it more intuitive (any of these would be very simple to implement):

  • Add more text at the beginning, something like:
    This project includes modules with conflicting versions: Block (6.2), Color (6.2), Comment (6.1).....
    This would involve adding a new string rather than breaking an existing one.
  • Print the project name along with the version:
    Includes: Block (Drupal 6.2), Color (Drupal 6.2), Comment (Drupal 6.1).....
  • Make the whole module name bold, as in @dww's original post:
    Includes: Block (6.2), Color (6.2), Comment (6.1).....

Or possibly some combination of the above...

dww’s picture

I'd prefer a combo of the extra intro text and the whole module + version in bold.

gábor hojtsy’s picture

Fine with me.

David_Rothstein’s picture

StatusFileSize
new5.74 KB

Done.

David_Rothstein’s picture

Status: Needs review » Needs work

Oops, there's a (minor) problem with this patch. I realized that theme_update_unknown_version() is not particularly "themeable", since its output gets run through check_plain() somewhere inside theme_update_report().

Maybe the simplest solution is just to not have it be a themeable function; we could change it back to update_unknown_version_name() or something like that...

David_Rothstein’s picture

Status: Needs work » Needs review
StatusFileSize
new5.12 KB

New version attached; this makes the function non-themeable again and also fixes a minor code style issue that was lurking in there.

Otherwise this is the same as the previous patch.

dries’s picture

Status: Needs review » Needs work

Two more comments:

* While I think this is an improvement, I wonder why we don't put the conflicting modules in red? To me, that looks more conflicting than bold. (This is not a requirement for the patch to get committed.)

* Many users will scratch their head and try to figure out how to resolve the conflict. Usability 101 tells you to explain your users how to fix this.

Can we massage this a little bit more?

dww’s picture

This patch doesn't apply at all anymore, now that #162788: Include modules that aren't enabled landed. In fact, that opens up a new UI can of worms here. What should we do about version mismatches in light of disabled vs. enabled modules? Looks like we need some UI review here before it's worth rerolling this.

dave reid’s picture

Talked with dww on this and discussed how I felt this should be more centered towards a status report warning if there are version mismatches found since we put important potential-site-breaking things there. However, this is also relevant to the update status page since it affects if and which version is available to upgrade to.

johnalbin’s picture

Subscribing since this happens in sub-themes often.

dww’s picture

@JohnAlbin: I'm not even sure what this means if you have version mismatch with subthemes. You mean subthemes vs. base themes? That's the whole point of subthemes, right, that you *can* have a mismatch? Or do you mean the problem of version mismatch across multiple subthemes in the same project is common for some reason (and if so, why?)? Please elaborate. ;) Thanks!

Bojhan’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: -Needs usability review

Don't really get what this patch does.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Resurrecting this one after discussion with @dww in Slack. FWIW I don't think this is a bug, rather a task to handle an edge case. Updated the issue based on my testing with a suggested approach to address this.

I won't update the issue category but if anyone else agrees, please do.

quietone’s picture

I just asked for some feedback on the direction to take here from #ux.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Category: Bug report » Task
Priority: Normal » Minor

@ainsofs, @pameeela, @quietone, @Seth Hilder and I discussed this at Drupal South

Whilst we agreed that this can put your site into a bad state, based on lack of activity and changes to how people update modules now (much higher composer use) as well as the level of effort that would be required to fix this edge case that this would be at best on minor, so we decided to change the priority.

However we also felt that the 'bug' here is not on behalf of Drupal but rather on that of the user, or documentation on how to update your site properly.

So as a result we felt this was better classified as a task.

However if you disagree @dww feel free to move it back in your capacity as update module maintainer

larowlan’s picture

Issue tags: +DrupalSouth

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.