Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Is there a plan about to port to D7?
Recently I got a D7-compatible version from some upgrade tool, want to share it with maintainers.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#46 | uc_catalog.png | 152.23 KB | Jawi |
#46 | product_page.png | 81.83 KB | Jawi |
#32 | ad_option_image.jpg | 129.24 KB | Jawi |
#32 | attribute_options_selected_image.jpg | 84.66 KB | Jawi |
#16 | uc_option_image.tar_.gz | 5.98 KB | aacraig |
Comments
Comment #1
latulipeblanche CreditAttribution: latulipeblanche commented... and is there a plan to make the D7-compatible version also compatible with Drupal Commerce ?
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedPatch no longer applies.
I created a 7.x-1.x branch and ran Coder Upgrade on it. The result is untested as I no longer use uc_option_images on any of my sites, but at least it provides a starting point.
See 7.x-1.0-alpha1 release.
Comment #3
latulipeblanche CreditAttribution: latulipeblanche commentedTnx a lot, I hope that someone is able to make it a Commerce _Option_Images.
Paul
Comment #4
Babalu CreditAttribution: Babalu commentedd7 version of uc_option_images depends on imagecache, but imagecache is in drupal 7 core
Comment #5
kristin.e CreditAttribution: kristin.e commented@ Babalu - I can't see a d7 realease of option images. do you have a link to something?
kristin.e
Comment #6
christelle41 CreditAttribution: christelle41 commentedAfter a first installation test on the 7.x-1.0-alpha1 release, some problems appeared :
I'm getting on testing this release and try my best to get it work.
Comment #7
Babalu CreditAttribution: Babalu commented@ kristin.e - View all releases
Comment #8
p4trizio CreditAttribution: p4trizio commentedI got same errors as #6
Comment #9
Poieo CreditAttribution: Poieo commentedSubscribing.
Comment #10
rofsky CreditAttribution: rofsky commented+1 on #6, I removed the dependency on the .info file, then renamed the files references to file_managed. Looks like there is an issue with how hook_node_load.
Inspecting the $node object within the function shows that the version id is passed as an array index outside the node object.
hook_node_load is expecting an array of nodes.
It looks like the 6.x version expects 1 node. Whats odd is the 7.x alpha branch uses the 7.x syntax for the hook, but is expecting only 1 node.
I wrapped the inside of the uc_option_image_node_load in a for each, it got rid of that error, but then I had some errors later on in the files.
Has anyone else had any luck with this module? Is anyone else working on it?
Message me if you would like to work on this together or start a more current branch for 7.x
Comment #11
samgreco CreditAttribution: samgreco commentedAnything happening with this module? Could really use it. Unfortunately I have no coding skills.
Comment #12
kiwi_steve CreditAttribution: kiwi_steve commentedSame as above... keen to use it, but I don't have the knowledge to easily jump in and help at this point.
Comment #13
aacraig CreditAttribution: aacraig commentedI've done a proper port of this module to D7.
I've taken the liberty of rewriting the module completely, in order to take full advantage of the many changes in the UC and D7 APIs.
The functionality of the module remains unchanged except as follows:
I hope this is useful to everyone, and that D7 sites can now also enjoy this great and useful module!
Comment #14
aacraig CreditAttribution: aacraig commentedLeft behind a debug print statement.
This is a clean version.
Comment #15
aacraig CreditAttribution: aacraig commentedFinal version, I hope :)
This corrects an error in hook_schema which didn't come out until I installed the module on another site.
Comment #16
aacraig CreditAttribution: aacraig commentedSorry for the barrage of updates, but as I install and use the module on a soon-to-be-in-production site, I'm finding small improvements and bugs to fix.
Comment #17
Poieo CreditAttribution: Poieo commented@aacraig - Thanks for all your work getting this ready for D7!
Couple questions:
It appears the option images only work for radio style select lists. Is this intentional? I believe the D6 version worked with select lists as well.
You have the same form on both the attribute edit screen and the option edit screen. It would seem to be more clear if you only had the display options on the attribute edit screen and the image field on the option edit screen.
Comment #18
aacraig CreditAttribution: aacraig commentedThe last version of the module I attached works for all methods except text input, at least that's the intention, and if it doesn't, that's a bug.
From a functional point of view, you can actually set any setting at any level, and then override later on -- that is, you can set the image style in the attribute form, then later on set an image in the option form, then, for a single product, you could actually override both and have a single product display with a different image style and image.
The UI reflects that functionality, which is why the form is the same for all three.
Comment #19
Poieo CreditAttribution: Poieo commentedThanks for the feedback on the UI.
Regarding the selection method, everything works great for radio buttons. But, as soon as I change to a select this all the image disappear. I can see the div that is supposed to contain them, but it's empty.
Comment #20
aacraig CreditAttribution: aacraig commentedFor the select element, make sure you've activated "selected display". It won't show the images inline in the select drop down, as that's not part of the HTML standard, and only Firefox supports images in options, as far as I know.
With selected display activated, the selected option's image will display.
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks so much for your work on this @aacraig, it's working nicely for me.
We're displaying available colours in a grid, so I'd love to have each option image filename included in the $node->attributes array, but perhaps it's wishful thinking. I can work around it.
Comment #22
jake.litwicki CreditAttribution: jake.litwicki commentedSpectacular work aacraig. You should make an official release because I personally see this as invaluable, I can only imagine countless others would as well.
Comment #23
norbert.broadsword@gmail.com CreditAttribution: norbert.broadsword@gmail.com commentedAbsolutely outstanding! Couple of things I've noticed - I had already created a list of options (Called Label Image) and then installed the module. I then dutifully uploaded images in "Option Images for Label Image" where you get the list of options. Despite uploading al the images, they didn't appear. I had to actually go into Store, Attributes and then upload the images individually to each option. No big deal though.
Also, is there any way that the label text can be hidden? In my case, the shopper is actually choosing an image so there is no need to actually display the text of the label, only the image and the radio button. I've been banging my head over this all afternoon!
How difficult would it be to make the label display optional (I'm no coder so that might be a daft question!)
Thanks very much for porting this across to D7!
Comment #24
aacraig CreditAttribution: aacraig commentedYou should be able to upload images in any one of three places -- the attribute form, the option form or the option form for a single product. The image that displays will be the most specific of the three for the given product.
If you can explain in more detail (URLs of the pages you do the uploading on, for instance) what you did that didn't work, I can help you more.
As for hiding the label text, that's a great idea. However, I'd like to see this port become an official release, so that issues can be properly opened and categorized before doing any further development.
Comment #25
kerrymick CreditAttribution: kerrymick commentedI actually can't save the images on the product page under the options tab. When I try it throws the following error: Notice: Undefined index: options in uc_option_image_product_options_submit() (line 152 of /public_html/sites/all/modules/uc_option_image/uc_option_image.module). The images upload fine but when I hit submit is when I get the error.
Comment #26
aacraig CreditAttribution: aacraig commented@kmuryphychi, this is working for me.
Can you confirm that we're talking about the same page:
edit any product
click on the "options" item under the tabs
scroll down below the options to the "Option Images" section
insert an image in one of the option fields
Is that what you did to get the error?
Are you using the latest version (from comment #16)?
Comment #27
hawkeye217 CreditAttribution: hawkeye217 commented@aacraig: How about option images on the cart page?
Work was done for the D6 version here: http://drupal.org/node/256580#comment-2997674
I think it would involve simply adding uc_option_image_form_uc_cart_view_form_alter() to your code. I can try to work on it, but I figured you'd be able to get to it faster than I would since you're already familiar with the code...
Comment #28
aacraig CreditAttribution: aacraig commented@hawkeye217: That's a great suggestion. I won't have time to work on this in the immediate future, and I'd really like to see this port added as an official release so we can have a real issue queue.
If no one else has done it by then, I'll be able to look into this in two week's time.
Comment #29
hawkeye217 CreditAttribution: hawkeye217 commented@aacraig: Here is a function I hacked together that works for my particular needs. It assumes only one attribute per product, or at least the image attribute is the first in line of the rest. I know there are probably easier/cleaner ways to do it, but this fit my needs. Hopefully this can give you a good starting point...
Comment #30
fonant CreditAttribution: fonant commentedCan't get the module from #16 to work, sadly. It looks just like what I need!
As norbert.broadsword found, uploading images and making changes to the image display options for individual products has no effect: I can upload an image, but on saving the product it disappears again. Product > Edit > Options page, in the "Option Images" section.
I've managed to upload a default image for the attribute option, but that doesn't display either. At least uploaded image and display settings are kept OK here. Store > Products > Attributes > Options
For the image to be swapped when a different option is chosen, I'm guessing that the uc_option_image.js file has to be included, but this isn't on my site. Nor do the images appear beside the options if I choose radio buttons.
Perhaps the lack of ability of setting the display options for the Product means that "Display an image inline next to each option title." and "Display an image showing the selected option(s)." are never checked?
Comment #31
fonant CreditAttribution: fonant commentedOK, more research shows that the per-product images, and the display settings, are in fact stored in the database uc_option_image table OK.
So the problem is more that the per-product form doesn't update to show the databased details. So if you save the product options again, all the uploaded images and display settings are removed: you have to upload all the images and set the display settings again before clicking "Submit" on the product "Edit" > "Options" form.
Comment #32
Jawi CreditAttribution: Jawi commentedNice work!
I'm using the module on my clients site
When adding new attribute options and upload an image for this option at the same time (/admin/store/products/attributes/5/options/add) I'm getting this error:
The error does not occur when creating the attribute options first without the images and adding the images later on.
Any idea how I can fix this? (I'm not a coder..)
Is there a way to easily display both "attribute_options_selected_images" when displaying 2 different attributes on the product page?
Thanks for all support(Y)
Comment #33
Buckminster_Bond CreditAttribution: Buckminster_Bond commentedJust like to report the same behaviour as #31 when using the module shared by aacraig in #16 - all works fantastically well at the attribute level.
However, if the requirement is for different attribute images to display for each product then the first time that the product is saved, it still works perfectly.
Unfortunately, if the product is then updated in anyway - for example the stock is adjusted, then all the option images all disappear.
Comment #34
aacraig CreditAttribution: aacraig commentedI've just been made a maintainer for the module, so I will have the official D7 release up this week, and I will incorporate a fix for the above issues in that release.
Comment #35
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks for your work on this aacraig - any progress on an official D7 release?
I have another issue to report when uploading option images under Store > Products > Attributes, it throws an "The website encountered an unexpected error." message. The option is created, but the image isn't uploaded. Looking at the logs I can see the following:
Warning: Parameter 1 to upload_replace_file_update() expected to be a reference, value given in module_invoke_all() (line 819 of /home/dannysau/public_html/includes/module.inc).
Also...
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'id' cannot be null: INSERT INTO {file_usage} (fid, module, type, id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 356 [:db_insert_placeholder_1] => uc_option_image [:db_insert_placeholder_2] => uc_option [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 1 ) in file_usage_add() (line 664 of /home/dannysau/public_html/includes/file.inc).
However, when I edit that option and upload an image again everything works fine.
Comment #36
fonant CreditAttribution: fonant commentedJust to note that I'm working on fixing bugs in my copy of this, as posted in #16. Shout if I'm duplicating effort!
Comment #37
aacraig CreditAttribution: aacraig commentedIn a sense, yes. I have a 90% ready update which I plan to release in the next few days.
I suggest you contact me privately (info@aaroncraig.com) so we can diff / merge our work and then I'll release a complete version.
Comment #38
venecian CreditAttribution: venecian commentedmany mistakes, nothing displayed, without images, only checkbox I see in output. Why dont see upload images?
Comment #39
aacraig CreditAttribution: aacraig commentedI have committed a working version. Please try the 7.x dev release.
Comment #40
Anonymous (not verified) CreditAttribution: Anonymous commentedHmm, I don't see any 7.x dev release on the main page.
Edit: oh, it's in the 'other releases' section. Sorry.
Comment #41
liberatrafestein,
A new release has been generated from aacraig's commit a few weeks back, and I just published it.
Please look at http://drupal.org/node/241492/release
Comment #42
Poieo CreditAttribution: Poieo commentedThere is a dpm left in the uc_option_image.theme.inc file on line 12.
Comment #43
Jawi CreditAttribution: Jawi commentedAacraig, thanks for the work on the betaversion!
Same issue here.
Fatal error: Call to undefined function dpm() in /home/idc/domains/domains.com/public_html/sites/all/modules/uc_option_image/uc_option_image.theme.inc on line 12
I'll try to fix this
Comment #44
Jawi CreditAttribution: Jawi commentedUpdating from #16 uc_option_image.tar_.gz delivered the following error:
Fatal error: Call to undefined function dpm() in /home/idc/domains/domain.com/public_html/sites/all/modules/uc_option_image/uc_option_image.theme.inc on line 12
Comment #45
liberatrThe call to dpm is commented out in beta2:
http://drupal.org/node/1703020
If you have Devel module installed it won't cause an error.
Comment #46
Jawi CreditAttribution: Jawi commentedGreet work!!
Beta 2 version works for me with the devel-module on!!
Also the issues under #32
are solved (NICE JOB!)
Still some strange things happen:
Comment #47
aacraig CreditAttribution: aacraig commentedHello all, and sorry for the absence. In the meantime I've been hired as the CTO of a startup, so I've moved to Dublin and have been swamped getting everything set up.
In all honesty, I don't believe I'll be able to get back to this before the end of the month, so if someone wants to jump in, that would be greatly appreciated. Otherwise I'll be able to spend some time on this towards the end of August.
Comment #48
Jawi CreditAttribution: Jawi commentedThe javascript on the product page / node page seems to be ok.
Theire are some issues with the javascript in the catalog view.
We are trying to sove this by adjusting the javascript.
Indeed all help would be welcome
Comment #49
xacto CreditAttribution: xacto commented1st thank you aacraig for the effort on this port to 7. Congrats on your trip and new job!! hope all is well.
I am porting a Ubercart 6 site to 7. I cannot seem to get the image file system working.
Will not upload, or files will not save on "submit".
It seems some of you have a working version or patch.
Is there any new information or patches that fixe this upload image issue in the individual product attribute options page.
Trying to go through the code but haven't found the issue yet.
Thanks all for any help or information.
Comment #50
Jawi CreditAttribution: Jawi commentedI will help you on skype!
Comment #51
marcom2021 CreditAttribution: marcom2021 commentedIn the latest dev version of Ubercart there is an option to auto update the product price based on the selected attributes. (http://drupal.org/node/1380772#comment-6367078)
When this setting is enabled the option images dissapear as soon as an option is selected.
Any way to solve this?
Comment #52
Jawi CreditAttribution: Jawi commentedYou should adjust the javascript
Comment #53
xacto CreditAttribution: xacto commentedWell, being a drupal community, Any patches or commits made to the public module would be very helpful to many I assume. :-)
After playing with some of the javascript, I have noticed better integration with views displays would be helpful.
Creating a views "product node" "image field" using ajax for the image swap, could be very helpful, since most of us use views for our product displays.
Again, any patches or commits could help continue the public development of this module.
Thanks again.
Comment #54
Summit CreditAttribution: Summit commentedHi, How about the commerce port, is this still relevant? Would love to see this happening
greetings, Martijn
Comment #55
liberatrActually, there is no reason to port this module to Drupal Commerce, their system for attaching multiple product entities to a Product Display takes care of our functionality, as long as you upload a picture with each Product.
Comment #56
djob CreditAttribution: djob commentedHello
I have just installed the latest release 7.x-1.0-beta2 to Drupal core 7.15/Ubercart 7.x-3.2 and it work very well. Does exactly what I expected. Excellent, thank you.
Regards
Comment #57
jday CreditAttribution: jday commentedI'm having the same problems as #51
I've selected the 'display inline' option so every option image is displayed next to the label/input but once you make a selection, all option images disappear. I've removed the entire javascript file but that has not helped.
Comment #58
liberatrThe bug from #51 and #57 is fixed in the 7.x-1.x-beta3 release.