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

Comments

nancydru’s picture

Assigned: Unassigned » nancydru

Actually, 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?

jonathan1055’s picture

Version: master » 6.x-1.5

I 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

nancydru’s picture

No 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.

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm, I just started to do this and need to think a bit more about it. What happens on a D5->D6 upgrade?

jonathan1055’s picture

Sorry 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.

nancydru’s picture

That'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.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed

This 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.

nancydru’s picture

Status: Fixed » Closed (fixed)

Included in 6.x-2.0-beta2.