Hello,
I have created an initial port of this module with the help of the Coder module, plus some follow-up code cleanup pertaining to database queries and Javascript compatibility with D7.
Attached is a tarball of the initial port. Looking for some people to help test this and continue debugging. I have not tested thoroughly, although I have had functionality on the pages I've looked at so far.
There's a weird issue with the highlightFade jQuery plugin highlighting all the donation rows at once on the donate page (path /donate). I will keep working on it, just wanted to get this up initially so others can benefit from it and help make it better.
Can the maintainer create a 7.x branch?
Thanks,
Noah Lively
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | uc_donation.tar_.gz | 15.08 KB | aditya.mukhopadhyay |
| #7 | uc_donation_7x_2x.tar_.gz | 16.28 KB | noahlively |
| #5 | uc_donation_7x_2x.tar_.gz | 16.24 KB | noahlively |
| #1 | uc_donation_7x_2x.tar_.gz | 16.11 KB | noahlively |
| uc_donation_7x_initial_port.tar_.gz | 15.92 KB | noahlively |
Comments
Comment #1
noahlively commentedHere is a working version of the uc_donation module for Drupal 7.
I have been tweaking it since my last post 8 days ago, and I have a functional implementation with no crash errors at https://www.familycc.org/online-giving.
I have ported key API changes from ubercart 7.x-3.x, including renaming all the ubercart hooks from hook_X to hook_uc_X.
Other key changes include porting of the JS files to compatiblity with D7's JS api and rewriting the implementation of hook_load().
If we can get this into the git tree, it will be easier to track changes.
Comment #2
justaname commentedIf I click "Manage Donate Products"
Warning: Missing argument 1 for uc_donate_load(), called in sites/all/modules/uc_donation/uc_donate/uc_donate.admin.inc on line 45 and defined in uc_donate_load() (line 276 of sites/all/modules/uc_donation/uc_donate/uc_donate.module).
If I click "Add Donation"
PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined: SELECT n.nid FROM {node} AS n WHERE n.type = :n.type AND n.nid NOT IN (SELECT d.nid FROM {uc_donate} AS d); Array ( [:n.type] => donation ) in uc_donate_donation() (line 129 of sites/all/modules/uc_donation/uc_donate/uc_donate.admin.inc).
If I click "Add Group"
Notice: Undefined index: donate_id in uc_donate_group_form() (line 195 of sites/all/modules/uc_donation/uc_donate/uc_donate.admin.inc).
Comment #3
vivefree commentedHas any one got this working? I'm having the exact same problems as 'justaname'.
Comment #4
coolestdude1 commentedBump I would also like a D7 port can we get an update?
Comment #5
noahlively commentedGive this a try... I have addressed the 3 issues mentioned in the last bug report.
Comment #6
sksmithson commentedInstalled tarball re #5 and get following errors when I try to create a donation product on a clean D7 install...
Notice: Undefined property: stdClass::$nid in uc_donation_forms() (line 162 of /home/smithson/abaseentest/sites/all/modules/ubercart/uc_donation/uc_donation.module).
Notice: Undefined property: stdClass::$nid in uc_donation_forms() (line 163 of /home/smithson/abaseentest/sites/all/modules/ubercart/uc_donation/uc_donation.module).
Warning: Missing argument 2 for uc_product_form(), called in /home/smithson/abaseentest/sites/all/modules/ubercart/uc_donation/uc_donation.module on line 173 and defined in uc_product_form() (line 396 of /home/smithson/abaseentest/sites/all/modules/ubercart/uc_product/uc_product.module).
Hoping to get our charity site upgraded from D6 to 7.
Comment #7
noahlively commentedTry this...
Comment #8
ptnguyen commentedWhen I tried to create a product group, I got this
Fatal error: [] operator not supported for strings in /home4/foutomor/public_html/includes/theme.inc on line 1730
and when I tried to add a donation product, I got this
Fatal error: Call to undefined function db_fetch_object() in /home4/foutomor/public_html/sites/all/modules/uc_donation/uc_donate/uc_donate.admin.inc on line 131
Comment #9
jeffreymb commentedI fixed an issue with #7.
Line 105 of uc_donation.module should be changed to:
$node = $form['node']['#value'];
Comment #10
alauzon commentedI'va had the exact same problem as ptnguyen in post #8. And now that I've tried to add a donate product group and a donate product when I try to go into "Mange Donate Products" I get this:
Warning : array_merge() [function.array-merge]: Argument #1 is not an array dans _form_set_class() (ligne 3968 dans /home/.../public_html/includes/form.inc).
Warning : array_merge() [function.array-merge]: Argument #1 is not an array dans _form_set_class() (ligne 3968 dans /home/.../public_html/includes/form.inc).
Warning : array_merge() [function.array-merge]: Argument #1 is not an array dans _form_set_class() (ligne 3968 dans /home/.../public_html/includes/form.inc).
Warning : array_merge() [function.array-merge]: Argument #1 is not an array dans _form_set_class() (ligne 3968 dans /home/.../public_html/includes/form.inc).
It repeats the same message 4 times.
Comment #11
zealny commentedi am getting error as
Warning: Parameter 2 to uc_donation_uc_cart_item() expected to be a reference, value given in module_invoke_all() (line 819 of /var/www/drupal-7.2/includes/module.inc).
Warning: Parameter 2 to uc_donation_uc_cart_item() expected to be a reference, value given in module_invoke_all() (line 819 of /var/www/drupal-7.2/includes/module.inc).
Deprecated function: Function ereg_replace() is deprecated in uc_donation_cart_view_validate() (line 261 of /var/www/drupal-7.2/sites/abc/modules/uc_donation/uc_donation.module).
I am using drupal 7.2
Comment #12
aditya.mukhopadhyay commentedHere's a (hopefully) complete port. Please try...
Comment #13
linkingarts commentedDrupal 7.7 errs:
happens On Add to Cart...
Comment #14
Buckminster_Bond commentedPort #12, same as errors as #13 - D7.7
Comment #15
brant commentedsubscribe
Comment #16
vgriffin commentedsubscribe
Comment #17
IKE0088 commentedSubscribe
Comment #18
Feet commentedSubscribe
Comment #19
earlenehughes commentedHas anyone been able to get uc_donation and uc_donate working? I have tried the uploaded modules that have been posted here, and cannot get uc_donation to work for me.
Comment #20
dazrour commentedUsing the version posted in #12 i can add products to the cart from the /donate page.
However when trying to add them from the /catalog page I get the following errors and the page just reloads.
I will look into fixing this myself but it will probably be trial and error as I am fairly new to ubercar/drupal.
Great work in getting the port out.
Comment #21
grayb commentedI've been working on this port. I took what was in #12, fixed the bugs reported in this thread since, in addition to a handful I found myself.
Source is public here: https://github.com/IMAmuseum/uc_donation_7x_2x
Comment #22
tscadfx commentedGrayb and everyone else thanks for working on porting this.
One issue that I've noticed is that the value of the donation never makes it to the cart or the top of the checkout page. It does however show up the the total in the UC checkout towards the bottom. Not having the value show in the cart or at the top of the page can make check out very confusing.
I'll look into it myself and see if I can't provide a patch if someone doesn't beat me to it.
Comment #23
julia_g commentedgrayb - when trying to edit the donation product, I get this:
Fatal error: Call to undefined function uc_product_validate() in .../sites/all/modules/uc_donation/uc_donation.module on line 187 . Looks like uc_product_validate in not in D7 any more, but I don't know what should be used instead.
Comment #24
davidsheart02 commentedSubscribing
Comment #25
ZuluWarrior commentedBump,
I'm going to need a donation based module for a production site in the next 2 months, so would be greatful for any progress on this.
Of course I will grab the latest branch for this and test for you. If I can help fix things (i've hacked through Ubercart module code a ferw times before in D6 times lol) on this port I will, but are the maintainers of this branch still active on this port?
Comment #26
Anonymous (not verified) commentedThanks for your work on this guys. I can confirm the error mentioned in #23 in Ubercart 3.0, this seems to render the module unusable as we can't add donation products.
Any chance we could get this looked at please?
Comment #27
Anonymous (not verified) commentedQuick update for those looking for a workaround for the issue above. By commenting out line 182 of the uc_donation.module file we can successfully create donation products:
$form['#validate'][] = 'uc_donation_form_validate';For now this means I am circumventing any form validation, but for my purpose (there's only one 'donation' product which I'll be creating) it works just fine.
Comment #28
Anonymous (not verified) commentedUh oh, I just upgraded to Ubercart 3.1 and it's broken the donation module. There are no errors or anything, the product just gets added to the cart at $0 no matter what you put in the price field.
Has anyone got any insight as to what might have changed here?
Comment #29
Anonymous (not verified) commentedOK so after a couple of hours of painful digging, I've discovered that in recent versions of Ubercart they have removed hook_uc_cart_item() which is being used in our uc_donation.module. It has been replaced with the UcCartItemController controller in /ubercart/uc_cart/uc_cart.controller.inc.
My solution was to override this in my template.php. For me this is a quick fix and obviously some work needs to be done to update the actual Donation module. My code for template.php is as follows:
Comment #30
a.knutson commentedDoes anyone have any plans to port this to D7 UC3? I'm compiling a list of Ubercart related modules and trying to get an idea of what still needs to get ported over.
Thanks in advance!!
Comment #31
RaRi commentedsubscribe ..
Comment #32
RaRi commentedAny new branch available?
Comment #33
rooby commented@RaRi:
You can subscribe using the "Follow" button at the top without commenting.
Comment #34
iwant2fly commentedI am willing to chip in a little bit to make this happen for D7 UC3.
Comment #35
Barry Tielkes commentedThis module works fine so far:
http://drupal.org/project/uc_varprice
Comment #36
boon4376 commentedI'd like to confirm that UC_Varprice http://drupal.org/project/uc_varprice has worked for me on a test run with Authorize.net developer account on Drupal 7 with Ubercart 7.x - 3.3, as well as with UC_Recurring using authorize.net CIM.
Looks like a good replacement for the donations module.
Comment #37
Anonymous (not verified) commentedBased on the amount of activity over 2013, this project seems dead. Perhaps it's time to retire this project and devote efforts to https://drupal.org/project/uc_varprice ? That project appears to be slightly better supported and more frequently used.