Drupal 6 port ?
zmove - August 13, 2008 - 10:11
| Project: | Ubercart Option Images |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | pillarsdotnet |
| Status: | closed |
Description
Hi,
Recently, Ubercart team released a drupal 6 version of ubercart that pretty usable with the support of the D6 version of imagefield, imagecache, etc... (download the latest bazaar version).
Do you plan to update your module to drupal 6, if yes, do you have an estimation about when it can be done (another thing that the current "when it's ready" ^^)
If you don't plan to update module, are you agree to review and implement if the review is good an eventually patch ?
zmove

#1
They have a d6 release already? great! unfortunately I am busy at work with other projects but I welcome any maintainers that would like to work on uc_option_images as well.
#2
I did a quick conversion with Deadwood, there were just an extra ) at line 407 a missing ) at line 411. Unfortunately the schema for files have changed so the uc_option_image_save and uc_option_image_load functions needs to be rewritten completly.
I'm not up to it at this time.
I've attached the converted files for whoever might continue.
The admin pages work well as well as the forms and the module selection in drupal 6.4
#3
Really should have its own table, but it was a quick module at the time so I never got around to it :)
#4
It also should have default images set in the admin part. For example, when I list colors I would like to have all the color images added in the admin part, b/c I can't take pictures of everything in all the 45 color variations I have available. For now I'll just hard code that into a template file.
#5
That too, there are alot of variations with that which may be ideal depending on what the person is doing. Defaults as well as image-not-found images should all ideally be uploadable.
#6
#7
Is anyone working on modifying the uc_option_image_save and uc_option_image_load functions so that they support Drupal6? If not, I'm going to give it a shot but wanted to know in advance if anyone had started already.
#8
This mod looks pretty good - looking forward to the 6 port :)
#9
Working on a 6.x conversion -- started with deadwood and the 5.x/6.x upgrade guide.
Looking at the file schema now; can't be too hard...
#10
Well, the nid column doesn't exist; trying to use the filename column instead...
#11
Woo-hoo! It's working!
Patch relative to current CVS HEAD checkout.
#12
Slight changes.
Pretty much works for me now.
I have an idea for improvement that would eliminate a great deal of redundancy in the image uploads:
#13
Halfway there -- the logic is implemented but not the ui.
Added a default fallback image.
So the logic goes:
Load the specific node/attribute/option image if it exists,
else Load the attribute/option image if it exists,
else Load the default image.
#14
I dont have time to maintain this module guys, feel free to step up as a maintainer if you would like, and I will grant you CVS access.
#15
I'm interested.
#16
Its all yours :)
#17
Hi,
I've tried out uc_option_image-6.x.zip from post 12 & 13.
#13 causes product nodes to load up as a blank page.
#12 Allows me to choose option images and will display the default image. If I choose one of the option from the select field the option image vanishes. What do I need to do to make this module work for me?
I'm using drupal 6.8 and Ubercart 6.x-2.0. I've ticked yes to switching option images and selected the right attribute.
Any suggestions?
Cheers,
John
#18
Problem fixed. Using module from post #12 I changed the image option size, in the attribute settings menu, from Original to Product. Now the module works as it should.
Thanks for writing and updating a great module.
#19
It appears that I can only have one option displaying it's images at a time. Is it, or could it be made, possible to have an image displayed for each option with images?
#20
working on that. hang on a couple more days...
#21
sweet :), thank you.
#22
Questions for comment:
1. Should each option image be located (a) before or (b) after the option selection form?
2. Should we skip attributes with fewer than two options?
#23
#22
1. Is it possible to have it selectable?
2. Of course, there are no actual options to select if there is only one option. It is good user interface to not confuse people with the impression of options where there are none.
3. It has been a long while since I tried out the module, so just ignore this if question 1 is exactly what I am asking about ;) Could the option image, if it is small enough, be inlined in the option tags of a drop down? I think that might need some stylesheet magic, but it would be nice if it is possible.
#24
1) Pepsi & Coke - some people will prefer one, some the other. Both are valid choices.
2) Yes, simplicity works. Possibly this is easiest achieved by not having a 'no image' picture if no images have been uploaded for the option.
As an aside. I've broken my install of the module posted in #12. I did have pictures working. Now the picture are no longer visible and I see the words 'no image' in their place. Even after uploading new pictures to the options they don't appear. Any clues as to what I may be doing wrong?
#25
#13? Try it again. Do you have any caching on your site? Have you tried uninstalling and reinstalling the module (if it have the proper uninstall hook)?
Apart from that, no idea, especially if you have been modifying it yourself. Try diffing your version with the one you downloaded to see the changes you have done, and try to work from that.
#26
I'll give #13 another go. And I'll try uninstalling (if possible)
I do have caching. In trying to fix this problem I flushed both the image_cache caches and the caches in the performance menu. I haven't modified the module.
#27
I just tried the .zip file at post #13.
I copied the uc_option_image folder to my modules folder at sites/all/modules/.
At admin/build/modules I checked 'Option Images' and Save.
(Dev site is running on my laptop) after about 2-3 minutes of hanging for a return page, I get a blank page in response.
I go back to my site's homepage, and all seems fine.
Go back to admin/build/modules and 'Option Images' is unchecked.
Turned on devel.module query logging, tried enabling the module again, got back a whole lots of these (edited my pathnames but the log is otherwise the same):
Missing argument 2 for drupal_get_path(), called in /Users/me/Sites/example.com/sites/all/modules/uc_option_image/uc_option_image.install on line 5 and defined in /Users/me/Sites/example.com/includes/common.inc on line 1669.\";}}', timestamp = 1232483532 WHERE sid = 'kil654ok4nmjj8i60ik0tl8757'
This error is repeated dozens and dozens of times. Not sure if anyone else is seeing this when enabling the module.
#28
Use the one in #12 not the one in #13.
#29
I tried the module from #13. Here's the error message I get. Along with the relevant function.
Fatal error: Call to undefined function _t() in /var/www/html/sites/all/modules/uc_option_image/uc_option_image.module on line 395
Line 395:- _t('uc_option_image_load',array('nid'=>$nid,'aid'=>$aid,'oid'=>$oid));
Relevant code:-
/**
* Load image file.
*
* @todo: static cache
*/
function uc_option_image_load($nid, $aid, $oid) {
_t('uc_option_image_load',array('nid'=>$nid,'aid'=>$aid,'oid'=>$oid));
static $files;
$filename = uc_option_image_id($nid, $aid, $oid);
if (empty($files[$filename])){
$files[$filename] = db_fetch_object(db_query("SELECT * FROM {files} WHERE filename = '%s'", $filename));
if (empty($files[$filename])) {
if ($nid) {
return uc_option_image_load(0, $aid, $oid);
}
elseif ($aid && $oid) {
return uc_option_image_load(0, 0, 0);
}
}
}
_t('uc_option_image_load',array($filename => $files[$filename]));
return $files[$filename];
}
#30
yup. Take those lines out; I had them in for debugging; sorry. the _t() function is one I wrote myself -- not part of Drupal.
Right now my priority is to make uc_option_images and uc_aac work together. Until then, uc_option_images is kinda useless for me.
#31
Started porting this myself before gradually realising I'm slightly out of my depth. Looking at this patch, seems you've already gotten further than me.
Have you made any more progress? Tomorrow I'll look at seeing if I can make any further progress with the patches you've pasted.
#32
Have you had any joy getting option_images working with aac?
#33
I get the server error as well with both #12 and #13 versions. Drupal 6.9. Thoughts?
#34
Any news?
#35
Should be able to work on it this week.
#36
Sweet :)
#37
pillarsdotnet, would it be possible to base the options on CSS sprites in 6.x?
#38
I tested number #12 and it seems to work well. The only thing I noticed is that it requires each product to have specialized images for each option. It would be nice if one could add a default image for each option. Thus, for example if I use color, I could upload a color for each option in the settings, and thus there will be a list of colors available by default; then, when the photographer has the time we can add images gradually.
#39
I also realized it is possible to upload images for text attributes if I add an option. I added an option measurement, and of course the image I uploaded didn't show up. It would be nice to be able to add one image for a text box, for example for measurements, these kinds of images are used to show the customer how to measure for what they want to order.
Of course there is no big deal in adding those images via for example css, but it would be very convinient to add one image for each type of measurement attributes available.
EDIT: Forgot to write "text" in front of "attributes", big difference ;)
#40
Any news on this?
#41
Any further action on this? As far as adding the Drupal 6 port to CVS I mean.
#42
I used to have Option 12 working. Now it doesn't, the first option image shows but there is no image once the ption is changed, not sure why. Looking forward to the new version coming out
#43
I had a similar problem - a working test installation of #12 stopped working for no apparent reason. It turned out that the uploaded image files had disappeared. A bit of digging suggested that it might be due to the fact that the files weren't marked permanent in the files table. Changing this code around line 429:
$file->filename = $nid . $aid . $oid;
$file->uid = $user->uid;
to this:
$file->filename = $nid . $aid . $oid;
$file->uid = $user->uid;
$file->status = FILE_STATUS_PERMANENT;
seems to have corrected that problem for me.
#44
Good catch. Commited patch in #12 and Jerry's correction to HEAD.
#45
Please post problems with 6.x version as separate issues rather than adding to this one. Thank you.
#46
Automatically closed -- issue fixed for 2 weeks with no activity.