Unknown column 'anon_policy' in 'field list'

tjark - October 29, 2009 - 20:20
Project:e-Commerce
Version:6.x-4.0-rc14
Component:ec_anon
Category:bug report
Priority:normal
Assigned:Unassigned
Status:fixed
Description

I created a fresh Drupal install, added eCommerce with the modules Views, Rules, Views Bulk operations, Token and Chaos tool suite.
All modules were downloaded on 29 october 2009 to make sure I have the newest versions.
First Installed Token, Store and Anonymous purchasing as advised, and let Drupal fix the dependencies.
Configured eCommerce as suggested in the website manual.
Added a Product with Create Content | Product. When submitting the product I get this error:

user warning: Unknown column 'anon_policy' in 'field list' query: UPDATE dtp_ec_product SET nid = 6, vid = 6, ptype = 'tangible', sku = '', price = 10, anon_policy = 0, hide_buynow_link = 1, hide_cart_link = 1 WHERE vid = 6 in C:\xampp\xampp\htdocs\dp_cms\includes\common.inc on line 3468.

Checking whith PHPmyAdmin reveals this column "anon_policy' does not exist in dtp_ec (dtp is my prefix)

I tried to do a fresh install again, checked the documentation but the error returns the second time as well.

Note that I added only a single line to the home page of the website. The database is nearly a clean installed db.

Also note that the product does not show up under Products when I click the Cart as a user or under Products as an administrator.

Any suggestions are welcome, I really like to get the store running.

#1

Xen.dk - October 29, 2009 - 20:32

Did you use the dev version? There's some recent commits on that subject.

#2

hosais - October 31, 2009 - 10:13

Hello,

I install toady (10/31/2009). I got the same result.

Hosais.

#3

Brother Jon - November 1, 2009 - 04:47
Assigned to:Anonymous» Brother Jon

Any help on this would be much appreciated. I got an identical (except obviously for the values) message as above. I'm not using the dev version (I'm using 6.14) and I did a fresh install to no avail. I followed the instructions in the Selling Online book. Also as above I am told the product has been created, but it appears it hasn't.

#4

Brother Jon - November 1, 2009 - 05:04
Assigned to:Brother Jon» Anonymous

#5

Brother Jon - November 1, 2009 - 23:44

I see this has already been answered on http://drupal.org/node/608096

#6

tjark - November 2, 2009 - 09:41
Status:active» fixed

Version 6.x-4.x-dev indeed solves this problem. I did look on this website for a solution, and it it too bad that I could not find it.
Thanks for helping me.

For others having this problem, what I did:
- remove any Products that you may have created.
- In Modules, deselect all eCommerce related modules. This takes about 4 iterations because of dependencies.
- In Modules, select de-install and deinstall all eCommerce related modules.
- remove the eCommerce directory under the Drupal installation and repace it with the 6.x-4.x-dev version
- Under Modules, select Token, Store and Anonymous purchasing and let Drupal resolve the dependencies.
- Activate Products and other modules that you may need, at least Products. Cart can be nice too.
- Create Products, these will be show properly without errors and can be put into the cart.

#7

System Message - November 16, 2009 - 09:50
Status:fixed» closed

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

#8

meatron - November 21, 2009 - 01:37

Hello,
I did exactly as instructed, installed 4.x-dev version, but still, upon enabling the module I get the following error:
user warning: Invalid default value for 'anon_policy' query: ALTER TABLE ec_product ADD `anon_policy` TINYINT NOT NULL DEFAULT 'ECANON_POLICY_OPTIONAL' in /var/www/ecommerce2/includes/database.mysql-common.inc on line 298.
And the above mentioned bug with creating products is also there.

Best regards,

#9

meatron - November 21, 2009 - 15:41

Well, I added the column anon_policy manually:
ALTER TABLE ec_product ADD anon_policy TINYINT;
Now it seems to be working. What a welcome to this module :) I really hope this hack did it, Ubercart has massive internationalisation problems.

#10

Xen.dk - November 21, 2009 - 18:13
Version:6.x-4.0-rc13» 6.x-4.0-rc14
Status:closed» active

Reopening, I installed DRUPAL-6--4-0-RC14 the other day, and the missing anon_policy column caused major fail. Didn't have time to investigate why it wasn't added, but it was a completely fresh install.

#11

gordon - November 22, 2009 - 01:02
Status:active» fixed

I found this problem and the fact that it was not found during the Simpletest system was a pain.

Basically during the installation only the .install is loaded into memory and the .module is not. The ec_anon.module is creating the define() which is causing the error. So during the install the define is not created, and the error is created.

I have release rc15 which has this fixed.

Thanks.

 
 

Drupal is a registered trademark of Dries Buytaert.