Closed (fixed)
Project:
Web File Manager
Version:
6.x-2.10-rc3
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2008 at 21:26 UTC
Updated:
16 Sep 2009 at 17:15 UTC
After updating to 6.x-2.10-rc3 I can no longer attach files to nodes. When I try I get the message referenced:
“Query Failed: Could not attach files to node 1282”
It doesn't matter what the node number happens to be.
Also I note that when running htpp://www.example.com/update.php if I expand the "select versions" box and look, there is NO webfm drop down available.
Runing Drupal 6.6.
Comments
Comment #1
tcblack commentedI'm finding this in my logs when I try an attachment with webfm. I'm fairly certain it's related to not having an update available to update.php
Comment #2
robmilne commentedI made it clear in the release note that a db update was required. The following is in webfm.install...
Simply go to http://your/drupal/site/update.php. Please close this issue if this resolves the problem.
Comment #3
gandhiano commentedI also have problems with uploading files, even after manually selecting version 1 in update.php.
This happened after a migration from drupal 5.x (can't remember the webfm module version).
The error I get whenever I update a file is:
user warning: Unknown column 'perm' in 'field list' query: INSERT INTO webfm_file (fpath, uid, fsize, fcreatedate, perm, fmime) VALUES ('path/to/webfmfiles/file.pdf', 1663, 100408, 1231352103, 0, 'application/pdf') in /etc/drupal/6/sites/all/modules/webfm/webfm.module on line 2663.
And I get the following error after running the update:
user warning: Duplicate column name 'cid' query: ALTER TABLE webfm_attach ADD `cid` INT NOT NULL DEFAULT '0' in /usr/share/drupal6/includes/database.mysql-common.inc on line 298.
The following queries were executed
webfm module
Update #1
Failed: ALTER TABLE {webfm_attach} ADD `cid` INT NOT NULL DEFAULT '0'
ALTER TABLE {webfm_attach} DROP PRIMARY KEY
ALTER TABLE {webfm_attach} ADD PRIMARY KEY (nid, cid, fid)
Comment #4
robmilne commentedYikes! If the perm column is unknown it means you were using a pre 5.x-2.3 version of the module which predates file permissions (released Jan3 08). You cannot migrate a pre 5.x-2.7 version of webfm to a 6.x version without first upgrading to a post 5.x-2.7 version of the module. I'm sorry that this proviso was never clearly stated anywhere but this is the first instance of this issue I've seen. My advice (assuming you have a backup of the db) is to upgrade your pre 5.x-2.7 version of the module to a later 5.x version and then migrate the db to 6.x.
I will make a note of this on the project page.
Comment #5
dinis commentedHmm, I get exactly the same issue as gandhiano but after upgrading from 5.x-2.15 (though this itself has been through a number of updates.
I'm about to try a fresh install and see how that turns out.
Comment #6
Andrzej7 commentedI have updated it manually and it helped.
Thanks for the tip.
Comment #7
tcblack commentedUnfortunately Webfm doesn't even show up on the udpate.php page. And I have steadfastly upgraded every single version number in order. Somewhere along the line between rc2 and rc4 it quit working.
And yes I did do rc3 but had to downgrade because it started dropping attachments.
Ah, the light just came on. Downgrading from rc3 to rc2 and then jumping to rc4 must have caused the problem.
Mea Culpa.
The good news is that after adding the cid to the webfm_update table (int, not null, default=0, as primary key) It appears to be working great.
Thanks for the pointer to the cure!
Comment #8
tcblack commentedComment #9
tcblack commentedClosed per Comment 2
Comment #10
strellman commentedOops. I also upgraded from d5 to d6 and forgot to update webfm as far as possible on d5 first. Thank you for pointing me to webfm.install. I was able to find these updates to the database and do them manually with phpmyadmin after the fact. (Well it sure beats uninstalling and recreating all of our webfm data.)
ALTER TABLE webfm_file ADD perm tinyint NOT NULL DEFAULT 0
ALTER TABLE webfm_file ADD dl_cnt int NOT NULL DEFAULT 0
ALTER TABLE webfm_attach DROP list
ALTER TABLE webfm_file DROP fname