Closed (fixed)
Project:
Drush
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 May 2009 at 21:27 UTC
Updated:
10 Jun 2009 at 01:30 UTC
Jump to comment: Most recent file
Currently, the PM extension for drupal requires Drupal 6.
However, The Code below adds in checking for Drupal 5. Which makes no sense to me. It later calls functions that do not return the right datatype in drupal core (i.e. arrays vs NULL). In this case, the non-compatible function is pm_dependencies().
Please change this code so people still on Drupal 5 can use this wonderful piece of work. It's Great!
function pm_module_manage($modules = array(), $enable = TRUE) {
if (function_exists('module_load_include')) {
module_load_include('inc', 'system', 'system.admin');
}
else {
// Drupal5 only.
require_once('./'. drupal_get_path('module', 'system') .'/system.module');
}
$form = system_modules();
if (empty($modules)) {
pm_module_status($form);
}
else {
$requested_modules = $modules;
if ($enable) {
pm_dependencies($modules, $form);
...
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drush_pm_d5_backport_5_16_09.patch | 1.61 KB | awesomepossum |
Comments
Comment #1
awesomepossum commentedI have Created a patch file for making all of the PM commands backwards compatible with drupal 5. It was a simple patch (maybe too easy?), deleting the core reqs and adding a check for non-array data types. Doing a basic test of this, all seemed fine inlcuding statusmodules, enable and disable. The Patch is attached.
Comment #2
awesomepossum commentedWould someone please reply to this post? I would like to see this patch added if at all possible. If the patch is not sufficient I would like direction on what changes need to be made in order for the enhancements to be made.
Comment #3
owen barton commentedThis looks great thanks!
Comment #4
moshe weitzman commentedOh no, another great nick has fallen. Bye Grugnog2. Owen is has a nice ring tho.
Comment #5
owen barton commentedCommitted - thanks!
Comment #6
moshe weitzman commentedThis broke enable command in D7. In the log below, devel is indeed available:
Comment #7
awesomepossum commentedShould I submit another patch to try to fix this in Drupal 7? Not sure what the proper procedure is here.
Comment #8
owen barton commentedIf it looks like a reasonably easy fix then that would be great - however if the data format has changed a lot in Drupal 7 we should just add back a core => array(5,6) for now (and ideally patch Drupal 7 core so we have a very simple way to enable and disable modules in the future!).
Comment #9
moshe weitzman commentedYes, please attach a new patch here. Alternatively, mark this issue fixed and add a new issue. Both are legitimate.
Comment #10
moshe weitzman commentedI looked into this. The patch is non trivial for D7. I agree with Owen that we should add back array(5,6) as supported versions for various pm commands. I'd love it awesomepossum could actually make it work on 7, but I'll take an immediate quick fix for Drush2.
Comment #11
owen barton commentedGoing to see if I can clean this up a bit
Comment #12
owen barton commentedEnable/disable/statusmodules now all work on Drupal 5, 6 and 7 now, and are quite a bit cleaner (I was able to remove the $form hackery).
Comment #13
moshe weitzman commentedWow, great work Owen. many thanks.