Post by BrickAlley » Fri Jun 29, 2012 5:17 am

Added a new product today and I got an unpleasant surprise.

When the item decided to populate itself in category view it showed Null where the Product Name and Image should have showed up. So, I went back and added a product image and suddenly everything worked perfect.

The error message I got at first is pasted below. I hope someone can offer a theory on what may be happening. I'll point out that I made some changes to my category.tpl with the order of items in grid view. I moved Product Name above the Product Image, so I'm wondering if that may hold a clue to the error I got.

Code: Select all

Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/hidden31/public_html/system/database/mysql.php on line 21Notice: Error: Subquery returns more than 1 row
Error No: 1242
SELECT DISTINCT *, pd.name AS name, pd.short_description AS short_description, p.image, m.name AS manufacturer, (SELECT price FROM product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '8' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '8' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM product_reward pr WHERE pr.product_id = p.product_id AND customer_group_id = '8') AS reward, (SELECT ss.name FROM stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '1') AS stock_status, (SELECT wcd.unit FROM weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '1') AS weight_class, (SELECT lcd.unit FROM length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '1') AS length_class, (SELECT AVG(rating) AS total FROM review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '530' AND pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' in /home/hidden31/public_html/system/database/mysql.php on line 49

New member

Posts

Joined
Sat Mar 12, 2011 8:17 am

Post by rph » Fri Jun 29, 2012 6:31 am

The reward, stock_status, weight_class, length_class, rating, or reviews subquery is returning more than 1 row.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by BrickAlley » Fri Jun 29, 2012 6:34 am

Thanks for the reply.

How do I fix the problem? I've had no experience digging in MySQL, so this is a new one for me.

New member

Posts

Joined
Sat Mar 12, 2011 8:17 am

Post by aduakasoft » Fri Jun 29, 2012 7:47 am

BrickAlley wrote:Thanks for the reply.

How do I fix the problem? I've had no experience digging in MySQL, so this is a new one for me.
use any vqmod / mods ? opencart version?

MODULE PRODUCT SORT, CUSTOM ORDER FILTER, SEO CACHE, BULK DISCOUNT


User avatar
Active Member

Posts

Joined
Thu Mar 29, 2012 8:04 am

Post by BrickAlley » Fri Jun 29, 2012 10:54 am

I have a pile of vqMods zipped them up and I've attached them.
Last edited by BrickAlley on Fri Jun 29, 2012 7:38 pm, edited 1 time in total.

New member

Posts

Joined
Sat Mar 12, 2011 8:17 am

Post by rph » Fri Jun 29, 2012 4:51 pm

You need to take that down. One of the mods is commercial.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by TheMatrix1 » Mon Jun 03, 2013 3:30 am

The following seems to have resolved Error 1242 on my site:
In phpmyadmin: Table: oc_url_alias
812 category_id=20 product1
773 category_id=200 desktops

There were two records for category_id=20, I changed one to category_id=200. Note that 200 is a fictitious Category id and is any number higher than the highest existing category_id , an expert can confirm if it is better to delete the duplicate records. Product "Desktops" is part of the default product installation, I deleted all default products (what a pain and unnecessary work), but not the records at url_alias.

This note On a few open cart websites we have worked on, sometimes there is a duplicate url_alias entry for a category. This change resolves the issue when editing the category again. at https://github.com/opencart/opencart/co ... 98edc2bfb9 mentioned above issue.

The experts can comment if this is a long term solution and if it should be used, but so far it solved my Error 1242.

Newbie

Posts

Joined
Wed Mar 06, 2013 9:07 pm
Who is online

Users browsing this forum: Amazon [Bot], Google [Bot] and 42 guests