When working locally with a collection of modules that are all checked out via git, none of the modules will contain a version number as that string is added to the info file via the project release system. However, when many modules have started requiring specific releases of other modules it ends up causing a scenario whereby certain modules cannot be enabled.
To resolve this I propose that the ctools.info file always be updated to note the last release. This will resolve the problem for local development using git checkouts, and, because the packaging system always adds its own lines to the info file which will then be used by Drupal in preference to the manually added line; there are no expected problems or regressions from this as Drupal will always use the last "version" line from the info.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | ctools-n2400915-9.patch | 6 KB | damienmckenna |
Comments
Comment #1
damienmckennaThis adds a line to the info file setting the version to 7.x-1.6-beta1.
Comment #2
damienmckennaComment #3
kepford commentedLooks good. Patch applies.
Comment #4
mrjmd commentedComment #5
japerryThere is a bit more I'd wanna do with this issue: In particular, the following format I think would be good for dependencies:
Here is a patch.
Comment #6
damienmckennaShouldn't that be?
Comment #7
damienmckennaAlso, these should be finished sentences with periods at the end:
Comment #8
japerryUpdated
Comment #9
damienmckennaI updated the comment in ctools.module, and added an example dependency line to it.
Comment #11
mrjmd commentedComment #13
OnkelTem commentedSorry for I make it Active again, but I'm not sure that the goal was actually reached (if I got the idea correctly).
When I run
updatedbfrom the command line usingdrushI get this warning:— i.e Ctools version number is not resolved, and database contains not resolved version number:
a:10:{s:4:"name";s:11:"Chaos tools";s:11:"description";s:46:"A library of helpful tools by Merlin of Chaos.";s:4:"core";s:3:"7.x";s:7:"package";s:16:"Chaos tool suite";s:7:"version";s:21:"CTOOLS_MODULE_VERSION";s:5:"files";a:5:{i:0;s:20:"includes/context.inc";i:1;s:22:"includes/css-cache.inc";i:2;s:22:"includes/math-expr.inc";i:3;s:21:"includes/stylizer.inc";i:4;s:20:"tests/css_cache.test";}s:5:"mtime";i:1426006585;s:12:"dependencies";a:0:{}s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}or unserialized:
Ideas?
UPDATE
Ok after some debugging I can say that both
drush updatedbandregistry-rebuild (rr)don't include module files and thusCTOOLS_MODULE_VERSIONconstant is not defined.So.. it was a nice try, but the reality dictates :-(
Comment #14
merlinofchaos commentedSo really nobody should be using a .info dependency on CTools version numbers, because CTools, being very API-centric, has its own internal API versioning that is superior.
Instead, the ctools api version should be checked in hook_requirements, allowing modules to gracefully degrade if CTools API isn't sufficient. This is also important for updates, where .info file dependencies don't necessarily cover the task.
Comment #15
damienmckenna@merlinofchaos: So what if, for example, there's a security issue in another contributed module that only happens with older versions of the module. According to your suggestion it should just use hook_requirements to warn the site maintainer? The docblock for ctools_api_version() suggests something like the following:
But almost every module that extensively uses CTools would become partially disabled and potentially completely break the site.
This is a problem with both core's update.php and Drush.
Comment #16
OnkelTem commentedOk, since it was me who reopened the issue (all of a sudden), I feel responsible now to resolve it back, as all "pros and cons" are pretty obvious now and we can't do anything more actually.
There is no ideal solution for the problem with D7 versioning: all git-fetched websites will suffer more or less. But there are two ways to implement "deferred" resolutions of version numbers:
1) using Git deploy (or this tiny alternative targeted to resolve only important modules);
2) using constant in .info file like it was suggested in this fix,
and both solutions allow for "Enabling" dependent modules in UI, while update process will not be that smooth, as needed hooks and files just not included. Sorry if this sounds hazy :-/