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

PS 1.7.8.9 - Attempted to load class "ImageBulletModel" from the global namespace #1

Open
bicipres opened this issue Jul 26, 2023 · 2 comments

Comments

@bicipres
Copy link

Hi @DevLoris ,

Thanks for your great module!

Everything going well when I install the module but if I upload an image from product BO on Image Bullet section, there is a error which doesn't not allow me to edit the product anymore :

Attempted to load class "ImageBulletModel" from the global namespace. Did you forget a "use" statement?
[Symfony\Component\Debug\Exception\ClassNotFoundException 0]

In FO, I have an error 500 for each product that I edited in order to have an image bullet.

Here is the full error on FO in debugmode:

2023-07-26_10h19_40

I tried to find by myself but I didn't found how to solve it. It's look like an error with "hookDisplayProductExtraContent"?

Env:
Prestashop version: 1.7.8.9
PHP version: 7.4.33
Image Bullet version: 1.3.0

@DevLoris
Copy link
Collaborator

Hi
Can you check if your override/classes/Product contains all the modifications ? (the require_once & the get image bullets function)

I'll do futher investigation to see what is happening & how to fix it.

Thanks,
Loris

@bicipres
Copy link
Author

bicipres commented Aug 16, 2023

Hi,

Sorry for the late reply.

I checked the override/classes/Product:

   /*
    * module: mdn_imagebullet
    * date: 2023-07-22 01:03:12
    * version: 1.3.0
    */
    public function getImageBullets()
    {
        return array_map(function ($v) {
            return new ImageBulletModel($v['id']);
        }, Db::getInstance()->executeS("SELECT id FROM  `" . _DB_PREFIX_ . "mdn_image_bullet` WHERE id_product = '".$this->id."'"));
    }

Also here is the content of /www/modules/mdn_imagebullet/classes/ImageBulletModel.php:

<?php
require_once  dirname(__FILE__) . "/../../modules/mdn_imagebullet/classes/ImageBulletModel.php";

class Product extends ProductCore
{
    public function getImageBullets()
    {
        return array_map(function ($v) {
            return new ImageBulletModel($v['id']);
        }, Db::getInstance()->executeS("SELECT id FROM  `" . _DB_PREFIX_ . "mdn_image_bullet` WHERE id_product = '".$this->id."'"));
    }
}

Is it what you were expecting?

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants