I am currently receiving the following error message on my site:

user warning: Unknown column 'weight' in 'order clause' query: SELECT iid FROM image_attach WHERE nid = 28 ORDER BY weight in /home/mysite/public_html/sites/all/modules/image/contrib/image_attach/image_attach.module on line 438.

Disabling the image_attach module does not seem to prevent this

Comments

joachim’s picture

Have you run update.php since upgrading to a new version?

jamesmcd’s picture

Yes I ran update.php immediately after upgrade

I just removed the module completely and reinstalled and I am still receiving the error

It occurs when I am attaching an image using Filefield and seems to remain at the top of all pages whether I disable the module or not

joachim’s picture

Status: Active » Closed (won't fix)

> It occurs when I am attaching an image using Filefield and seems to remain at the top of all pages whether I disable the module or not

Filefield is nothing to do with this module. If this bug is to do with imagefield, please reassign when you reopen.

jamesmcd’s picture

Status: Closed (won't fix) » Active

The error is occurring here /image/contrib/image_attach/image_attach.module on line 438. which is what lead me to assume it was to do with this module

I am slightly confused as to why it would occur if the module is not even enabled

Are you suggesting this issue is more likely related to Filefield?

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Oops -- my mistake, sorry. I read only the most recent comment and skimread at that, been busy this weekend.

Check your image_attach table. It has no weight column and yet it should.
So either you installed the module in a REALLY weird way, or you installed a version from before the multiple attached images feature, then upgraded to beta 5, then update.php's image_attach_update_6102 didn't run properly. Check update.php for possible updates, then check your system table to see if 6102 has actually run.

jamesmcd’s picture

Status: Postponed (maintainer needs more info) » Fixed

I think I recall an error message on update.php with regards to image_attach_update_6102

I just re ran update.php with 6102 selected on the drop down

The message returned was :

The following queries were executed
image_attach module
Update #6102

    * ALTER TABLE {image_attach} DROP PRIMARY KEY
    * ALTER TABLE {image_attach} ADD PRIMARY KEY (nid, iid)
    * ALTER TABLE {image_attach} ADD `weight` INT NOT NULL DEFAULT 0

Update #6103

    * DELETE FROM {image_attach} WHERE iid = 0

Does this look as it should now?

I just ran through the process I did previously to create the error and all seems well

Many thanks for your help

joachim’s picture

Category: bug » support

Yup, that all looks fine.

Setting to to 'support request' as it seems to have been a mystery glitch rather than a bug in the code.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.