It's about that time again. We should start the upgrade to 6 now so that we can get it out the door quickly once 6 releases. I'm being pushy because there are a number of modules that depend on Image (like Postcard) ;-) and I am more than willing to help out. I'll try to make some first passes at patches in the next week or two if others don't get to it first.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

add1sun’s picture

Status: Active » Needs work
FileSize
7.29 KB

This is just starting off with .info and .install file changes. No .module or .inc changes yet.

drewish’s picture

marked http://drupal.org/node/185766 as a duplicate

add1sun’s picture

Some more upgrade work. This is mainly just running the Coder upgrade on it and I didn't have time to get all of those. Also note that this patch is converting Image along with all of the underlying contrib modules with it at the same time.

drewish’s picture

FileSize
18.17 KB

fixed a couple of things:
* hook_schema wasn't returning $schema.
* use core's version of image_scale_and_crop().
* added hook_theme to image.module, didn't get around to looking at the contrib sub-modules.

still a ton to do.

misty3’s picture

subscribed

Romka’s picture

For what version of image.module this patches? I'm download last official release (2007-Oct-17) and its contain, for example, file image.info from 18.10.2007, but all patches search version of image.info from 18 Jul 2007 17:04:02, and patch dont work correclty. Can you upload patched version of module Image?

add1sun’s picture

Patching for upgrades is done against the HEAD version of the module. If you would like to help with upgrading the code you should grab a copy of HEAD from CVS and work from that. The current patches do not make a fully functional module yet so there isn't really "just testing" to be done until we get the code in better shape.

domasj’s picture

I will try to look at it.

Romka’s picture

I have installed Drupal 6 beta 3, HEAD version of image.module. I'm apply patch image_181809.patch (from #4 post). After this operation image.module was correctly installed, but when i'm try to create new Image-type node (go to node/add/image) i'm get error:

Fatal error: Call to undefined function file_check_upload() in D:\Program Files\Apache Group\Apache2\htdocs\drupal6beta3\modules\image\image.module on line 366

Function file_check_upload() exist in Drupal 5 core, but not exist in Drupal 6. Next, i'm paste this function to the image.module (just copy-paste from http://api.drupal.org/api/function/file_check_upload/5) and "Create Image" form show correctly, but when i'm select image in file-field and press button "submit" i'm get error "You must upload an image", although i'm choose picture in previous step...

add1sun’s picture

