This issue is for testing and development of the ImageField D6 port. The D6 port is happening in imagefield HEAD.
Please do not *subscribe* to this issue.
The D6 ports of both imagefield and filefield will include a field_file.inc.
field_file.inc will:
- house functions common to imagefield and filefield
- partially implement hook_file
- clean up error messages and logging from core file.inc functions
If you wish to participate in the D6 port of imagefield, only issues with patches will be accepted against head until an alpha released is reached. If you file an issue without a patch before the first alpha I will close it.
Consider this issue informational, there should be little or no need to comment on it. If you wish to file a patch against HEAD open a new issue.
Comment | File | Size | Author |
---|---|---|---|
#26 | imagefield-6.x-port-257620-26.patch | 11.86 KB | webchick |
#24 | imagefield-6.x-port-257620-24.patch | 10.54 KB | webchick |
#7 | imagefield-6.0-257620-5.patch | 11.3 KB | Deciphered |
#4 | imagefield-6.0-257620-4.patch | 6.62 KB | Deciphered |
#3 | imagefield-6.0-257620-3.patch | 5.81 KB | Deciphered |
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedInitial patch to make the field actually show up; I fully expect some of these changes to be reverted, but it does make the field show up.
There are still a lot of issues with this port so unless you plan to debug it don't bother installing.
Comment #2
Deciphered CreditAttribution: Deciphered commentedRevised patch, use instead of the above patch.
ImageField now displays and files seem to upload ok.
Comment #3
Deciphered CreditAttribution: Deciphered commentedNew Patch:
- Added JS file back into the module
- Changed calls to _imagefield_file_load() to field_file_load()
Comment #4
Deciphered CreditAttribution: Deciphered commentedNew Patch:
- Two references of '_imagefield_file_delete()' changed to 'field_file_delete()'
Comment #5
rapsli CreditAttribution: rapsli commentedtried to apply patch against head, 1 hunk failed:
***************
*** 56,62 ****
// if we're creating a new revision, return an empty array so CCK will remove the item.
if ($node->old_vid) return array();
// otherwise delete the file and return an empty array.
- if (_imagefield_file_delete($file)) return array();
}
// set permanent status on files if unset.
--- 56,62 ----
// if we're creating a new revision, return an empty array so CCK will remove the item.
if ($node->old_vid) return array();
// otherwise delete the file and return an empty array.
+ if (field_file_delete($file)) return array();
}
// set permanent status on files if unset.
I would gladly be testing, you got to give me a running version though
Comment #6
Deciphered CreditAttribution: Deciphered commented@rapsli - Make sure you are patching against HEAD, I just tested the patch myself and it worked perfectly.
If you haven't got CVS setup you can always use the web-based CVS repository and save each file: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/imagefield/...
Comment #7
Deciphered CreditAttribution: Deciphered commentedUpdated patch:
- Stopped Imagefield hijacking Node title.
Comment #8
bbeyer CreditAttribution: bbeyer commentedI have tried this patch and the previous one. The patch seems to work for adding inmagefield to my content type. But when I view pages that use the imagefield, I get an error. It says my maximum execution time(30 seconds) has been exceeded on line 468 of the imagefield.module
Comment #9
Steve Dondley CreditAttribution: Steve Dondley commentedI'm seeing basically the same thing except I see it on line 458. I first got this error after trying to upload the image through the form. AFter that, all pages return this error to me and the error is reported to happen on line 460.
I have to set the status of the module to 0 in the db to fix.
Comment #10
Steve Dondley CreditAttribution: Steve Dondley commentedIt has something to do with the unset($items[$delta]) line. When I comment it out. Things work. I wonder if it has something to do with the fact that $items is passed by reference. unset behaves differently on variables passed by reference. See http://www.php.net/unset
But I really have no clue what this section of code is trying to do or how it works. So I'm just blowing smoke.
Comment #11
Steve Dondley CreditAttribution: Steve Dondley commentedOK, changing the line to
$items[$delta] = '';
works.
Doesn't seem to break anything. I can even do multiple images on a node (which I assume the $delta is for).
Comment #12
rapsli CreditAttribution: rapsli commentedare there any plans for a first dev release? ... it would make testing easier
Comment #13
bbeyer CreditAttribution: bbeyer commented#11, fixed my timeout problem, but now the image doesn't show up when viewing the piece of content
Comment #14
Steve Dondley CreditAttribution: Steve Dondley commentedbbeyer, is working for me. Make sure you have cck settings configured to show the image.
Comment #15
catchThis is a patch.
Comment #16
bbeyer CreditAttribution: bbeyer commentedSteve, do you mean in the field settings for the imagefield of my custom content type? If so, I am not sure where I can change that. Or are you talking about a general option for the CCK itself?
Comment #17
Steve Dondley CreditAttribution: Steve Dondley commentedbbeyer, you have to dig into the code around line 460 and change it from unset($items['delta']) to what I put in comment #11
Comment #18
bbeyer CreditAttribution: bbeyer commentedSteve,
I did that and it all seems to work except that the image doesn't show up when I view the node. I have tried all the different display options in the administration side of the content type and can't get the image to appear. When I first upload the image and preview the node it looks ok, but as soon as I save it, the image does not appear.
Comment #19
Steve Dondley CreditAttribution: Steve Dondley commentedIf I recall, I think I might have had the problem at first but the problem seemed to have fixed itself. Maybe it's a cache issue.
Comment #20
Moonshine CreditAttribution: Moonshine commentedyes... clear your cache. :)
Comment #21
Vigile CreditAttribution: Vigile commentedI installed the latest HEAD version with patch 5 and can upload files just fine. They aren't showing up at all though -- is this normal for this state of the module patches?
Comment #22
Moonshine CreditAttribution: Moonshine commentedDisplay works, make sure you have cleared Drupal's cache. You can also check to make sure the field is set to display in "Display fields" for that content type.
Comment #23
bbeyer CreditAttribution: bbeyer commentedyep, clearing the cache fixed my display issue
Comment #24
webchickI get a bunch of notices when uploading an image (just used default options on the field):
Also, here's a re-roll from the imagefield root directory, so you don't have to type the file names in manually.
Comment #25
Deciphered CreditAttribution: Deciphered commented@webchick
I will try to take a look for the cause of the issue as soon as I get a chance.
One thing I did notice is that your re-roll excluded the 'imagefield.js' file, I presume this isn't intentional?
If you get a chance can you re-roll? If not I will do so myself when I have the time.
Comment #26
webchickOh, dang it. :P Sorry about that. Thanks!
Comment #27
jbrauer CreditAttribution: jbrauer commentedTested #26 and it generally seems to work.
The only problem I ran into was that after uploading the maximum number of images the add image form is still displayed and while the page shows a warning that you can only upload X images it allows adding at least X+2 images which then have to be removed with a preview and checking the delete boxes to get the count down to the minimum.
Comment #28
dopry CreditAttribution: dopry commentedThe ports in the patches to date are solely functional ports which do not leverage any of the new api features available in D6. I'm not going to accept just a functional upgrade to imagefield. There are two features in particular which should be leveraged. CCK's multivalue handling and FormAPI's #value_callback feature.
Ideally the #value_callback for the imagefield widget saves an uploaded file, and the process callback displays either a file upload form or an image edit form. I'm also adding a new column to imagefield for D6 called data, in which widgets can store serialized data. This is to provide a place for widgets like eyedrop and imagefield_crop to store their information on a per image basis. or for widgets to implement caption txt etc.
.darrel.
Comment #29
dopry CreditAttribution: dopry commentedsome of the first steps of leveraging the #value_callback and CCK's multiple value field are complete. the imagefield_widget_value callback is now saving uploads, but not passing them back to the field. CCK is in fact handling the multiple values currently though....
next steps: save fid associations, processing for widget if #value is not empty.
Comment #30
Moonshine CreditAttribution: Moonshine commentedJust a heads up that in D6 file_save_upload() saves files with a "temporary" status flag which you have to update or the files are deleted during cleanup.
From the API:
Ran into it today with some other code...
Comment #31
Rowanw CreditAttribution: Rowanw commentedApplied the latest patch to HEAD but 8 out of 15 hunks failed:
Comment #32
Deciphered CreditAttribution: Deciphered commented@Rowanw
dopry has made some changes to the way Imagefield works and I presume will continue making these changes, as to not step on his toes I will probably not attempt any more patches for the moment. You can however download imagefield.module version 1.38 from here and you will be able to apply the patch.
Also note that while fetching the above link for you I noticed that dopry has not updated imagefiled.module to version 1.42, it is quite possible that he has got it to a working stage where you won't even need a patch. Test that first, if that doesn't work then what I said above should work.
Comment #33
dopry CreditAttribution: dopry commented@Moonshine: Thanks for reminding me about file_save_upload and the Temporary status flag. I wrote it, but seemed to forget it... :)
@deciphered: I think the widget interface is in it's general form at this point, more so than it was with earlier patches. I'd really love to have more eyes on it at this juncture, even though it isn't fully working... If my description of how the widget should work is too obtuse feel free to ask questions. It will help me understand what needs to be documented...
@todo: image form testing... we need to be able to delete, and change alt/title. set file status in hook_field on node save. begin improved ajax upload code that replaces a single image widget. instead of the entire form structure.
.darrel.
Comment #34
alippai CreditAttribution: alippai commentedWhen will an alpha/beta release avaible?
I read that there are only few bugs there now.
Or is the HEAD in CVS the actual dev version? - it's a 3 week old code :S
Comment #35
Deciphered CreditAttribution: Deciphered commented@alippai,
The helpful thing to do would be to test the latest version in HEAD (which is 8 days old, not 3 weeks old) and if you find any bugs report them or attempt to fix them.
Comment #36
rapsli CreditAttribution: rapsli commentedtested latest head. Two Bugs:
When I create a new node and then hit the upload button the node is being saved instead of just uploading the image.
Image is not being uploaded as my files directory stays empty.
Comment #37
alippai CreditAttribution: alippai commentedSo my test:
ImageField - latest HEAD
CCK - 2.0 beta
Private file handling, path set to '../files' - it's the first time when I use private file handling, so there can be problems
clean URLs - ON
I can't save imagefield settings in a node type, I get this error when I submit the form :
The forms action contains the index.php?q= part of the address, but clean URLs are enabled and they are used on the other parts of the site...
EDIT: The default image checkbox is unchecked.
Comment #38
catchIs your files directory writable then? You should check upload.module with that setting since nothing in that error message mentions imagefield.
Comment #39
alippai CreditAttribution: alippai commentedIMHO the second error message is the result of this part of the code:
so function imagefield_check_directory returns with false for ../files
Upload module works for me.
Comment #40
alippai CreditAttribution: alippai commentedreturns false (line ~410 of imagefield.module)
Comment #41
andrewfn CreditAttribution: andrewfn commentedWebchick, if you would re-roll the patch @26 so that it applies against HEAD then I will test it.
Thanks.
Comment #42
alippai CreditAttribution: alippai commentedThere can be a better solution, but this one works for me:
Comment #43
dopry CreditAttribution: dopry commentedallipai: file_create_path(..) should fail. does file_create_path (../files) fails? There is a function file_check_location that verifies that the path is within the files directory '..' is most certainly not in the files directory. Maybe there is an issue with field_file_check_directory() I over looked.
@all:
really if you want to file an issue against HEAD open an issue for it, do not use this issue. What part of
do you guys not understand?
Comment #44
dopry CreditAttribution: dopry commentedsee 6.x-3.x.