Closed (fixed)
Project:
Web Links
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
29 Apr 2009 at 14:57 UTC
Updated:
8 May 2009 at 17:40 UTC
In weblinks.install the result of running drupal_install_schema() is checked using count($result). I don't know if this is correct for D5 but on D6 this gives a true result even when the table creation fails. See the attached image for a print of the $result array. I think it needs to check the value of $result['0']['success'] which is 1 if OK and blank if there was a database error. So
if (count($result) > 0) {
becomes
if ($result['0']['success']) {
The attached patch will make this change. Also the error message now reminds the user to un-tick the enabled checkbox, as until this is done the module will not appear in the uninstall tab.
Jonathan
| Comment | File | Size | Author |
|---|---|---|---|
| _weblinks.install_result.patch.txt | 597 bytes | jonathan1055 | |
| install result array.jpg | 175.39 KB | jonathan1055 |
Comments
Comment #1
nancydruActually, I stumbled across some other changes that need to be made in the install code, so I will look into this shortly.
BTW, we don't use "HEAD;" which release were you using?
Comment #2
jonathan1055 commentedI am on D6 weblinks 1.4, but the same code is in 1.5 and 2.0beta1. I have not check the 5-x code.
I am never quite sure when to use version=head, but I did it here because the same change needs to be made to both your 6.x streams. Sorry if that was not the right thing :-)
Jonathan
Comment #3
nancydruNo problem. I do understand that HEAD is very confusing - even for us developers. In most cases it is better to indicate which release you found it in and add a statement about other releases that need fixing.
In this situation, I am almost exclusively working on the 2.x branch. I expect to kill the 6.x-1.x branch very soon, so it may not be worth fixing that branch.
Comment #4
nancydruHmm, I just started to do this and need to think a bit more about it. What happens on a D5->D6 upgrade?
Comment #5
jonathan1055 commentedSorry I can't help you there. I have one D5 site but I am not using weblinks on it, and in any case the upgrade to D6 is not planned in the immediate future . I guess I could create a new D5 site, install weblinks then do an upgrade to let let you know, but I am guessing someone else may already have a better knowledge of the upgrade process.
Comment #6
nancydruThat's what I would have to do and I am running out of D5 sites to upgrade. However, there is nothing to know about the process; you do it and see if I got the errors fixed. I upgraded a site a few days ago and there were a bunch of errors flagged. None impacted the functioning of the module, but they don't look good. If you want to try it, I'll create a patch for you. Otherwise it has to wait until I can put up a test site to try it with. BTW, right now, I have only patched the 2.x version.
Comment #7
nancydruThis is fixed in both 6.x -dev releases. Additionally, 6.x-2.x-dev has all the hook_update_N fixes that I saw during my upgrade. I only tested the 2.x branch.
Comment #8
nancydruIncluded in 6.x-2.0-beta2.