0

I upgraded a Drupal 6 site to Drupal 7. After upgrading, everything works fine. I had migrated all the content types and content. I am able to view all the content.

When I edit or add a content which contains an image field, I get the following error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_image_alt' in 'field list': INSERT INTO {field_data_field_image} (entity_type, entity_id, revision_id, bundle, delta, language, field_image_fid, field_image_alt, field_image_title, field_image_width, field_image_height)

I came to know that field_image_alt is not found.

my-db-structure-after-upgrade

How can I manually add the field? I had run update.php specified in drupal documentation. But still i found that the field is missing. Anyone pls help me to add those fields.??

4
  • More background is needed to make any sense of this. What exactly are you upgrading? A module? A whole site? What modules are installed? What steps have you taken in the upgrade process? Are you following a document or tutorial that we could look at?
    – beth
    Mar 21, 2014 at 16:50
  • Hi @beth !Thanks for your Suggestion. :-) i had edited my question. Did you need any other information? Please help me..
    – Paulraj
    Mar 21, 2014 at 16:59
  • The migration has converted field_image to a file field, not an image field (you can tell by the column names). I've never done a (non-manual) 6-7 upgrade before so I don't know, but is that an option you were able to choose in the original migration? If so, choose image instead of file, run it again, and you should be fine
    – Clive
    Mar 21, 2014 at 18:06
  • Hi @Clive ! Thanks. Your suggestion had worked for me. My client had used "existing fields" to add image field for some custom content type, and had changed the widget type to "file". So while migrating the fields, the image field is set to default widget (i.e. file), and got migrated. Thus caused the problem.
    – Paulraj
    Apr 22, 2014 at 10:11

1 Answer 1

1

It looks like your image table field_data_field_image is not having the field_image_alt column. Which is strange, since Drupal creates that by default.

Are you sure you ran update.php after migration? Do that first. If so, then try these steps.

I guess the best thing to do would be installing devel module and then with devel reinstall the image module. (Make backups as you might lose data!)

If that doesn't work you could add the column manually, and hope it was only this column that was off. See the following image for the fields you should have.

screenshot

5
  • Thanks for ur response. I had followed the steps stated in Drupal upgrade documentation and had ran update.php after migration. I'll try the steps given.
    – Paulraj
    Mar 21, 2014 at 17:30
  • Hi @neograph734! I'm new to drupal. Can you please help me how to reinstall the image module using devel? Thanks.
    – Paulraj
    Mar 21, 2014 at 17:50
  • it should be at example.com/devel/reinstall Mar 21, 2014 at 18:01
  • Thanks. I found it. But the solution is not working. Still i got the same table structure after reinstall. So, i think the only possible way is to create the field manually. Is this is the right way to create? or is there any other method to create those fields? I'm afraid of hacking the database as i'm new to drupal. Thanks in advance.
    – Paulraj
    Mar 21, 2014 at 18:09
  • Well, usually no because it is not the way to go. And after reading Clive's comment above I don't think you should do this. The problem probably lies within the migration. Adjusting a file type to an image might lead to even bigger problems. Mar 21, 2014 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.