Jump to content

Product Delete Problem Issue


Maurice

Recommended Posts

This Problem Destroy My heads since two days

PrestaShop Version 1.7.8.10 Php Version 7.4

When i delete one product i get always the timeout Error , so i activated debug Mode and i got this Full error:

in src/Adapter/Product/AdminProductDataUpdater.php (line 152)

         */
        public function deleteProduct($productId)
        {
            $product = new Product($productId);
            if (!Validate::isLoadedObject($product)) {
                throw new \Exception('AdminProductDataUpdater->deleteProduct() received an unknown ID.', 5005);
            }
            // dumb? no: delete() makes a lot of things, and can reject deletion in specific cases.
            // Hooks: will trigger actionProductDelete
            $result = $product->delete();

AdminProductDataUpdater->deleteProduct('70164') in src/PrestaShopBundle/Controller/Admin/ProductController.php (line 1058)

                        $hookDispatcher->dispatchWithParameters(
                            'actionAdminProductsControllerDeleteBefore',
                            $hookEventParameters
                        );
                        // Hooks: managed in ProductUpdater
                        $productUpdater->deleteProduct($id);
                        $this->addFlash(
                            'success',
                            $this->trans('Product successfully deleted.', 'Admin.Catalog.Notification')
                        );
                        $logger->info('Product deleted: (' . $id . ').', $this->getLogDataContext($id));

ProductController->unitAction('delete', '70164') in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)

            $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
            $controller = $event->getController();
            $arguments = $event->getArguments();
            // call controller
            $response = \call_user_func_array($controller, $arguments);
            // view
            if (!$response instanceof Response) {
                $event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
                $this->dispatcher->dispatch(KernelEvents::VIEW, $event);

HttpKernel->handleRaw(object(Request), 1) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)

        public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
        {
            $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
            try {
                return $this->handleRaw($request, $type);
            } catch (\Exception $e) {
                if ($e instanceof RequestExceptionInterface) {
                    $e = new BadRequestHttpException($e->getMessage(), $e);
                }
                if (false === $catch) {

HttpKernel->handle(object(Request), 1, false) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 200)

            $this->boot();
            ++$this->requestStackSize;
            $this->resetServices = true;
            try {
                return $this->getHttpKernel()->handle($request, $type, $catch);
            } finally {
                --$this->requestStackSize;
            }
        }

Kernel->handle(object(Request), 1, false) in admin029r7wydl/index.php (line 82)

    $request = Request::createFromGlobals();
    Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL);
    try {
        require_once __DIR__.'/../autoload.php';
        $response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
        $response->send();
        $kernel->terminate($request, $response);
    } catch (NotFoundHttpException $exception) {
        define('ADMIN_LEGACY_CONTEXT', true);
        // correct Apache charset (except if it's too late)
---------------------------------------------------------------------------------------------------------------------------------------------

What i did until Now:

Disabled some module related to product : No effect same problem

Deleted Categories i  left just Home Categorie : No effect same problem

Deleted Features  : No effect same problem

Product Delete work well only if i duplicate One Product and than Delete the duplicate product

Product in Store almost 98.000

I really appreciate if someone have some additional idea in order to fix this Issue

With Many Thanks

Link to comment
Share on other sites

On 11/19/2023 at 7:15 PM, Maurice said:

in src/Adapter/Product/AdminProductDataUpdater.php (line 152)

         */
        public function deleteProduct($productId)
        {
            $product = new Product($productId);
            if (!Validate::isLoadedObject($product)) {
                throw new \Exception('AdminProductDataUpdater->deleteProduct() received an unknown ID.', 5005);
            }
            // dumb? no: delete() makes a lot of things, and can reject deletion in specific cases.
            // Hooks: will trigger actionProductDelete
            $result = $product->delete();

It would help if you showed screendumps. Now I have no idea which of the lines is line 152.

Link to comment
Share on other sites

Hello , Thanks for reply

i should try to reproduce the error i hope that it will happen soon because until now seems that

i solved the production delete issue (i moved products from home Dir to Subdir ,

but now  when i try to save a product in another sub category Shop will frooze something seems involved with Category Tree i think , but not sure

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...