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.
I've started converting this module to 6.x. I'm posting the patch here as greggles requested.
So far:
- Revamped .install with new Schema API
- Able to make products unique or not
- Ran module against Deadwood, Coder and Schema modules.
- Modules runs with no errors
TODO:
- convert Views 1 to Views 2
- add 6.x-1.x-dev to CVS
Bear in mind this is my first module i have converted from 5 to 6. I have no clue where to start with converting Views 1 to Views 2, as there is some serious lacking of help/documentation. I've also left all the comments from Coder and Deadwood modules for now.
iStryker
Comment | File | Size | Author |
---|---|---|---|
#10 | 489618_uc_alternate_price_6.x-dev.patch | 37.47 KB | himerus |
#4 | dev5to6_stable_uc_alternative_price1.patch | 37.69 KB | iStryker |
#4 | dev6x_stable_uc_alternative_price1.patch | 25.32 KB | iStryker |
#2 | dev6_uc_alternative_price2.patch | 37.63 KB | iStryker |
dev6_uc_alternate_price.patch | 28.37 KB | iStryker |
Comments
Comment #1
gregglesThanks for the work, iStryker!
Is this a new feature? I'd really like to keep this issue about upgrading the module. We can add new features in other issues (the benefit of doing that is they are easier to backport to 5.x).
When you say "Modules runs with no errors" do you mean that this module works in your testing aside from the views integration? That would be great!
Comment #2
iStryker CreditAttribution: iStryker commentedNo I wasn't referring to a new feature. I was referring to getting the unique checkbox to work on the node form and updating the database.
Yes, aside from the views intergration.
Here is the next patch. I've figure out how to integrate the module with views. I cannot figure out the views handlers though. I've used the uc_product module as reference when creating this next patch.
Cheers,
iStryker
Comment #3
gregglesThis is wonderful! Thanks so much for your work and detailed responses here. I can't say exactly when I will be able to test/review the code - in the next few months for sure.
If you think it would be a good idea, I could commit it and create a release and leave a note on the project page that it is experimental. That is the best way to get testers, really.
Comment #4
iStryker CreditAttribution: iStryker commentedI've found a problem with the database with the uc_alternative_price table, which is now fix.
The views now work and this module is ready for testing
Attached is 2 patches
one from on 5.x dev
one from on 6.x dev (released June 12th by greggles)
iStryker
Comment #5
gregglesMost of this applies fine, except this:
I tried both patches and got the same message.
Comment #6
jamesialford CreditAttribution: jamesialford commentedI think I am doing something wrong. I downloaded this today. I am trying to get this to work with Drupal 6 and Ubercart 2. I keep getting this error as soon as I install the module.
Missing argument 1 for uc_alternative_price_menu() in /home/content/......./modules/uc_alternative_price/uc_alternative_price.module on line 84.
I see you have some patches. Are they included in the latest module? If not how do I install them?
James
Comment #7
dantahoua CreditAttribution: dantahoua commentedI have the same error with Drupal 6 and Ubercart 2... This module seems to not working at all... Sorry I am...
Comment #8
himerus CreditAttribution: himerus commentedWhat is the current status of this?
I just took a quick glance over the code, and see things like $may_cache in the hook_menu which would be throwing some errors.
I have been working on a personal project that requires this module now, and have been trying to get time to do this project for over a year, and this module is just above the status when I first looked around.
I'll be digging into this module this week, and perfecting the process. I'll check issues, and post patches for a smoother upgrade here, and start some new issues as needed for additional bug fixes after it is definitely working with 6.x.
@Greggles, do you have a summary of which of these patches has/has not been applied to the 6.x-dev branch?
Comment #9
greggles@himerus - you can see from http://drupal.org/project/cvs/389682 that none of these patches has been applied. I think the patch from #5 needs to be re-rolled and tested. If you can re-roll it I'll happily apply.
Comment #10
himerus CreditAttribution: himerus commentedOkay, the following patch combines the two from #5.
It also addresses an issue with hook_uninstall() that was throwing errors removing the 'unique' field from the uc_products table. There was nothing wrong with the query, however, for some reason, it didn't not like using the name unique, so it has been renamed to unique_price, and references to that field have been changed to reflect that.
The module now enables, disables & will uninstall properly. (seems that way)
This is still definitely what I would call "experimental". The views integration seems to work. (at least pulling out the alternative price for display)
There is an issue with one part I will address later, which relates to it throws an error (rightfully so) when you try to add the "standard" product to your cart after the "buyout" product is in the cart. This is good, but it allows you to add the "unique" or "buyout" price to the cart multiple times without error.
I feel that is a bug. thoughts? or is/was this an intended functionality. My use case is for removing products after unique price is purchased. I guess there could be a use case for this that would allow multiple purchases of the alternative price. Mine is digital, so silly to buy more than once.
If anyone can test this patch out, it was taken directly from the 6.x-dev version available, and now applies cleanly. There is still a lot of code cleanup that will need to happen, I'll have to investigate further some of the functions that have been commented out, and see if they can be fully removed, or need to be fixed, and used.
Comment #11
gregglesAwesome, Jake - thanks for this work!
Yes, I think that's the standard use case which we should default to doing, but I'm open to ideas.
I think we should leave that bug for a separate issue where it can be discussed on its own. I'd also like to leave code cleanup to separate issues so we can see about backporting it.
Comment #12
dallasclark CreditAttribution: dallasclark commentedI received the following output when trying to patch the module
patching file uc_alternative_price.install
patching file uc_alternative_price.module
patching file uc_alternative_price.info
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file uc_alternative_price.info.rej
patching file uc_alternative_price_handler_filter_alternative_price.inc
patching file uc_alternative_price.views.inc
patching file uc_alternative_price_handler_field_alternative_price.inc
Comment #13
gbernier CreditAttribution: gbernier commentedWhat's the status on getting this module to work? Has it been abandon? Tried to apply the patch posted above with no success. If anyone got this thing working let me know as the description describes exactly the functionality I'm need for a current project.
Comment #14
iStryker CreditAttribution: iStryker commentedFor the most part this module has been abandon. I convert this module to 6 to work with my site. The original maintainer, greggles, have moved on to different module(s) to solve the problem for the new site.
Comment #15
gregglesI'm happy to give the module to someone else if they file an issue here to take it over (and have shown ability to make patches) I'll help guide the issue through to transferring the module.
Comment #16
gbernier CreditAttribution: gbernier commentediStryker, do you have a working version of this module then? If so would you be willing to share it?
Comment #17
kurth CreditAttribution: kurth commentedbump for sharing
:]
Comment #18
iStryker CreditAttribution: iStryker commentedI've copy the module from www.themes247.com. Its been awhile. I don't know if I alter it afterwards. You can download a copy at https://github.com/iStryker/uc_alternative_price