Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ldweeks’s picture

Status: Active » Postponed

If there's enough interest then I will probably add a chipin widget and give people the opportunity to chip in for a d7 update. I don't have any use for an upgrade to d7 and nor does my employer. But I'd be willing to do it for pay. Please feel free to email me if you're interested.

cmcintosh’s picture

FileSize
66.91 KB

So i came across some d7 work that was half done in a sandbox somewhere, it was not working well when i first got it(still not quite what im aiming for), but thought I would share what i have here.

so the idea is to
1. Create your needed attributes / options (if you have any)
2. Create your webform node, select components can be used to set specific options for a product
3. create your product node and select the webform to use. You can choose to have the user redirected to the cart page on submission.

Somethings I am wanting to add/work on for this are linking directly the webform submissions into the order admin page so that you can view the webform data there. There is some initial work already in the module that does this, but it does not work because of the saving of the link between the form and order is not quite right(working out logic for it now).

In this module's code originally it was adding the form to the cart, which i thought could get messy. So i dropped support of that. Also, currently the add to cart form still displays by default on the product node. I want to eventually replace that with the webform client form.

I would also like to make the webform submit values available to the order templates so that you could mail those out in a single invoice if desired.

cmcintosh’s picture

did a little more work and i think i got the module for d7 where i need it for my use case, however could do more work on it if there is a need.

Thanks,
Chris

cmcintosh’s picture

FileSize
66.67 KB

attached update, can we at least get a branch for d 7 dev work, would be great

mgifford’s picture

So would a diff help to push this issue along?

Thanks @cmcintosh for posting your D7 files.

mgifford’s picture

Status: Postponed » Active

Just bumping this to active.

cmcintosh’s picture

If you can do some testing and then reply what you find that would be great. Then i can try and do a diff for the files.

ldweeks’s picture

Status: Active » Fixed

Hey Folks,

Thanks very much, cmcintosh, for the work in #4. I'm very sorry to have let this hang for so long. I have good news, though: I have created a new 7.x branch, and I have committed the code in #4. I only glanced very briefly through the code, and the only glaring problem was a coding standards issue: you need to use 2 spaces for tabs instead of 4.

All that said, would one of you like to be the 7.x branch maintainer for this module?

I'm marking this issue as fixed now that we have a 7.x branch. The branch should appear on the project page soon.

cmcintosh’s picture

I could take up maintenance for the D7 branch. I am including this as part of my Self service platform that I am offering so it would be good to keep it up.

ldweeks’s picture

Well, cmcintosh, welcome aboard! I just added you as a maintainer of this project. Thanks!

mgifford’s picture

There are some pretty big changes in Ubercart 7.x-3.1 (and from beta 4) where a lot of the API that UC Webform is using has changed. It's all using entities now so lots of stuff interacting with the shopping cart has changed.

The zip file that made up the D7 Dev release (above) looks like it was pretty much a rewrite of the D6 version. Some overlap, but really difficult to compare.

I'd run it through Coder here #1554786: Running through coder points to minor translation issues but have tried to do more work recently trying to understand the work that @cmcintosh did. I've been running into a lot of bugs (that I've reported) but had some time to see if I could get this working now.

The patch attached here is running against the current D7 git repository & is the culmination of my review, but it's still not a working version of the code.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mgifford’s picture

Status: Closed (fixed) » Active
Issue tags: +d7upgrade, +6x upgrade to 7x

We've tried to work with the version of the code provided by @cmcintosh but really, it's a completely new project. The concepts are similar, but it's just not something that's comparable with the earlier work.

Rather than work through the problems we were having with the new code (and we really tried), we felt that we would have better results by simply starting from the old D6 version and upgrade it again, keeping in mind the existing functionality of uc_webform.

We will be providing a patch this afternoon with the upgrades we've done. I'd be happy to work with @cmcintosh or others to polish this code off. There are still a few outstanding issues that will come along with the patch. However, the code is working with the latest releases of Webform & Ubercart (which we couldn't accomplish with the earlier D7 release).

Given that there will be now two options for the D7 version of this module, I think we need to talk about how to move this project forward as a community, so I've reopened this issue.

nerdcore’s picture

As mentioned by @mgifford in 13, here is a patch against the 6.x-1.x version of uc_webform in an attempt to bring that code forward to D7.

The Coder module was used to perform many of the necessary changes. Further DB API changes were made by hand, as well as other fix-ups.

PLEASE NOTE: At this time, Products and Product Lists may be added to a webform and are functional. Product Grid, however, spits theme() errors.
Also, any help on the following is appreciated:

* Commented out the check at the top of uc_webform_form_alter() because $form['submitted']['order_status']['#default_value'] is not set.

When editing a webform with a Product Grid:
* Notice: Undefined index: #options in theme_uc_webform_render_product_grid() (line 80 of /home/dm7/sites/sandboxes/uc/modules/uc_webform/components/product_grid.inc).
* Notice: Undefined index: #options in form_process_radios() (line 2998 of /home/dm7/includes/form.inc).

When submitting a webform with a Product List:
* Notice: Undefined index: #value in theme_uc_webform_display_product() (line 240 of /home/dm7/sites/sandboxes/uc/modules/uc_webform/components/product.inc). [x2]

fire-wolf’s picture

Thank you nerdcore, your patch in #14 works - components are available to use but got warnings and notices...

Warnings arise after enabling UC webform module (patched D6 module)
Warning: include_once(/...path.../sites/all/modules/webform/components/product_list.inc): failed to open stream: No such file or directory in _theme_process_registry() (line 563 of /...path.../includes/theme.inc).
Warning: include_once(): Failed opening '/...path.../sites/all/modules/webform/components/product_list.inc' for inclusion (include_path='.:/usr/local/etc/php/includes:/usr/local/share/pear') in _theme_process_registry() (line 563 of /...path.../includes/theme.inc).

Therefore I moved component files to main webform components folder. Just for testing.
After this I tried to add Product List to webform and got four notices:

Notice: Undefined index: extra in webform_component_edit_form() (line 438 of /...path.../sites/all/modules/webform/includes/webform.components.inc).
The same in lines 544, 554 and 560. But in component defaults array there is 'extra' index.

I added Product List, Product Grid and Product components to form and when I switch to view form, I got simple messages:
The webform component product_list is not able to be displayed
The webform component product_grid is not able to be displayed
The webform component product is not able to be displayed

mgifford’s picture

Thanks for testing the code @firewolf

This is something that isn't clearly documented (at least for me) within the Webform API:
#1570976: Update Documentation for _webform_theme_component()

I'm not entirely sure where this problem needs to be fixed.

We certainly struggled with the PHP errors. In the short term disabling the error display within Drupal is the only way to approach this.

The code as is should work though for the functionality. Hopefully we can get some more feedback on this.

mgifford’s picture

Version: 6.x-1.1 » 7.x-1.x-dev
FileSize
1.56 KB

Noticed that the .install wasn't there and was needed.

@firewolf - there needs to be some clarification on #1570976: Update Documentation for _webform_theme_component() before this can get cleared up.

The warnings don't seem to affect the functionality, but they are definitely annoying.

chrisschaub’s picture

Can this get checked in as a 7.x-2 branch? The current 1.x for Drupal 7 doesn't work.

GBurg’s picture

I agree, this patch from #14 (from 6.x 1.4 to drupal 7) should be added for download to keep the module alive.

tmsimont’s picture

any life left in this one?

ldweeks’s picture

Thanks for the interest, tmsimont. I have it on good authority that a D7 version of this module will be released sometime in the near future. I'm not working on it myself, so I can't make any promises, but, to answer your question, yes, I think there is life left in it.

deja711’s picture

Status: Active » Closed (fixed)

Check 7.x-2.0 branch. At this time we are at 7.x-2.1 version.