Closed (fixed)
Project:
Aegir Ubercart Integration
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2011 at 10:44 UTC
Updated:
14 Sep 2012 at 19:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
doka commentedyes, I confirm this bug.
For one product it works, for a second one the domain name gets lost after I click on the save button at /purchase/site.
[edit]: the domain name from the second attempt is actually not lost, but is associated with the first site, I put previously into the card.
Comment #2
doka commentedThere is something wrong at the submit function of the create_site_form (function uc_hosting_products_site_info_process) in the uc_hosting/products/inc/uc_hosting_products.pages.inc file
In its present form it just picks up the first product (model) from the uc_hosting_products table, and updates all the cart items belonging to this product with the domain name.
As a quick-and-dirty hack, replace line
with this one:
It will add the domain name to (all) items, where this parameter is empty.
If somebody confirms it, I'll provide a regular patch.
Comment #3
jayelless commentedI had the same problem of the Ubercart hosting integration working for only one product. I found that it would work for the first product defined, but not for any subsequent products specified. I do not believe that the change suggested above is the correct solution.
To me, the problem lies in the fact that the statement:
in function uc_hosting_products_site_info_process (in the file uc_hosting_products.pages.inc) will always return only the first item from the set of items that might exist in the database table.
What is needed is a different query that will select the "relevant" entry from the {uc_hosting_products} table rather then the frst one. How do you get the relevant one? Well the answer is to encode the value into the form when it is being built (in function uc_hosting_products_site_info_form earlier in the same file). This can be done by adding the following lines:
after the section that retrieves the site form and iterates round all the modules that might want to alter it.
Now the submit routine (function uc_hosting_products_site_info_process) has access to the product model directly, and so does not need to do a database lookup to find this information. Therefore the offending database query statement above can be replaced with:
and the site will now function for all specifed products of type=site.
Comment #4
jayelless commentedComment #5
jayelless commentedPatch for comment 3 above attached.
Comment #6
ergonlogicCommitted, thanks!