Hook DisplayAdminProductsExtra weird behavior when product description does not contain p tag #29206
Open
2 tasks done
Labels
1.7.8.6
Affects versions
BO
Category: Back Office
Bug
Type: Bug
Hook
Major
Severity: major bug > https://build.prestashop.com/news/severity-classification
Modules
Component: Which BO section is concerned
Needs Specs
Status: issue needs to be specified
Old Products Page
Concerns the old product page
Regression
Type: regression
Verified
The issue has been reproduced
Prerequisites
Describe the bug and add screenshots
Created a module which uses DisplayAdminProductsExtra hook.
The module shows up on the product page in the tab Modules, which is good.
The module shows a configure button, which is also good.
However, after pressing this configure button Prestashop only gives a message that settings are stored (something like that) and does not load .tpl file. This behavior is not on all products. There are products that are loading the .tpl file and some are not. So, there is a difference in the products which makes Prestashop act different.
I have found out that this behavior comes from the descriptionfield in the table product_lang. The differences between the working and not working products is that the working products start and ends with
<p> </p>
.The not working products are plain ascii. The plain ascii descriptions are result of importing products. How they are imported is not the issue. Fact is that when plain ascii comes in the description the module using DisplayAdminProductsExtra does not show the .tpl file on these products. When changing manually the description between
<p>
and</p>
makes the module work again on that product.My module has nothing to do with the description btw. It only shows a tpl-file with some extra product fields to be loaded in an external table.
Tested it also with another module using this hook, same result.
Solution: let the product page ignore html-tags when goint to module and let it also accept plain ascii.
You can use the module in this message for example (module does not much. I use it for test purposes)
belvg_samplemodule (3).zip
Expected behavior
tpl-file should also be loaded when product description is plain ascii.
Steps to reproduce
testing
and reload the product in the backoffice it now shows the .tpl after pressing configure.PrestaShop version(s) where the bug happened
1.7.8.6+1.7.8.7 but maybe earlier versions as well.
PHP version(s) where the bug happened
7.2
If your bug is related to a module, specify its name and its version
No response
The text was updated successfully, but these errors were encountered: