The form for the Credit Card Payment Method on checkout page is truncated. This form is displayed after an AJAX call to the "cart/checkout/payment_method/credit" URL.
I found out that a function that is supposed to strip out the HTML Form Tags from the Credit Card form was not working properly.
The regular expression that is supposed to remove only the Form Tags from the Credit Card form was also removing part of the Table Tags.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | ubercart-fix_removal_of_form_tags_2332963-9124283.patch | 565 bytes | drupalfever |
Comments
Comment #1
drupalfever commentedFollowing is an example where I put the HTML that was being generated by Ubercart in the $data variable. I, then, call the faulty "uc_strip_form()" function and do a "dsm" with the result.
If you run the above exemple in a Drupal 6 website with Ubercart 2 enabled, you will find out that the Regular Expression will remove the Form Tags but it will also remove some of the Table Tags from the beginning of the example HTML code.
Comment #2
drupalfever commentedTo fix the problem, I needed to alter the Regular Expression slightly.
It was originally like this:
After I changed it to the following, everything worked fine:
Comment #3
drupalfever commentedI created this patch to fix the problem but it needs review.
Comment #4
drupalfever commentedComment #5
tr commentedComment #7
drupalfever commentedThanks, TR!
Comment #8
drupalfever commentedYou should copy the patch to the Ubercart Module folder and execute the following command:
I did exactly that and it works.
You need to do that on Ubercart version 6.x-2.13.
Comment #9
drupalfever commentedComment #10
drupalfever commentedI am sorry. I chose the wrong version of Ubercart when reporting the bug. I just updated my bug report with the right version.
Comment #11
drupalfever commentedHi, TR!
I just noticed that you changed my bug report to the wrong version. It was originally correct.
Again, the patch needs to be applied to version 6.x-2.13 in order to work.
Comment #12
drupalfever commentedShould I install the devel version of Ubercart and create the patch for that version in order for it to be tested?
I am sorry, I'm new to this...
Comment #13
longwavePatches are always applied against -dev, and need to be in git format with the a/ and b/ prefixes on the filenames.
Do we need to change the end of the second regex at the same time?
Comment #14
tr commented@drupalfever: In Drupal, patches always need to be made against the tip of the branch, which in this case is -dev. It doesn't really affect your patch, since that code has not changed in a long time so the patch won't be any different. The reason your patch didn't apply is because it was in -p0 format, rather than -p1 format as required by the testbot.
Comment #15
drupalfever commentedThanks, guys.
It was a little stupid of me. It makes obvious sense that the patches have to be made against the Devel version of the module as opposed to a version that is already out.
TR, I will download the devel version of Ubercart and generate the new patch in the right -p1 format.
longwave, I don't think that the second Regular Expression needs to be altered.
I want to do this myself because I want to learn how to do it.
Bear with me, guys!
As I said, I am new at submitting Bug Reports...
Thanks for the help.
Comment #16
drupalfever commentedHi, longwave! On second thought, I think you are right.
I think that we should make the same changes on the second Regula Expression as well.
I already tested the function with both Regular Expressions updated and everything seems to be working fine.
Comment #17
longwave@drupalfever: Do you want to post an updated patch with both regular expressions updated?
Comment #18
drupalfever commentedYes longwave, I will.
I was planing to do it this weeked but things got a little hactic for me on the last few days. I will do the new patch as soon as I get home today...
Promisse!
Comment #19
drupalfever commentedHere is the new patch. Hopefully, everything is fine.
Please, check it out and test it.
Comment #20
longwaveComment #21
drupalfever commentedIs that it?
Comment #22
longwaveManually tested with your example HTML and some others I tried, works for me. Committed to 6.x-2.x, thanks for the report and patch!
Comment #24
drupalfever commentedThank YOU!
I feel awesome for having helped. :)
I know that Ubercart 2 is a dying version that still runs on a Drupal 6 version which is also about to be dropped in regards to support.
However, this is what I am still using at work.
My wish is that I'll be able to contribute in the future to more up to date versions of Drupal and Ubercart.
Thanks for all your help and patience longwave.
Best regards.