Page 1 of 1

Attributes Error

Posted: Tue Sep 10, 2024 12:45 pm
by tessthepup
Hi Guys,

I have never really needed to use the attributes system before but now find I need to.

I am using version CE Phoenix v1.0.8.20 and the when trying to use attributes I get this error in the error log.
[10-Sep-2024 13:38:10 Europe/London] PHP Warning: DB: [1054] Unknown column 'pa.sort_order' in 'order clause' from <SELECT po.products_options_name, pov.products_options_values_name,
pa.options_id, pa.options_values_id, pa.price_prefix, pa.options_values_price,
pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount
FROM products_options po
INNER JOIN products_attributes pa ON po.products_options_id = pa.options_id
LEFT JOIN products_options_values pov ON pa.options_values_id = pov.products_options_values_id AND po.language_id = pov.language_id
LEFT JOIN products_attributes_download pad ON pa.products_attributes_id = pad.products_attributes_id
WHERE po.language_id = 1 AND pa.products_id = 10602
ORDER BY pa.sort_order, po.sort_order, po.products_options_name, pov.sort_order, pov.products_options_values_name> in /home/****/public_html/includes/system/versioned/1.0.8.1/database_core.php on line 44
Just wondering if anyone else has come across this?

Thanks

Mark

Re: Attributes Error

Posted: Tue Sep 10, 2024 1:03 pm
by Dan Cole
Looks like you're missing a column (pa.sort_order) in your (products_attributes) table based on the error message. Maybe you missed an SQL update or something. BTW, I don't see a products_attributes table in my database but I have one called products_options. Are you using an add on of some sort?

Dan

Re: Attributes Error

Posted: Tue Sep 10, 2024 1:24 pm
by tessthepup
Dan Cole wrote: Tue Sep 10, 2024 1:03 pm Looks like you're missing a column (pa.sort_order) in your (products_attributes) table based on the error message. Maybe you missed an SQL update or something. BTW, I don't see a products_attributes table in my database but I have one called products_options. Are you using an add on of some sort?

Dan
Hi Dan, thanks for the reply. I did install Rainers 'AJAX Attribute Manager' addon but could not get it to work.

Maybe I have missed something in the removal of it.

I have however added the sort_order field to the products_attributes table and it seems to have cured the error.

Re: Attributes Error

Posted: Tue Sep 10, 2024 1:59 pm
by burt
Sort Order on options was introduced in 1.0.7.10 I believe, about 5 years ago.
I'm surprised that 1.0.8.20 complains about it missing...

products_options.sort_order int(3)
&
products_options_values.sort_order int(3)

products_attributes table does not have sort_order;

Code: Select all

CREATE TABLE products_attributes (
  products_attributes_id int NOT NULL auto_increment,
  products_id int NOT NULL,
  options_id int NOT NULL,
  options_values_id int NOT NULL,
  options_values_price decimal(15,4) NOT NULL,
  price_prefix char(1) NOT NULL,
  PRIMARY KEY (products_attributes_id),
  KEY idx_products_attributes_products_id (products_id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Re: Attributes Error

Posted: Tue Sep 10, 2024 2:29 pm
by tessthepup
burt wrote: Tue Sep 10, 2024 1:59 pm Sort Order on options was introduced in 1.0.7.10 I believe, about 5 years ago.
I'm surprised that 1.0.8.20 complains about it missing...

products_options.sort_order int(3)
&
products_options_values.sort_order int(3)

products_attributes table does not have sort_order;

Code: Select all

CREATE TABLE products_attributes (
  products_attributes_id int NOT NULL auto_increment,
  products_id int NOT NULL,
  options_id int NOT NULL,
  options_values_id int NOT NULL,
  options_values_price decimal(15,4) NOT NULL,
  price_prefix char(1) NOT NULL,
  PRIMARY KEY (products_attributes_id),
  KEY idx_products_attributes_products_id (products_id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Thanks Gary, I am more suprised I have not needed any attributes lol