202ecommerce / paypal

This repository is for developpers only. To install and upgrade the module in a production shop please install the package via PrestaShop Marketplace by following this link:
https://addons.prestashop.com/fr/paiement-carte-wallet/1748-paypal-officiel.html
Academic Free License v3.0
20 stars 31 forks source link

Configuration page problem with PS 8.1.5 #321

Closed Codencode closed 4 months ago

Codencode commented 4 months ago

Describe the bug and add screenshots

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

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

aaa

Steps to reproduce

aaaa

PrestaShop version(s) where the bug happened

8.1.5

PHP version(s) where the bug happened

all