paypal icon indicating copy to clipboard operation
paypal copied to clipboard

Configuration page problem with PS 8.1.5 on Windows

Open Codencode opened this issue 1 year ago • 3 comments

Describe the bug and add screenshots

The module configuration page in PS 8.1.5 (on Windows) is displayed poorly, because the paypal/views/css/paypal_bo.css file and the paypal/views/js/admin.js file are missing.

I attach a screenshot of the page. Screenshot 2024-04-22 at 10-02-53 Configuration • Codencode

Apparently the problem arises because these 2 files are imported using the constant _PS_MODULE_DIR_ as follows in the file controllers/admin/AdminPaypalConfigurationController.php:


         $this->addJS(_PS_MODULE_DIR_ . 'paypal/views/js/admin.js');
         $this->addJS('https://www.paypalobjects.com/merchant-library/merchant-configurator.js', false);
         $this->addCSS(_PS_MODULE_DIR_ . 'paypal/views/css/paypal_bo.css');

By changing the constant _MODULE_DIR_ with


         $this->addJS(_MODULE_DIR_. 'paypal/views/js/admin.js');
         $this->addJS('https://www.paypalobjects.com/merchant-library/merchant-configurator.js', false);
         $this->addCSS(_MODULE_DIR_ . 'paypal/views/css/paypal_bo.css');

This solution also works in PS 1.7.

Can I create a PR with the edit?

Thank you.

Expected behavior

That the configuration page is displayed correctly

Steps to reproduce

In PS 8 go to the module configuration page and you will see the problem

PrestaShop version(s) where the bug happened

8.1.5

PHP version(s) where the bug happened

all

Codencode avatar Apr 22 '24 08:04 Codencode

Hi @Codencode Feel free to make a PR! Our QA will test your fix in several release to be sure, there are no regression ! Many thanks.

clotairer avatar Apr 22 '24 08:04 clotairer

Hi @Codencode Feel free to make a PR! Our QA will test your fix in several release to be sure, there are no regression ! Many thanks.

Hi @clotairer here is the PR: https://github.com/202ecommerce/paypal/pull/323

Thank you!

Codencode avatar Apr 22 '24 08:04 Codencode

Thank you. Github actions are OK. We will test it and assign a relase as soon as possible.

Thanks you.

clotairer avatar Apr 22 '24 08:04 clotairer