in tracking down a non-existent database field error, I noticed that the LDAP_Groups and LDAP_Data modules are installed and upgraded by the ldapauth.install file, and since they don't have their own.
BTW: the error seems to be caused by the fact that I'm playing around with the HEAD version, and so the hook_update() didn't automatically fire when I ran update.php, not a big deal, since that can be run manually, but I still think that each module should be able to be installed, uninstalled, and updated individually rather than clumping it all together in the ldapauth.install file.
This patch isn't against CVS since that gets a little weird with files that don't exist yet, but it's against a clean HEAD version. If you cd to your contributed modules directory and apply it with patch -p0 < path/file.patch it should apply cleanly. If people want, I can also upload the two new .install files.
Basically, I just moved the code specific to the two modules out of ldapauth.install, and into their own .install files, then created a hook_uninstall() for each. The uninstall removes the columns individually since I was running into errors removing all of the ldap_groups_ or ldapdata_ columns in the same query.
Any thoughts? suggestions?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | ldap_integration_seperate-installs_1.patch | 10.38 KB | ashtonium |
| ldap_integration_seperate-installs_0.patch | 8.02 KB | ashtonium |
Comments
Comment #1
ashtonium commentedCan I get a comment on this proposal?
LDAP Integration is a pack of separate modules. The .conf.php files and settings pages have been separated, so it seems to make much more sense to have separate install, upgrade and uninstall abilities for each one as well. (Take a look at CCK for an example, it is a similar package of dependent yet separate modules and they each have their own .install files)
Clumping it all together into one .install file just seems like it's going to cause problems down the road.
The patch above longer applies cleanly against head, but I can re-patch if this is something that we want to work towards. If this is something others think is important, please reply and I'll re-roll the patch and/or upload a .tar of the new .install files.
Comment #2
kreaper commentedashtonium
Sorry for the late response. I took a long break from drupal and just getting back into it. Scafmac was busy with the 5.1.2 codebase.
In principle, I completely agree with your proposal. They are three different modules and should be treated as such. That is one of those minor things that we never had the time to take care of.
Are you able to provide patch files that have been tested ? I can review them and commit them.
kreaper
Comment #3
ashtonium commentedNo problem, I know how it is. Thanks for responding. I should have some time over the next couple of days to re-roll the patch and test it out.
Comment #4
kreaper commentedI tried your patch but I am getting errors
if you can attach the three install files, that'll be better.
Comment #5
ashtonium commentedyeah, that patch was made against an older version of HEAD.
I've attached a new version, rolled against the latest version of HEAD. I've tested upgrading, installing, uninstalling, etc. but let me know if you encounter any problems.
I've removed the innards from ldapauth_update_1() in ldapauth.install since that is now part of ldapdata.install but left ldapauth_update_2() as it was.
I also noticed that some of the install lines no longer have the
NOT NULL default ''distinction as they did in previous versions, I left these as they were since I'm not sure if they should be that way or not:Comment #6
ashtonium commentedI can attach the .install files themselves if needed.
Comment #7
kreaper commentedThank you.
Patch committed to HEAD.
Comment #8
kreaper commented