Zen Cart Logo
Forums / Upgrading to 1.5.x / Attribute Problems after 158 Move

Attribute Problems after 158 Move

Views: 10,013

Results 1 to 14 of 14
15 Feb 2023, 4:38 PM
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Attribute Problems after 158 Move

158 latest github with update of old database
PHP 8
responsive_classic clone
OPC latest github
No URL, problem in admin

The old database has 156 products that do not show in the categories/products nor do they show with a search. All are products_status 0 but it appears that SOMEHOW they may be being used by the owner to modify other products' attributes. Getting the followin errors:

[15-Feb-2023 10:12:53 America/New_York] Request URI: /frammer1/index.php?cmd=category_product_listing&cPath=38&pID=101&action=attribute_features_copy_to_product&page=1&products_id=101, IP address: ***.***.***.***, Language id 1#1 require(/frammer1/category_product_listing.php) called at [/frammer1/index.php:11]
--> PHP Warning: Undefined array key "copy_attributes" in /frammer1/category_product_listing.php on line 1133.
**********************


[15-Feb-2023 10:12:32 America/New_York] Request URI: /frammer1/index.php?cmd=category_product_listing&action=update_attributes_copy_to_product&cPath=38&page=1, IP address: ***.***.***.***, Language id 1
#1 require(/frammer1/category_product_listing.php) called at [/frammer1/index.php:11]
--> PHP Warning: Undefined array key "products_id" in /frammer1/category_product_listing.php on line 281.
************************


[15-Feb-2023 10:11:06 America/New_York] Request URI: /frammer1/index.php?cmd=attributes_controller&products_filter=101&current_category_id=38, IP address: ***.***.***.***, Language id 1
#1 require(/frammer1/attributes_controller.php) called at [/frammer1/index.php:11]
--> PHP Warning: Undefined array key "products_options_type" in /frammer1/attributes_controller.php on line 1097.


[15-Feb-2023 10:11:06 America/New_York] Request URI: /frammer1/index.php?cmd=attributes_controller&products_filter=101&current_category_id=38, IP address: ***.***.***.***, Language id 1
#1 translate_type_to_name() called at [/frammer1/attributes_controller.php:1097]
#2 require(/frammer1/attributes_controller.php) called at [/frammer1/index.php:11]
--> PHP Warning: Undefined array key "" in /frammer1/attributes_controller.php on line 602.
******************************************

Guidance appreciated.

THANX

15 Feb 2023, 7:29 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Attribute Problems after 158 Move

Using the site's phpMyAdmin, what results come back from the following query?

SELECT pa.*
                                     FROM (proucts_attributes pa
                                     LEFT JOIN products_options po ON pa.options_id = po.products_options_id
                                       AND po.language_id = 1)
                                     WHERE pa.products_id = 101
                                     ORDER BY LPAD(po.products_options_sort_order,11,'0'),
                                              LPAD(pa.options_id,11,'0'),
                                              LPAD(pa.products_options_sort_order,11,'0')

P.S. I'm *assuming *that the site's database doesn't use table-prefixes.

15 Feb 2023, 7:41 PM
#3
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Attribute Problems after 158 Move

lat9:

Using the site's phpMyAdmin, what results come back from the following query?

SELECT pa.*
FROM (proucts_attributes pa
LEFT JOIN products_options po ON pa.options_id = po.products_options_id
AND po.language_id = 1)
WHERE pa.products_id = 101
ORDER BY LPAD(po.products_options_sort_order,11,'0'),
LPAD(pa.options_id,11,'0'),
LPAD(pa.products_options_sort_order,11,'0')

> P.S. I'm *assuming *that the site's database doesn't use table-prefixes.

Little typo,

SELECT pa.*
FROM (pro[B]d[/B]ucts_attributes pa
LEFT JOIN products_options po ON pa.options_id = po.products_options_id
AND po.language_id = 1)
WHERE pa.products_id = 101
ORDER BY LPAD(po.products_options_sort_order,11,'0'),
LPAD(pa.options_id,11,'0'),
LPAD(pa.products_options_sort_order,11,'0')


