Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Products disappear after few days when added by API (Webservices) #36129

Closed
2 tasks done
hk-pack opened this issue May 10, 2024 · 1 comment
Closed
2 tasks done

Products disappear after few days when added by API (Webservices) #36129

hk-pack opened this issue May 10, 2024 · 1 comment
Labels
Bug Type: Bug

Comments

@hk-pack
Copy link

hk-pack commented May 10, 2024

Prerequisites

Describe the bug and add attachments

Hello, I have a Symfony 5 interface that adds 3 products to my website per day through a CRON task. Adding goes smoothly, there's no issue with that.
However, after a few days, the products simply disappear from the site, as if I had clicked "delete", there's no trace of the products anymore, even in database.

For example, it happened today between 2 pm and 6 pm without a single trace, I regenerated my cache around 2 pm, and by 6 pm the products weren't there (the twenty or so products added by the API for the past 4/5 days).

Here are the products present thanks to the cache:
image png 518f249d168c8e4fac7100eeba2d9eca

When I click on a product that was here yesterday :
image png 9f28f8f9959b05c369437c8613ab4211

For example, a product added after this disappearance, everything is perfect and in place:
image png 95308f7e9198672e728b01825a434394

This is the second time in the last 15 days that all my products added via the API have disappeared (I just set up the system). I have no messages in the log, and the products are added perfectly.

New clue :

Here is a product posted this morning:
image png 267bfca116ac8f55915bc7af60bbfe5c
image png 77afd31c28c4485c22371b7d06f1dacf
image png 321370a899e0dd86cfd3eb949ac75998

It is correctly in the database.

I will try to make it disappear.

First clue: products that are only added via the API without having clicked the save button are not visible in the list of products sorted by ID in the back-office. The latest references that should be visible are "verrePLA-SAPH-0-80-19-5-1", "verrePLA-SAPH-0-80-19-4-1", "verrePLA-SAPH-0-80-19-2-1", "verrePLA-SAPH-0-80-19-1-1":
image png 73252e7cf39a4526196fc75adcb41eef

The reference "verrePLA-SAPH-0-80-19-30-1" was manually saved by pressing the save button in the back-office.

Expected behavior

I want the products stays on my website.

Steps to reproduce

Just adding a product with Prestashop Web Services. I don't have any clues to reproduce it.

PrestaShop version(s) where the bug happened

8.0.4

PHP version(s) where the bug happened

8.2-fpm

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

No response

@hk-pack hk-pack added Bug Type: Bug New New issue not yet processed by QA labels May 10, 2024
@hk-pack
Copy link
Author

hk-pack commented May 11, 2024

Three 'non-mandatory' parameters were missing:
position_in_category should count the products in the default category and add +1.

$product->addChild('position_in_category', $position_in_category);
$product->addChild('state', 1);
$product->addChild('redirect_type', '301-category');"

Enjoy! 😎😎

@hk-pack hk-pack closed this as completed May 11, 2024
@florine2623 florine2623 added EPIC Macro-level issue gathering improvements & bugs related to a specific topic and removed New New issue not yet processed by QA EPIC Macro-level issue gathering improvements & bugs related to a specific topic labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants