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.
It would be good to be able to navigate to the submission from the order itself, and to navigate to the order from the webform submission. Obviously the latter is only possible after the order's created.
Comments
Comment #1
warpedrive CreditAttribution: warpedrive commentedAgreed - This would be very useful from my user's perspective.
Comment #2
AaronBauman+1
my users really need some way to see which submissions correspond to which orders, preferably by uc order id.
Comment #3
AaronBaumanHere's a patch:
I have purposely left out a script that populates the join table from existing orders, because for sites with a great number of orders this could be inefficient and cause the update script to timeout or memory out or fail otherwise. If people are interested in this, i'd suggest a drush script or similar that populates the data. (I'll be writing one of these for my own use case that i will post.)
To dos:
Comment #4
AndyF CreditAttribution: AndyF commented@aaronbauman Thanks for getting the ball rolling on this!
I've modified the update to use the batch API (and some other small changes, including rerolling against latest). I think that's nicer than supplying a drush script. I wasn't sure what would be the best batch size though: I've opted for 25 rather arbitrarily.
Any specific ideas on how you'd do this?
Thanks again,
Comment #5
AndyF CreditAttribution: AndyF commentedOops, the line reading:
should be:
Comment #6
AndyF CreditAttribution: AndyF commentedI've just taken a quick look at the Ubercart side of things, and think the best way to add the link will be via
hook_product_description()
. This means that the link will be visible on the cart and checkout pages (for those with the right permission), which seems fine to me. The only alternative I can see would be by using the table API which is uglier imho.Comment #7
AndyF CreditAttribution: AndyF commentedHere's a patch which shows links via hook_product_description(). Haven't added the return link from Webform to order yet though.
Comment #8
AaronBaumanThanks for the patch.
However, for me i need this for reporting, so just sticking an anchor in the product description is not sufficient.
I need the uc order id exposed to webform views or in the default webform reports,
and i need the submission id exposed to uc views or in the default ubercart reports.
Comment #9
AndyF CreditAttribution: AndyF commentedAnd yet that's precisely what this issue description asks for! (Note that I also need to add a corresponding link from the webform to the order.)
Regarding Views integration see #1301998: Create Views relationship linking order to webform submitted data which is dependent on #680386: Views integration for the webform_submitted_data table. Regarding modifying the default ubercart/webform reports, could you start a new issue and put in some detail about exactly what you'd like to see where?
Also attaching #7 with fix from #5.
Thanks
Comment #10
AndyF CreditAttribution: AndyF commentedAdded the link on the submission screen. Would welcome testing and feedback. Note I've removed the indexes from {uc_event_registration_submissions}.
Thanks
Comment #12
warpedrive CreditAttribution: warpedrive commented... So the issue was:
The users need to see the actual order from the webform results list. Has this been accomplished? I really don't care as much about listing the submission from order.. The users don't care about that. They want to see if someoneone who registered fro an event checked out and paid.. !
does the patch actually accomplish that?
Comment #13
AndyF CreditAttribution: AndyF commentedIIUC yes! On the webform submission screen (node/%/submission/%) there's a link View containing order (and on admin/store/orders/% there's a View submitted form data link for each paidevent). Btw the patch is committed to the latest dev.
Comment #14
4kant CreditAttribution: 4kant commented@AndyF:
I see the link "View containing order" on the webform´s submission page. I can click it and go to admin/store/orders/%.
But here I cannot see the link "View submitted form data".
Where should it be?
(Have the latest dev)
Thanks!
Comment #15
warpedrive CreditAttribution: warpedrive commentedThe idea was: Instead of just paid / unpaid status (not actual order status, btw, confusing) on the webform results.. there was supposed to be a link from the webform result tab line item.. to the order.. or at the least, the order id so you could track down the order..
Uh - so there still isn't a link from webform results to the actual order, correct? How is this then fixed / closed?
Comment #16
4kant CreditAttribution: 4kant commented@warpedrive: in case you´re answering my comment: the link from the webform result to the order is OK but not "vice versa". That is the link from the order to the webform result. It´s simply not there.
Comment #17
AndyF CreditAttribution: AndyF commented@4kant Thanks for reporting the issue, but I can't reproduce it myself. The link should appear in the Product column at the end of the description (and after any attributes). Could you ensure you've cleared caches and tried as user #1? If you still have problems, can you let me know if the issue's just with old orders or with new ones as well? I should mention that I have some largeish changes to push, including some modifications to updates 6103 and 6104, so please be careful with your database/site!
@warpedrive Do you mind seeing if you can reproduce 4kant's issue? Thanks.
Comment #18
4kant CreditAttribution: 4kant commentedThanks AndyF for your response.
I checked everything as you told me, but still no link in the order screen to the webform submission.
You say the link should appear in the product column at the end of the description - I have only the title of the product here. Maybe I´m missing something?
A screenshot with a functional link would perhaps open my eyes...
Thanks again
Comment #19
warpedrive CreditAttribution: warpedrive commentedWell.. I installed and ran the latest -dev update.. and the updater crashed.. got a number of warnings, and..
Still no link or even a listing of an order id in the webform results table.. or anywhere else.
Did seem to add an attendee attributes field to some - but not all - of the existing classes.
Going to have to say that this is open , and the updater isn't in good shape..
Comment #20
AndyF CreditAttribution: AndyF commented@4kant I'm fairly sure you'd see it if it were there! I'm working on a repo that's a couple of commits ahead of the one here (including a bugfix in an update function) so I'm going to work on that a bit more and get it pushed today (ideally). I'll let you know when it's done and ask you to have another go. Thanks.
@warpedrive Please leave the status. For future reference, 'the updater crashed.. got a number of warnings' is next to useless. A detailed description of both would be very helpful (more details). Thanks.
Comment #21
AndyF CreditAttribution: AndyF commentedI've pushed the latest changes. It takes a while for the Drupal packager to archive the latest changes, but if you use Git you can get the changes immediately. I've tested on one site that's running v1.5 with quite a few existing paidevent orders and it seems to update painlessly and work fine. There was a bug in the schema definition for table
uc_event_registration_submissions
in dev - if you have that table already, then please run the following query:Otherwise I think everything should be ok: please let me know how it works for you.
Thanks
Comment #22
4kant CreditAttribution: 4kant commentedAndyF,
Still no link from the order screen to the webform submission. Everything remained as before the update...
Thanks again!
Comment #23
AndyF CreditAttribution: AndyF commented@4kant Sorry to hear that. Have you tried looking at existing paid event orders and seeing if a link displays there?
Could you post the results of the following queries, replacing $order_id with the order number of the new order you made.
Comment #24
AndyF CreditAttribution: AndyF commented@4kant Just saw a potential cause of the problem: in your list of steps in #22 step 3 should be done before step 2. Would you mind going through that process a second time in the correct order, and if that still doesn't work respond to #23? Thanks (and fingers crossed!).
Comment #25
4kant CreditAttribution: 4kant commented@AndiF,
did the whole thing once again and switched step 3 and 2 - sorry - no difference - no matter whether old or new orders..
Here are the results of your queries:
Query: SELECT * FROM uc_orders WHERE order_id = $order_id;
Result:
Query: SELECT * FROM uc_order_products WHERE order_id = $order_id;
Result:
Query: SELECT * FROM uc_event_registration_submissions WHERE order_id = $order_id;
Result:
Query: DESCRIBE uc_event_registration_submissions;
Result:
Hope that helps...
Comment #26
AndyF CreditAttribution: AndyF commentedEverything there looks good. Could you check the markup source to ensure that the link doesn't exist in case it's hidden away somehow visually. Entering
$('.uc-event-registration-submission-link').size()
into your browser's JS console on theadmin/store/orders/7
screen should return 1 if the link's present, zero otherwise. If the link definitely isn't there, could you apply the attached patch (make sure you have devel enabled) and refresh the order screen and report back the contents of the message area. Thanks.Comment #27
4kant CreditAttribution: 4kant commentedAndiF,
JavaScript Console says "zero".
Here´s the message after applying the patch and reloading the order screen of order 7:
product =>
submission =>
And of course:
Success
Comment #28
AndyF CreditAttribution: AndyF commentedHmmn, weirdness. Everything looks fine, except of course the link isn't displaying. Do you have any display-related UC modules enabled? It might be an idea to disable non-essential UC modules and switch the theme to garland. If that doesn't help, try this new patch that adds a
die()
to the link's theme function. If the patch has an effect then the order screen should error out with the message theme function.Comment #29
4kant CreditAttribution: 4kant commented"display-related UC modules"? examples?
Patch didn´t change anything - no error, no message, except those of devel ;-)
I´m actually using Garland...
Sorry for not having positive news.
Comment #30
AndyF CreditAttribution: AndyF commentedI'm stumped then :/ I've tried the latest version on a site which was already using uc_event_registration, and on one that wasn't: both show the links correctly.
I don't have any specific examples of display-related modules, it's just that there's a hook_product_description_alter() that can be used by modules to modify a product's display and that could remove the link. You could try dpm()ing $description in a hook_product_description_alter and try it once with a very low module weight and then again with a very high one. $description should have a child called uc_event_registration_submission_link. If you can see it with a low module weight but not with a high one that would imply a module's modifying the description in a hook_product_description_alter.
Sorry I don't have anything more useful.
Comment #31
4kant CreditAttribution: 4kant commentedAndiF,
thanks for your hint concerning display-related modules.
It´s definitely the ECO - module that causes the disappearing of the link.
Found the hook_product_description_alter() in the file eco.module. I did not try to switch module weights. I simply uninstalled ECO - and the Link "View submitted form data" appeared.
Don´t know whether swtiching module weight would make both modules work together? (I don´t really need ECO anymore as soon as uc_event_registration works... - and don´t know how to switch the weight of modules...)
If there´s something I can still do for you, let me now (eg. switch module´s weights?)
Thanks for your support!
Wiegand
Comment #32
AndyF CreditAttribution: AndyF commentedGreat news! I've created an issue for this (#1664108: Play nicely with other modules that modify the product's description) which includes a patch for you to use until something more permanent can be found.