Edit: just noticed it was for @dbltoe, who would have realised this.
15 Feb 2023, 8:27 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

:blush:
Actually, I didn't until I threw it in navicat and it balked.

[Attachment no longer available]

Is this enough of a look?

15 Feb 2023, 8:30 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Attribute Problems after 158 Move

It is! What's with that first record, with an *options_id *of 0; that can't be valid!

15 Feb 2023, 8:39 PM
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

It's there for pert near ever one.:unsure: Thought it strange myself but the cart works until you mess with any attribute and you cannot search from the categories/products page and then alt < without a notice that things went "bump""

[Attachment no longer available]

15 Feb 2023, 9:32 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

Store owner says he got it from the developer that way.

There are also 98 product_id listings in the products directory with not a one of them being found by ID search in the admin.:dontgetit

15 Feb 2023, 10:43 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Attribute Problems after 158 Move

dbltoe:

Store owner says he got it from the developer that way.

There are also 98 product_id listings in the products directory with not a one of them being found by ID search in the admin.:dontgetit
Do those "missing" products_id values have entries in the products_to_categories table?

16 Feb 2023, 9:15 AM
#9
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

I find 156 items in the products table with a products_status of 0 that have a setting in the categories_id in the products_to_categories table.

16 Feb 2023, 3:45 PM
#10
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

Added one category and two products with no attributes this morning which resulted in three logs.

[16-Feb-2023 09:30:14 America/New_York] Request URI: /jetmar_Chris/index.php?cmd=attributes_controller&products_filter=8&current_category_id=22, IP address: 67.209.13.115, Language id 1
#1 require(/jetmar_Chris/attributes_controller.php) called at [/jetmar_Chris/index.php:11]
--> PHP Warning: Undefined array key "products_options_type" in /jetmar_Chris/attributes_controller.php on line 1097.

[16-Feb-2023 09:30:14 America/New_York] Request URI: /jetmar_Chris/index.php?cmd=attributes_controller&products_filter=8&current_category_id=22, IP address: 67.209.13.115, Language id 1
#1 translate_type_to_name() called at [/jetmar_Chris/attributes_controller.php:1097]
#2 require(/jetmar_Chris/attributes_controller.php) called at [/jetmar_Chris/index.php:11]
--> PHP Warning: Undefined array key "" in /jetmar_Chris/attributes_controller.php on line 602.
1 Mar 2023, 2:58 AM
#11
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

Just to bring all up to date....

I deleted all line items with a value of 0 in the options_id field of the products_attributes table of the database.

All is fine now.

1 Mar 2023, 3:26 PM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Attribute Problems after 158 Move

dbltoe:

Just to bring all up to date....

I deleted all line items with a value of 0 in the options_id field of the products_attributes table of the database.

All is fine now.
The real question is "How did those option_id elements with a 0-value get there in the first place?"

1 Mar 2023, 5:22 PM
#13
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Attribute Problems after 158 Move

Agreed!

Most of them were from products added in 2016 and I was told that the person who built it passed in November of 2020.

<personal> And, until a week after I took over the site, I didn't know the developer was a young man I'd known all his life. My wife was in his mother's wedding. I suggested he use Zen Cart for his side business. Early forties is way to young to go. </personal>

He had enough knowledge that he may have done what many of us did early on in ZC. The "I can just code that in here" or "I'll just throw this in the database" only to find out later that there was the right way, the wrong way, and the Zen Cart way.:P

9 Jul 2025, 3:46 AM
#14
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
285
Plugin Contributions:
1

Re: Attribute Problems after 158 Move

dbltoe:

Just to bring all up to date....

I deleted all line items with a value of 0 in the options_id field of the products_attributes table of the database.

All is fine now.

I have just noticed the same thing.

I added some attributes to a few products and it triggered the same warning.

And yes, a couple of the products have options_id of 0 attached.

The products investigated were added in 2020. I can't think of anything 'different' I would have done - but one theory is that these products are a copy of another and I would have used the then version of 'multiple product copy' to do this.