Jump to content

Manager SQL unwanted conversion of HTML tags in 1.6.1.18


megane72

Recommended Posts

Hi, I'm manually migrating from 1.5.6.3 to 1.6.1.18 in these days due to an imminent PHP upgrade of my provider that will disable the old version of PS

I have developed some SQL query on 1.5 to manage product stock.

Here one example (mywholesaler is obviously not the real one):

SELECT 
p.id_product, 
pl.name, 
CONCAT(CHAR(60), 'A HREF="', 
'http://www.mywholesaler.eu/action_figure_model_kit_bust_statue_gadget.php?id=',
SUBSTRING(p.reference, 4),
'"', 
' target="_blank"',
CHAR(62), p.reference,
CHAR(60), '/A', CHAR(62)) AS reference, 
p.wholesale_price, 
p.price, 
p.weight, 
p.available_date, 
sa.quantity, 
sa.out_of_stock

FROM ps_product p
LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product)
LEFT JOIN ps_stock_available sa ON (p.id_product = sa.id_product)
WHERE p.active = 1
AND pl.id_lang = 1
AND p.reference LIKE 'CG_%' 
AND sa.out_of_stock = 1

That on 1.5 produce this output (SOURCE) viewed directly in PS page:

<tbody>
<tr>
<td>244</td>
<td>S.H.Figuarts Fortified Armor Shell Kasumi</td>
<td><A HREF="http://www.mywholesaler.eu/action_figure_model_kit_bust_statue_gadget.php?id=17698" target="_blank">CG_17698</A></td>
<td>21.580000</td>
<td>30.210000</td>
<td>0.300000</td>
<td>0000-00-00</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>374</td>
<td>Djibril Zero PVC [1:8]</td>
<td><A HREF="http://www.mywholesaler.eu/action_figure_model_kit_bust_statue_gadget.php?id=4971" target="_blank">CG_4971</A></td>
<td>29.430000</td>
<td>41.200000</td>
<td>0.360000</td>
<td>0000-00-00</td>
<td>0</td>
<td>1</td>
</tr>

 

As you can see it produce a nice usable A HREF tag that i can click to go directly on my wholesaler product page to check the product

 

But with the new 1.6 version the same SQL code produce this output (SOURCE):

<tbody>
<tr>
<td>374</td>
<td>Djibril Zero PVC [1:8]</td>
<td>&lt;A HREF=&quot;http://www.mywholesaler.eu/action_figure_model_kit_bust_statue_gadget.php?id=4971&quot; target=&quot;_blank&quot;&gt;CG_4971&lt;/A&gt;</td>
<td>22.950000</td>
<td>32.130000</td>
<td>0.360000</td>
<td>0000-00-00</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>405</td>
<td>Robot Damashii (Spirit) GM Sniper II</td>
<td>&lt;A HREF=&quot;http://www.mywholesaler.eu/action_figure_model_kit_bust_statue_gadget.php?id=21236&quot; target=&quot;_blank&quot;&gt;CG_21236&lt;/A&gt;</td>
<td>10.040000</td>
<td>14.000000</td>
<td>0.160000</td>
<td>0000-00-00</td>
<td>0</td>
<td>1</td>
</tr>

As you can see something on 1.6 will convert html tag from < to &lt; that make the A HREF unusable

I found a post that mumble about a strip_tags

https://www.prestashop.com/forums/topic/529450-sql-manager-strips-html-tags-from-the-query-results/

but it is related only to the CSV export and is already present in the php code of the 1.5 so it is not there the problem

Anybody can help?

Thanks in advance

 

Edited by megane72 (see edit history)
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...