I've been running the 1.0-beta36 for ages with no problems. Wanted to update to 6.x-2.x-dev (Dec 19 2010). I run update.php and get an error message:

An error occurred. http://www.example.com/update.php?id=31&op=do (no information available).

I go to the error report and it states:

The update process was aborted prematurely while running update #6 in uc_discounts.module.

It also reports that:

uc_discounts module
Update #5
ALTER TABLE {uc_discounts} ADD required_product varchar(255) NOT NULL default '' AFTER requires_single_product_to_qualify

seemed to go smoothly.

For the moment I'm reverting back to 4.0-beta36

Any pointers as to where I'm going wrong here?

Comments

razorback’s picture

i"m getting same error.... any update?

ezra-g’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Can you look in your PHP error log for any PHP errors? It could be that you exceeded the PHP memory limit.

razorback’s picture

I did not find any errors in the log. I tried to upgrade twice and it failed both times. So I backed out to the previous version with no issue.

razorback’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active

This morning I attempted to upgrade to the latest version and I am getting this same error again. Here are some details:

---------------------
During Update.php run:
An error occurred. http://www.mydomain.com/update.php?id=102&op=do
Fatal error: Call to undefined function uc_discounts_classes_schema() in /home/myDIRECTORY/public_html/sites/all/modules/uc_discounts_alt/uc_discounts/uc_discounts.install on line 514

The update process was aborted prematurely while running update #6 in uc_discounts.module. All errors have been logged. You may need to check the watchdog database table manually.
---------------------

THIS CAME FROM THE WATCHDOG TABLE:

a:4:{s:6:"%error";s:12:"user warning";s:8:"%message";s:1141:"Unknown column 'd.has_activation' in 'where clause'
query: SELECT DISTINCT d.* FROM uc_discounts d
LEFT JOIN uc_discounts_products dp ON d.discount_id=dp.discount_id
LEFT JOIN uc_discounts_terms dt ON d.discount_id=dt.discount_id
LEFT JOIN uc_discounts_skus ds ON d.discount_id=ds.discount_id
LEFT JOIN uc_discounts_classes dcl ON d.discount_id=dcl.discount_id
WHERE (d.requires_code=0)
AND (d.has_role_filter=0 OR d.discount_id IN(SELECT dr.discount_id FROM uc_discounts_roles dr LEFT JOIN users_roles ur ON (dr.role_id=ur.rid AND ur.uid=1) WHERE ur.uid IS NOT NULL OR dr.role_id=-1 OR dr.role_id=2))
AND (d.filter_type<>1 OR dp.product_id IN(2465,-1))
AND (d.filter_type<>2 OR dt.term_id IN(-1,240,9,80,60,76))
AND (d.filter_type<>3 OR ds.sku IN('','Patched Tunic Top/Capri Pant Se'))
AND (d.filter_type<>4 OR dcl.class IN('','product'))
AND (d.has_activation=0 OR d.activates_on<1303992266)
AND (d.has_expiration=0 OR d.expiration>1303992266)
AND (d.is_active=1)
ORDER BY weight";s:5:"%file";s:94:"/home/MY DIRECTORY/public_html/sites/all/modules/uc_discounts_alt/uc_discounts/uc_discounts.module";s:5:"%line";i:1111;}

All discounts are no longer working. Any help is appreciated.

razorback’s picture

Does anyone have any thougts on this. I have tryied it again with same result.

razorback’s picture

Version: 6.x-2.x-dev » 6.x-2.1
Category: support » bug
Priority: Major » Critical

updated version, changed to bug category and updated priority to critical. I am unable to install and all site discounts are now disabled. I'm not sure what to do here. My only option is to fix this or role back to my previous version which shows as unsupported. Please advise. Thx!

razorback’s picture

Status: Active » Closed (won't fix)

I got the new version up and running but first completely removing the old version and then installing the latest version from scratch. Closing out ticket

larowlan’s picture

sub (yeah I know it's fixed)

retorque’s picture

I know this issue is ancient, but I figured others might need to upgrade really old sites through this issue as well, and completely uninstalling the module might not always be an option.

The schema that the module is attempting to load by calling uc_discounts_classes_schema() is available in uc_discounts_schema(). However, the version in uc_discounts_schema() is newer than the version that was once in uc_discounts_classes_schema().

I changed the function call in uc_discounts_update_6() from uc_discounts_classes_schema() to uc_discounts_schema(). The update ran but produced two errors:
Failed: ALTER TABLE {uc_discounts_classes} ADD `grouping` TINYINT NOT NULL DEFAULT 1
Failed: ALTER TABLE {uc_discounts_classes} ADD INDEX discount_id_grouping (discount_id, grouping)

I checked the database, and the table included the failed alterations.

I have not yet had any issues after the update.