Upgrade to 6

add1sun - October 8, 2007 - 21:07
Project:Image
Version:6.x-1.x-dev
Component:image.module
Category:task
Priority:normal
Assigned:nobios
Status:closed
Description

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.

#1

add1sun - October 9, 2007 - 16:41
Status:active» patch (code needs work)

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

AttachmentSize
image-d6upgrade-181809-1.patch7.29 KB

#2

drewish - October 23, 2007 - 16:03

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

#3

add1sun - October 28, 2007 - 18:52

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.

AttachmentSize
image-d6upgrade-181809-3.patch15.45 KB

#4

drewish - October 29, 2007 - 05:37

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.

AttachmentSize
image_181809.patch18.17 KB

#5

misty3 - November 20, 2007 - 01:14

subscribed

#6

Romka - November 22, 2007 - 09:18

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?

#7

add1sun - November 22, 2007 - 15:51

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.

#8

domasj - November 24, 2007 - 15:29

I will try to look at it.

#9

Romka - November 25, 2007 - 15:56

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

#10

add1sun - November 25, 2007 - 18:42

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.

#11

Hetta - November 27, 2007 - 13:26

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

#12

Murz - December 3, 2007 - 12:02

subscribed

#13

add1sun - December 6, 2007 - 01:54

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

AttachmentSize
image-d6upgrade-181809-13.patch21.37 KB

#14

rkendall - December 6, 2007 - 21:46

subscribe

#15

add1sun - December 7, 2007 - 01:56

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.

AttachmentSize
image-d6upgrade-181809-15.patch31.43 KB

#16

add1sun - December 7, 2007 - 02:27

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

AttachmentSize
image-d6upgrade-181809-16.patch42.08 KB

#17

add1sun - December 7, 2007 - 02:30

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.

#18

Murz - December 8, 2007 - 06:15

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?

#19

add1sun - December 8, 2007 - 14:13

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

#20

drewish - December 10, 2007 - 19:04

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

AttachmentSize
image_181809.patch51.26 KB

#21

drewish - December 10, 2007 - 19:18

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.

#22

add1sun - December 10, 2007 - 19:54

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.

AttachmentSize
image-d6upgrade-181809-22.patch51.08 KB

#23

Romka - December 10, 2007 - 21:06

Urrrraaa! It works! Big thanks.

#24

Romka - December 10, 2007 - 21:19

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.

#25

Murz - December 11, 2007 - 08:44

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.

#26

Murz - December 11, 2007 - 09:53

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

AttachmentSize
image-d6upgrade-181809-22-1.patch51.47 KB
image-d6upgrade-181809-22_to_editform.patch3.63 KB

#27

drewish - December 11, 2007 - 21:17

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

AttachmentSize
station_183049.patch3.17 KB

#28

add1sun - December 11, 2007 - 22:24

ooops, drewish you attached the wrong patch.

#29

drewish - December 11, 2007 - 22:43

right you are...

AttachmentSize
image_181809.patch54.19 KB

#30

add1sun - December 11, 2007 - 23:44

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.

AttachmentSize
image-d6upgrade-181809-30.patch54.79 KB

#31

domasj - December 13, 2007 - 10:05

Simple correction of l() parameters in block display.

AttachmentSize
image-d6upgrade-181809-31.patch55.67 KB

#32

Donovan - December 30, 2007 - 00:45
Component:image.module» image_attach
Assigned to:Anonymous» Donovan
Status:patch (code needs work)» patch (code needs review)

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.

AttachmentSize
image-d6upgrade-181809-32.patch1.18 KB

#33

nobios - December 30, 2007 - 14:47
Component:image_attach» image.module
Category:task» bug report
Assigned to:Donovan» nobios
Status:patch (code 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.

<?php
 
// 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.

#34

Donovan - December 31, 2007 - 07:19

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.

AttachmentSize
image-d6upgrade-181809-32.patch1.18 KB
image.zip49.71 KB
image_old.zip52.45 KB

#35

recidive - January 3, 2008 - 05:30
Category:bug report» task
Status:active» patch (code needs review)

Correcting.

#36

drewish - January 6, 2008 - 22:15
Status:patch (code 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.

#37

zoo33 - January 13, 2008 - 23:45

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.

AttachmentSize
image-imagemagick-181809-080114.patch997 bytes

#38

zoo33 - January 13, 2008 - 23:50

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

AttachmentSize
image_im_adv-181809-080114.patch1.38 KB

#39

drewish - January 15, 2008 - 22:54
Status:active» fixed

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

#40

Anonymous (not verified) - January 29, 2008 - 23:02
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.