Post by rocketninjin » Mon Oct 12, 2020 3:34 pm

Hi,
I am having issue with my OC 3.0.3.2. I have a few products completely disappear from the admin page, but these items still appear in the store front.
I saw the item inside the DB and I have to disable the item in the from DB.
What would be the potential reason causing this issue happen?

Thank you.

New member

Posts

Joined
Mon Jul 20, 2020 9:53 pm

Post by sw!tch » Mon Oct 12, 2020 5:29 pm

rocketninjin wrote:
Mon Oct 12, 2020 3:34 pm
Hi,
I am having issue with my OC 3.0.3.2. I have a few products completely disappear from the admin page, but these items still appear in the store front.
I saw the item inside the DB and I have to disable the item in the from DB.
What would be the potential reason causing this issue happen?

Thank you.
Well, looking at the getProducts() query .
https://github.com/opencart/opencart/bl ... t.php#L359

Code: Select all

WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
^ Maybe language id doesn't match or is missing on those products or differs from what's set in your admin.

Compare some products that show with ones that don't in PHPmyAdmin .

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by rocketninjin » Mon Oct 12, 2020 8:01 pm

Thank you very much for your reply.
I had a look at the database language id, in the product description, the language id is correct and nothing missing compare to the "normal" one.
Not sure where the error comes from. :-\
sw!tch wrote:
Mon Oct 12, 2020 5:29 pm
rocketninjin wrote:
Mon Oct 12, 2020 3:34 pm
Hi,
I am having issue with my OC 3.0.3.2. I have a few products completely disappear from the admin page, but these items still appear in the store front.
I saw the item inside the DB and I have to disable the item in the from DB.
What would be the potential reason causing this issue happen?

Thank you.
Well, looking at the getProducts() query .
https://github.com/opencart/opencart/bl ... t.php#L359

Code: Select all

WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
^ Maybe language id doesn't match or is missing on those products or differs from what's set in your admin.

Compare some products that show with ones that don't in PHPmyAdmin .

New member

Posts

Joined
Mon Jul 20, 2020 9:53 pm

Post by sw!tch » Tue Oct 13, 2020 4:36 am

Any extensions installed?

Try editing a product that shows and when on the product page change the product_id= URL praam to the ID of a product that doesn't show. See if it comes up, make sure you keep your session token. Just change the product_id= param.

Also check your error logs, etc.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by straightlight » Tue Oct 13, 2020 5:50 am

Not a bug. However, the error logs might unsuccessful to output the results in these particular cases since the action is being redirected back to the original method where the original method kicks back to $this->getForm(). To troubleshooting this issue more closely, in your admin/controller/catalog/product.php file,

in the add() and edit() method, find:

Code: Select all

if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
add below each:

Code: Select all

echo "<pre />\n";
print_r($this->request->post);
echo "</pre>\n";
exit;
Then, save the file. Then, reload your OC admin > catalog > products page. Retry the action you are reporting about and post the array that you see on the screen once the product is, either, created or edited.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rocketninjin » Tue Oct 13, 2020 8:31 am

I have installed ADV Profit extension to show sales history and order history.
I can access the product with the method you suggest (product_id=).
There is nothing special inside the product, just same as the others that function properly.
sw!tch wrote:
Tue Oct 13, 2020 4:36 am
Any extensions installed?

Try editing a product that shows and when on the product page change the product_id= URL praam to the ID of a product that doesn't show. See if it comes up, make sure you keep your session token. Just change the product_id= param.

Also check your error logs, etc.

New member

Posts

Joined
Mon Jul 20, 2020 9:53 pm

Post by rocketninjin » Tue Oct 13, 2020 8:34 am

Thanks for the reply.
I have add the code to the add() and edit() function.
There is nothing special when I try to retrieve the list again, the filter box can find the product name and the model code. I tried to filter there and nothing show up in the product list. There is nothing print from the script that you given to me too.

Is there any other file I need to modify to show the error?
straightlight wrote:
Tue Oct 13, 2020 5:50 am
Not a bug. However, the error logs might unsuccessful to output the results in these particular cases since the action is being redirected back to the original method where the original method kicks back to $this->getForm(). To troubleshooting this issue more closely, in your admin/controller/catalog/product.php file,

in the add() and edit() method, find:

Code: Select all

if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
add below each:

Code: Select all

echo "<pre />\n";
print_r($this->request->post);
echo "</pre>\n";
exit;
Then, save the file. Then, reload your OC admin > catalog > products page. Retry the action you are reporting about and post the array that you see on the screen once the product is, either, created or edited.

New member

Posts

Joined
Mon Jul 20, 2020 9:53 pm

Post by sw!tch » Tue Oct 13, 2020 8:40 am

sw!tch wrote:
Tue Oct 13, 2020 4:36 am
Try editing a product that shows and when on the product page change the product_id= URL praam to the ID of a product that doesn't show. See if it comes up, make sure you keep your session token. Just change the product_id= param.
rocketninjin wrote:
Tue Oct 13, 2020 8:31 am
I can access the product with the method you suggest (product_id=).
There is nothing special inside the product, just same as the others that function properly.
So it shows up when you manually enter the product id?

Try saving the product once you do this. See if it then shows up.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by letxobnav » Tue Oct 13, 2020 10:05 am

if disappearing from the list, check the query by adding:

Code: Select all

$this->log->write($sql);
before:

Code: Select all

		$query = $this->db->query($sql);
in admin/model/catalog/product.php

and see what the query is in your oc error log.
probably sort order or a filter.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by rocketninjin » Wed Oct 14, 2020 9:47 pm

Tried to edit the information within the product and save again. Nothing change, still disappear in the list.
sw!tch wrote:
Tue Oct 13, 2020 8:40 am
sw!tch wrote:
Tue Oct 13, 2020 4:36 am
Try editing a product that shows and when on the product page change the product_id= URL praam to the ID of a product that doesn't show. See if it comes up, make sure you keep your session token. Just change the product_id= param.
rocketninjin wrote:
Tue Oct 13, 2020 8:31 am
I can access the product with the method you suggest (product_id=).
There is nothing special inside the product, just same as the others that function properly.
So it shows up when you manually enter the product id?

Try saving the product once you do this. See if it then shows up.

New member

Posts

Joined
Mon Jul 20, 2020 9:53 pm

Post by straightlight » Wed Oct 14, 2020 10:06 pm

rocketninjin wrote:
Wed Oct 14, 2020 9:47 pm
Tried to edit the information within the product and save again. Nothing change, still disappear in the list.
sw!tch wrote:
Tue Oct 13, 2020 8:40 am
sw!tch wrote:
Tue Oct 13, 2020 4:36 am
Try editing a product that shows and when on the product page change the product_id= URL praam to the ID of a product that doesn't show. See if it comes up, make sure you keep your session token. Just change the product_id= param.
rocketninjin wrote:
Tue Oct 13, 2020 8:31 am
I can access the product with the method you suggest (product_id=).
There is nothing special inside the product, just same as the others that function properly.
So it shows up when you manually enter the product id?

Try saving the product once you do this. See if it then shows up.
Then my suggestion above may help you to track the source of the issue. It's somewhere within the array or while the data gets inserted on the database. Both needs to be troubleshoot one at a time.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rocketninjin » Wed Oct 14, 2020 10:25 pm

I have added the code to the PHP file.
I tried to filter to look for the product, the autocomplete shows the product code but when I apply the filter, there is nothing in the list.
Checked the error log, there is no error either.
letxobnav wrote:
Tue Oct 13, 2020 10:05 am
if disappearing from the list, check the query by adding:

Code: Select all

$this->log->write($sql);
before:

Code: Select all

		$query = $this->db->query($sql);
in admin/model/catalog/product.php

and see what the query is in your oc error log.
probably sort order or a filter.

New member

Posts

Joined
Mon Jul 20, 2020 9:53 pm

Post by straightlight » Wed Oct 14, 2020 10:35 pm

Then, try my solution I already posted: viewtopic.php?f=201&t=220412#p801957 . The results are still unposted on that.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 76 guests