Page 2 of 7
Re: OpenCart 1.5.2 Bug Thread
Posted: Wed Mar 28, 2012 2:58 am
by Qphoria
2012-Mar-26 - New 152x Patch:
Follow all directions in pink!
http://forum.opencart.com/viewtopic.php ... 04#p258004
Re: OpenCart 1.5.2 Bug Thread
Posted: Fri Mar 30, 2012 11:53 pm
by Qphoria
I've cleaned the hell out of this thread.
- Removed all the duplicate posts
- Removed all the non-bugs
- Removed all the upgrade confusions
- Removed all the off topic commentary
From 15 pages initially, We are left with just over one page... EFFING AMAZING![/highlight][/size]
All confirmed bugs are listed in the first post of this thread.
All confirmed bugs are fixed in the latest patch linked in the first post of this thread.
PLEASE DO NOT POST ANY BUGS UNTIL YOU HAVE READ THE FIRST POST!
Re: OpenCart 1.5.2 Bug Thread
Posted: Sat Mar 31, 2012 11:02 pm
by Johnathan
The customer form IP list needs to be changed from a 3 colspan to a 4 colspan when there are no results:
IN:
/admin/view/template/sale/customer_form.tpl
REPLACE:
colspan="3"
WITH:
colspan="4"
Re: OpenCart 1.5.2 Bug Thread
Posted: Sun Apr 01, 2012 1:23 am
by kpeu3u
Hello,
i get an Warning error at admin page when i make a copy of product.
1. FIX:
Open to edit: /admin/controller/catalog/product.php
2. FIND:
Code: Select all
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name']), ENT_QUOTES, 'UTF-8');
}
if (isset($this->request->get['filter_model'])) {
$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model']), ENT_QUOTES, 'UTF-8');
}
3. REPLACE WITH:
Code: Select all
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_model'])) {
$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
}
Re: OpenCart 1.5.2 Bug Thread
Posted: Sun Apr 01, 2012 6:38 am
by Qphoria
Johnathan wrote:The customer form IP list needs to be changed from a 3 colspan to a 4 colspan when there are no results:
IN:
/admin/view/template/sale/customer_form.tpl
REPLACE:
colspan="3"
WITH:
colspan="4"
Thanks, fixed.
Re: OpenCart 1.5.2 Bug Thread
Posted: Sun Apr 01, 2012 6:49 am
by Qphoria
kpeu3u wrote:Hello,
i get an Warning error at admin page when i make a copy of product.
1. FIX:
Open to edit: /admin/controller/catalog/product.php
2. FIND:
Code: Select all
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name']), ENT_QUOTES, 'UTF-8');
}
if (isset($this->request->get['filter_model'])) {
$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model']), ENT_QUOTES, 'UTF-8');
}
3. REPLACE WITH:
Code: Select all
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_model'])) {
$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
}
Fixed. Thanks
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 02, 2012 3:17 am
by dry_flood
I have posted this on the bug tracker
http://code.google.com/p/opencart/issues/detail?id=845 but thought I would put it here too.
When manually adding an affiliate to an order, when you click on add commission, it says it has added it but the value remains at 0.
Re: OpenCart 1.5.2 Bug Thread
Posted: Wed Apr 04, 2012 2:55 am
by Qphoria
Re: OpenCart 1.5.2 Bug Thread
Posted: Wed Apr 04, 2012 4:06 am
by Johnathan
Just found a bug that has apparently existed since at least 1.4.1:
When deleting a category in the admin panel, it doesn't delete any data in the product_to_category table, which means functions like getProductCategories() return values that no longer exist. If you're using this data to determine something based on the categories to which the product belongs, it can mess up the results.
The fix should just be a one-line database query added to the /admin/model/catalog/category.php file in the deleteCategory() function.
Also, just so I don't lose it, the database query I worked out to fix this issue for someone is as follows:
Code: Select all
DELETE FROM product_to_category WHERE NOT EXISTS (SELECT * FROM category WHERE category_id = product_to_category.category_id)
Use at your own risk.

Re: OpenCart 1.5.2 Bug Thread
Posted: Wed Apr 04, 2012 4:26 am
by Qphoria
Johnathan wrote:Just found a bug that has apparently existed since at least 1.4.1:
When deleting a category in the admin panel, it doesn't delete any data in the product_to_category table, which means functions like getProductCategories() return values that no longer exist. If you're using this data to determine something based on the categories to which the product belongs, it can mess up the results.
The fix should just be a one-line database query added to the /admin/model/catalog/category.php file in the deleteCategory() function.
Also, just so I don't lose it, the database query I worked out to fix this issue for someone is as follows:
Code: Select all
DELETE FROM product_to_category WHERE NOT EXISTS (SELECT * FROM category WHERE category_id = product_to_category.category_id)
Use at your own risk.

Thanks
Fixed. r991
Re: OpenCart 1.5.2 Bug Thread
Posted: Wed Apr 04, 2012 1:42 pm
by ccM
Has anyone tested their gift voucher purchase since r973? The update changed this
to
Code: Select all
$this->data['amount'] = $this->currency->format(25);
On a clean install of 1.5.2.1 plus latest patch I am getting $25.00 entered in to the amount field (including the dollar sign) which it won't accept when submitting the form.
Re: OpenCart 1.5.2 Bug Thread
Posted: Wed Apr 04, 2012 10:08 pm
by Qphoria
ccM wrote:Has anyone tested their gift voucher purchase since r973? The update changed this
to
Code: Select all
$this->data['amount'] = $this->currency->format(25);
On a clean install of 1.5.2.1 plus latest patch I am getting $25.00 entered in to the amount field (including the dollar sign) which it won't accept when submitting the form.
Confirmed..
Fix:
1. EDIT: catalog/controller/account/voucher.php
2. FIND:
3. REPLACE WITH:
Code: Select all
$this->currency->format(25, $this->config->get('config_currency'), false, false);
4. Be sure you set a Voucher Min and Voucher Max in your System Settings on the option tab
Re: OpenCart 1.5.2 Bug Thread
Posted: Thu Apr 05, 2012 7:01 am
by labeshops
moneycarlo wrote:I just upgraded to 1.5.2.2 and noticed when I went into the Admin to edit an order, I received an error:
Use of undefined constant HTTPS_CATALOG - assumed 'HTTPS_CATALOG' in /admin/controller/sale/order.php on line 756
I then went into the admin/config.php and added the HTTPS_CATALOG entry into the HTTPS section and it got rid of the error.
Code: Select all
define('HTTPS_CATALOG', 'https://www.domain.com/');
Here's to hoping that was the right move

Definitely the right move! It finally fixed my issue too!!!
Thank you thank you thank you!!!
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 09, 2012 1:17 am
by JNeuhoff
Looks like there are quite a few bugs which I reported in the 1.5.1.3 bug thread, which are still around in 1.5.2.1. So I start with this one again, more to come later:
The admin backend and the frontend use product query caching which can cause clashes between the two:
admin/model/catalog/product.php:
Code: Select all
$product_data = $this->cache->get('product.' . (int)$this->config->get('config_language_id'));
if (!$product_data) {
$product_data = ......;
$this->cache->set('product.' . (int)$this->config->get('config_language_id'), $product_data);
}
catalog/model/catalog/product.php:
Code: Select all
$product_data = $this->cache->get('product.' . (int)$this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . (int)$customer_group_id . '.' . $cache);
if (!$product_data) {
$product_data = .......;
$this->cache->set('product.' . (int)$this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . (int)$customer_group_id . '.' . $cache, $product_data);
}
The admin backend can potentially retrieve product data from the cache which was set in the frontend.
I suggest this bugfix:
admin/model/catalog/product.php:
Code: Select all
$product_data = $this->cache->get('admin_product.' . (int)$this->config->get('config_language_id'));
if (!$product_data) {
$product_data = ......;
$this->cache->set('admin_product.' . (int)$this->config->get('config_language_id'), $product_data);
}
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 09, 2012 2:19 am
by Daniel
added to svn. thx
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 09, 2012 8:47 pm
by JNeuhoff
I think the following code in catalog/controller/product/product.php should be chnged from
Code: Select all
foreach ($option['option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
.....
to
Code: Select all
foreach ($option['option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0) || ($this->config->get('config_stock_checkout'))) {
.....
because we still want to see out of stock options on the product page when the 'Stock Checkout' in the store settings is set to 'Yes', that is, allow customers to still checkout if the products they are ordering are not in stock.
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 09, 2012 8:58 pm
by JNeuhoff
In file
admin/model/report/sale.php, in function
getTotalTaxes, the following line
Code: Select all
if (!is_null($data['filter_order_status_id'])) {
should be replaced with
Code: Select all
if (!empty($data['filter_order_status_id'])) {
as is the case in function
getTaxes.
The same bug exists in the functions
getShipping and
getTotalShipping.
The same bug also exists in the file
admin/model/report/customer.php, for the functions
getOrders and
getTotalOrders.
The $data['filter_order_status_id'] is never null, but it can have the value '0', meaning to include all order statuses into the resulting list.
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 09, 2012 11:13 pm
by Daniel
JNeuhoff wrote:I think the following code in catalog/controller/product/product.php should be chnged from
Code: Select all
foreach ($option['option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
.....
to
Code: Select all
foreach ($option['option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0) || ($this->config->get('config_stock_checkout'))) {
.....
because we still want to see out of stock options on the product page when the 'Stock Checkout' in the store settings is set to 'Yes', that is, allow customers to still checkout if the products they are ordering are not in stock.
ok added
Re: OpenCart 1.5.2 Bug Thread
Posted: Mon Apr 09, 2012 11:15 pm
by Daniel
JNeuhoff wrote:In file
admin/model/report/sale.php, in function
getTotalTaxes, the following line
Code: Select all
if (!is_null($data['filter_order_status_id'])) {
should be replaced with
Code: Select all
if (!empty($data['filter_order_status_id'])) {
as is the case in function
getTaxes.
The same bug exists in the functions
getShipping and
getTotalShipping.
The same bug also exists in the file
admin/model/report/customer.php, for the functions
getOrders and
getTotalOrders.
has been done for a while on the svn.
The $data['filter_order_status_id'] is never null, but it can have the value '0', meaning to include all order statuses into the resulting list.
Re: OpenCart 1.5.2 Bug Thread
Posted: Tue Apr 10, 2012 12:55 am
by emmegi
Hi,
I'm a newbie. A few days ago I opened a new store with the wonderful OpenCart.
I think the following code in catalog/model/product/account/return.php should be changed from
Code: Select all
$query = $this->db->query("SELECT r.return_id, r.order_id, r.firstname, r.lastname, r.email, r.telephone, r.product, r.model, r.quantity, r.opened, rr.name as reason, ra.name as action, rs.name as status, r.comment, r.date_ordered, r.date_added, r.date_modified FROM `" . DB_PREFIX . "return` r LEFT JOIN " . DB_PREFIX . "return_reason rr ON (r.return_reason_id = rr.return_reason_id) LEFT JOIN " . DB_PREFIX . "return_action ra ON (r.return_action_id = ra.return_action_id) LEFT JOIN " . DB_PREFIX . "return_status rs ON (r.return_status_id = rs.return_status_id) WHERE return_id = '" . (int)$return_id . "' AND customer_id = '" . $this->customer->getId() . "'");
to
Code: Select all
$query = $this->db->query("SELECT r.return_id, r.order_id, r.firstname, r.lastname, r.email, r.telephone, r.product, r.model, r.quantity, r.opened, rr.name as reason, ra.name as action, rs.name as status, r.comment, r.date_ordered, r.date_added, r.date_modified FROM `" . DB_PREFIX . "return` r LEFT JOIN " . DB_PREFIX . "return_reason rr ON (r.return_reason_id = rr.return_reason_id) LEFT JOIN " . DB_PREFIX . "return_action ra ON (r.return_action_id = ra.return_action_id) LEFT JOIN " . DB_PREFIX . "return_status rs ON (r.return_status_id = rs.return_status_id) WHERE return_id = '" . (int)$return_id . "' AND customer_id = '" . $this->customer->getId() .
"' AND rr.language_id = '" . (int)$this->config->get('config_language_id') .
"' AND ra.language_id = '" . (int)$this->config->get('config_language_id') .
"' AND rs.language_id = '" . (int)$this->config->get('config_language_id') . "'");
modified to correctly display the labels in languages other than English