As I said, the code does not give you a working module yet. It is still broken code and we know this. There is still a lot of basic upgrading that is needed (as you found with the file_check_upload function - that simply won't work in 6.) There is no point trying to actually *use* it yet. The only reason to apply the patch at this point is if you intend to help continue the upgrade by coding and supplying another patch.

Once we get a patch that gets the module basically upgraded and functional, then we will create a branch and ask for testing and feedback.

Hetta’s picture

marked http://drupal.org/node/195636 as duplicate

Murz’s picture

subscribed

add1sun’s picture

Few little things worked out. Image node creation still not working though.

rkendall’s picture

subscribe

add1sun’s picture

New patch attached. This one worked out Image Gallery. The two things in IG that still need a look are

1. I am a little confused about the new non-caching menu stuff.
2. I created the theme registry but did not templatize the theme functions yet. I dare say we should create templates though as this is a common thing for folks to want to easily theme.

add1sun’s picture

OK, I went through the other contribs as well. Image Attach is mostly done and img_im_advanced and img_import are done.

add1sun’s picture

I should add that the whole file_save vs file_check stuff is the big stuff that needs to be worked out in Image and Image Attach, while there is still a little bit of minor stuff to do. I totally don't get the file stuff, so I'm leaving that for others to do.

So, Note to folks who are just following along - NO, it still doesn't work. Until the file stuff works, Image won't work.

Murz’s picture

I can't apply patches to HEAD version of Image module. I try all versions - HEAD from CVS, 5.x-1.x-dev at 2007-Dec-08, 5.x-1.6 at 2007-Oct-18.
I try to apply only last patch, all patches from 1 to 16, patches from 13 to 16, and no one applies successfully.
For example: HEAD version from CVS today, image-d6upgrade-181809-1.patch:

$ patch -p0 < ./image-d6upgrade-181809-1.patch
patching file README.txt
patching file image.info
patching file image.install
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file image.install.rej
patching file contrib/image_attach/image_attach.info
patching file contrib/image_attach/image_attach.install
Hunk #1 succeeded at 1 with fuzz 2.
patching file contrib/image_gallery/image_gallery.info
patching file contrib/image_im_advanced/image_im_advanced.info
patching file contrib/image_import/image_import.info

After that applying patch image-d6upgrade-181809-3.patch

$ patch -p0 < ./image-d6upgrade-181809-3.patch
patching file README.txt
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file image.info
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file image.install
patching file image.module
patching file views.inc
patching file contrib/image_attach/image_attach.info
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file contrib/image_attach/image_attach.install
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file contrib/image_attach/image_attach.install.rej
patching file contrib/image_gallery/image_gallery.info
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file contrib/image_im_advanced/image_im_advanced.info
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file contrib/image_import/image_import.info
Reversed (or previously applied) patch detected!  Assume -R? [n] y
patching file contrib/image_import/image_import.module

Can anybody post already patched version or tell me an algorithm and source for pathcing?

add1sun’s picture

The only patch that you should apply at this point is image-d6upgrade-181809-16.patch.

I just did a fresh checkout of image module HEAD

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d image contributions/modules/image

and the -16 patch applied cleanly for me.

patch -p0 < image-d6upgrade-181809-16.patch

drewish’s picture

FileSize
51.26 KB

got the uploading basically working. it's probably still buggy but at least people can start testing it out.

drewish’s picture

one note: there might be some debug code left in that last patch so if you don't have the devel.module installed you may get fatal errors.

add1sun’s picture

Uploading isn't working for me. Get these nice errors when hitting Save on node/add/image:

    * warning: Division by zero in /Users/addi/Sites/upgrade6/includes/image.inc on line 185.
    * warning: Division by zero in /Users/addi/Sites/upgrade6/includes/image.inc on line 185.
    * Unable to create scaled test image
    * notice: Undefined variable: ext in /Users/addi/Sites/upgrade6/includes/file.inc on line 420.
    * The selected file /Users/addi/Sites/upgrade6 could not be copied.
    * notice: Undefined index: _original in /Users/addi/Sites/upgrade6/sites/all/modules/image/image.module on line 638.

The images directory is there and there are two "files" in it (from my two attempts) but both are named upgrade6 (the other is upgrade6_0) which is the name of the drupal root dir. The temp dir within images dir DOES have the proper image thumbnails created.

Patch attached here is the same, just removing the dvms. Unfortunately I don't have time today to dig into the code.

Romka’s picture

Urrrraaa! It works! Big thanks.

Romka’s picture

I'm install Image_gallery module and when i try to create new gallery i'm get error:

Fatal error: Call to undefined function taxonomy_get_vocabulary() in D:\Program Files\Apache Group\Apache2\htdocs\drupal6beta3\modules\image\contrib\image_gallery\image_gallery.module on line 412

This function in Drupal 6 renamed to taxonomy_vocabulary_load(). I'm improve this function name and module begin work correclty.

Murz’s picture

With last patches all works good, but image_gallery module gots an error:
Fatal error: Call to undefined function taxonomy_get_vocabulary() in /www/tourismnn.shtrix.ru/www/sites/all/modules/image/contrib/image_gallery/image_gallery.module on line 412
You need to change call to function taxonomy_get_vocabulary() to taxonomy_get_vocabularies() in 412 string of image_gallery.module.

Murz’s picture

I also patched an edit gallery form function for working with Drupal 6, and do a patch from image-d6upgrade-181809-22.patch to my version (image-d6upgrade-181809-22_to_editform.patch), maybe it helps to author of module.
And full patch from cvs version - image-d6upgrade-181809-22-1.patch

drewish’s picture

FileSize
3.17 KB

Fixed the image_gallery menu.
Fixed the image_attach and image_gallery hook_theme() implementations.
Moved _image_check_settings() into image_requirements().

add1sun’s picture

ooops, drewish you attached the wrong patch.

drewish’s picture

FileSize
54.19 KB

right you are...

add1sun’s picture

Few minor tweaks for Image Gallery breadcrumbs and new l function params.

I figured out when I am getting the problem with my uploads I mentioned above. It was because I had created my own Image size under admin/settings/image. I had made a new one called Test that was set to scale and crop at 200px. That meant that I could not upload a picture larger than that size and I would get the warnings and junk spit out above. Once I removed that Image size, I could upload things fine.

domasj’s picture

Simple correction of l() parameters in block display.

Donovan’s picture

Component: image.module » image_attach
Assigned: Unassigned » Donovan
Status: Needs work » Needs review
FileSize
1.18 KB

Hello, this is my first attempt at contributing a Drupal patch.

I patched 'image_attach.module' to address the 'file_check_upload()' and 'db_num_rows()' API changes per the "Converting 5.x modules to 6.x" guidelines. Prior to this patch, the Image module caused the following error whenever I attempted to attach an image to a forum post:

"Fatal error: Call to undefined function: file_check_upload() in /...site_path.../sites/all/modules/image/contrib/image_attach/image_attach.module on line 245"

The changes in this patch have eliminated this error, and my test site now works nearly flawlessly with the Image module and FCKeditor.

The only (un-related) problem I have observed is that the Image Gallery Edit function does not work (i.e, you cannot delete or make changes to Image Galleries after they are created).

Please let me know if this patch does not conform with Drupal standards and I will attempt to comply.

nobios’s picture

Component: image_attach » image.module
Assigned: Donovan » nobios
Category: task » bug
Status: Needs review » Active

Hi there!

I'm moving my site, in a test enviroment, drupal from 5.5 to 6-RC1, and image from the offical release. So I grabed HEAD, aplied image-d6upgrade-181809-16.patch and tried to run update.php. I didn't aplied the other ones cause none of then really has nothing new in this area and in #16 we see a light.

I get the following errors:

user warning: Unknown column 'f.nid' in 'field list' query: INSERT INTO image SELECT DISTINCT f.nid, f.fid, f.filename FROM files f INNER JOIN node n ON f.nid = n.nid WHERE n.type='image' AND f.filename IN ('_original', 'thumbnail', 'preview') in /Users/everson/Sites/drupal-6.0-rc1/sites/all/modules/image/image.install on line 227.
user warning: Table 'drupal.file_revisions' doesn't exist query: DELETE FROM file_revisions WHERE EXISTS (SELECT * FROM image WHERE image.fid = file_revisions.fid) in /Users/everson/Sites/drupal-6.0-rc1/sites/all/modules/image/image.install on line 230.

My files table really don't have nid, just fid and uid. So I went check when and what really changes and find at system.install at system_update_6022.

  // Rename the file_revisions table to upload then add nid column.
  db_rename_table($ret, 'file_revisions', 'upload');
  // The nid column was renamed to uid. Use the old nid to find the node's uid.
  update_sql('UPDATE {files} SET uid = (SELECT n.uid FROM {node} n WHERE {files}.uid = n.nid)');
  update_sql('UPDATE {upload} SET nid = (SELECT r.nid FROM {node_revisions} r WHERE {upload}.vid = r.vid)');

I'm working on updating this in the install script and change the update_sql(CREATE table to db_create_table.

I only want to know 1 thing first. Do we need to remove this 5200 update so we don't get the errors messages? Or just add the image_update_6000 will do?

Before I forget: Thanks for this great code, I'm a new in drupal development but I will do my best to contribute where I can.

Donovan’s picture

FileSize
1.18 KB
49.71 KB
52.45 KB

Hi nobios,

This is my first patch submission so I do not know if it was done entirely correctly. Here is the process I used to get the module working as described in my post (#32):

1. Downloaded the current image using:

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d image contributions/modules/image

2. Created the base module by appling the #31 patch using the following command:

patch -p0 < image-d6upgrade-181809-31.patch

3. Changed 'image_attach.module' per my post above to create my working module

4. I then created the patch posted in #32 above from my working module and the base module

I have attached the current working module (image.zip), the base image module (image_old.zip), and the patch for reference. I hope it helps.

Donovan.

recidive’s picture

Category: bug » task
Status: Active » Needs review

Correcting.

drewish’s picture

Status: Needs review » Active

To make things easier I'm going to commit all the changes that have been made to this point. There's probably still quite a bit to be done but at least now people will be able to grab a nightly build to test it out.

zoo33’s picture

Here's a small patch to make the ImageMagick toolkit work. There's a new bug in Drupal 6 related to this however, so you also need my patch in #201540 to make it work. Please help review that as well as this one.

zoo33’s picture

...and here's another one for the contributed image_im_advanced.module. Seems to work fine now, if combined with the two patches mentioned above.

drewish’s picture

Status: Active » Fixed

committed zoo33's patches to HEAD. i'm going to close this, additional bugs should get their own issues.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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