Hello
I working on upgrade Ubercart's order administration fort for using AHAH.
Here's an initial patch wich affects all of the product pane functionality.
Still needs work — line items, user info, billing info, shipping, but I can handle those since I've already completed a challenging part.
Didn't tested it with disabled JS, but, it should work anyway.
Any feedback will be gladly appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | admin_order_ahah.patch | 34.78 KB | Island Usurper |
| #19 | ubercart_ahah_v1.4.patch | 36.94 KB | neochief |
| #17 | ubercart_ahah_v1.3.patch | 36.88 KB | neochief |
| #14 | ubercart_patched.zip | 39.5 KB | neochief |
| #14 | ubercart_ahah-v1.2.patch | 35.73 KB | neochief |
Comments
Comment #1
neochief commentedYou can test it live by editing one of the order here (it's a sandbox, you're free to make everything you want):
http://drupaldance.com/projects/ubahah/admin/store/orders
(You may also add some orders, there are prefilled payment data)
Comment #2
rszrama commentedComment #3
Macronomicus commentedThe order edit screen on your sandbox is empty ... also cannot create order @ /admin/store/orders/create the user-lookup and add new user appear to be broken. Still havnt tried it on my server.
Just a question though ... doesnt the order screen already have AHAH or AJAX or sompin? Whats the diff in your implementation?
Comment #4
cha0s commentedAre you rolling your patch against the latest bzr? Your patch did not apply cleanly. It'd be super awesome if you could reroll it... =)
Comment #5
neochief commented@macrocosm, I meant adding orders by adding products to the cart and checkout, product are on the main page. But, actually, at this time there are 2 orders there, you can test editing on them. As for the difference — curently Ubercart using exactly "sompin ajax". It's not correct way of doing things since Drupal6, we have no security, validation and flexibility with current implementation.
@cha0s, bzr? I'm already using cvs and svn on the project, do I need a bzr either? :) or I can patch against the HEAD from cvs?
Comment #6
cha0s commentedAh, I see. I don't maintain a CVS branch of Ubercart, but I guess I probably should...
bzr stands for Bazaar, the revision control we use for development... Let's see if I can apply this patch to CVS and reroll it for the latest bzr... we shall see!
P.s. Just by eye review, I see you have a couple $form_state['rebuid'], which I assume should be 'rebuild' =)
Comment #7
cha0s commentedWell, I pulled CVS HEAD (Don't do that, apparently ;)) and -r DRUPAL-6--2, but none of them would apply the patch cleanly. What CVS tag/branch did you roll off of..?
Comment #8
neochief commentedWell, I didn't said that patch is applying to current HEAD ;) I think It can be applied to beta3 currently. But I'll reroll it in next few hours.
Comment #9
rszrama commentedYeah, HEAD for Ubercart is kinda screwy... do it against the DRUPAL-6--2 branch if you do it from CVS, although doing it from the latest Bzr is really best.
Comment #10
neochief commentedHere's a patch against a D6-2 branch ('rebuid' fix included). Hope nobody commited anything at this hour :) Damn, I hate to make big changes in code.
Comment #11
Macronomicus commented@ neochief ... the edit screen is blank (in your sandbox).
When clicking edit on one of your existing orders the tab is selected but there is no form underneath it.
Firebug shows nothing on the page but main page structure.
EDIT: Nevermind there was something wrong with my browser ... for some reason your website and @ ubercart.com no forms would render! Strange.. anyhoo restarting the browser fixed it for me.
Comment #12
cha0s commentedAwesome, I got it to apply. It'll be a little bit before I can do a proper review/testing on it, though I gave it a lookover...
Comment #13
neochief commentedSame patch with minor changes. I will add line items handling closer to week ends.
Comment #14
neochief commentedPard me, missed uc_attributes in patch.
Also, attaching an archive with patched files just in case.
Comment #15
Island Usurper commentedI hate to break it to you, but the patch no longer applies to DRUPAL-6--2. There were changes made to uc_order.js (and elsewhere) to allow products with attributes to be added to orders correctly. When I tried to work around this and apply the patch, no products were listed on the order-edit page. I didn't see if the buttons actually worked, so you might not have to make too many changes.
Comment #16
neochief commentedAh, too bad. I'll try to figure it up.
Comment #17
neochief commentedRerolled patch against DRUPAL-6--2.
Please, test it and commit to CVS, so I can proceed on development, bacause it's really hard to reroll such a big patch every time something changes in D6--2.
Comment #18
rszrama commentedPatch applied cleanly and is on the Livetest apparently working fine. I'm not entirely sure what all I should be testing for this, though. Any chance we can get a comprehensive list of features to test to make sure it's all working fine in our sites?
I did some brief code review and saw at least one thing that I'd ask for a fix even though 'twas a copied line of code... there's at least one instance of using double quotes with an embedded variable that I'd like to have turned into a concatenated single quote string... it's in one of the form elements:
The recommended change is
'#name' => 'products['. $name .'][remove]',.Comment #19
neochief commentedYes, sure, here's a list of things to test.
You should be able to:
1. Add product to Order (note, the new Qty. field validation that didn't exists before).
2. Search for products in product adding sub-form.
2. Add blank line to order items.
3. Remove single order item.
Here's the patch update with your recomendation included. By the way, all changes was passed Coder review.
Comment #20
Island Usurper commentedHere's a reroll against the tip of the Bazaar repository. I really do recommend getting Bazaar and getting updates from our repository. It only took me a few minutes to make a new branch based off the way Ubercart was back in March, apply your patch, and merge those changes in to the latest code. There were only two conflicts in uc_order.admin.inc, and I knew how to take care of them since I had studied what your patch was doing.
This should help us work together on this since I can keep committing bug fixes, and you don't have to work nearly so hard to keep up with them. If you want, I can post up some detailed instructions and maybe even set up repositories for us to swap merges back and forth.
I'm marking it as needs work because the line items, particularly subtotal and total, aren't updated when I click "Save changes" after adding products. The new products are actually saved, because they still appear on the view tab, even without clicking "Save changes", which is how it worked before.
Comment #21
neochief commentedThanks for your feedback, Lyle. Tomorrow I'll start over on this issue, because before I stuck with Drupal's AHAH limitation which prevents updation of several things on the page. But it seems that I found a right way to solve it, which will help on fixing the issue with line items.
As for the saving, yes, it's another big deal, which I think should be fixed too. At this time, if you're changing anything in order, it will save even without pressing "Save changes" with AHAH or without it. My aim is to prevent any real saving before user press "Save changes". But it's really challenging task, as it requires a lot of changes under the hood of this form.
Comment #22
Island Usurper commentedIt's kind of late to put a lot of changes under the hood into the 2.0 release. I think for 3.x, we'll have better tools (Chaos tools, no less ;) ) for AHAH and such, so we should definitely start using them then.
Comment #23
neochief commentedTrue.
Comment #24
longwaveThis has all been AJAXified in D7 already and is too big a change to backport to D6 now.