Product Import adds <br /> to full descrption

I am on version V4.16.2 but did a jump from V4.15.1

Product import is now adding a bridge return to the import of my full description.

I tried showing you the html version of the bridge return but the editor is stripping it out.

I have not changed my import method and this never happened before. I tested it on 2 installations.

Note: I have WYSIWYG turned off and don’t want it on either.

Thanks
Ken

Please share part of your import file. Most possibly descriptions contain carrier return, but it is not visible in the Excel or similar software

1 Like

File looks clean to me. I don’t see how to upload a csv file.

Hi!

You can upload it to any file sharing service and post the link here.

See here:

Please specify product code of the item with problem

All of them - I would not have reported it if it wasn’t the whole file.

Also provide us with the screenshot of the issue in the admin panel or store-front

Please see this video

So, did you try the import file without issue?

I have “Default wysiwyg editor:” set to “Do not use” because it strips away HTML

If you are not seeing the same thing then I will try disabling third party addons to see if the problem persists.

app/schemas/exim/products.functions.php

try to replace

$_data = nl2br($_data);

with

//$_data = nl2br($_data);

Then make import and check the result

These changes were made there intentionally, as simple new line breaks may be ignored by the browser when rendering the page.

Say what!! Why would you do that? They clearly aren’t being ignored. We have “Default wysiwyg editor:” set to “Do not use” for a reason. We do not want it to change our code/formatting. Now, CSC has made that impossible!! Unbelievable!! This pretty much makes importing useless.

Also, I do not see this noted in the changelogs. Maybe I misssed it. Maybe the wording in the blog should be changed to view the partial list of changes from full list.

Please enlighten me as to why the change was made.

1 Like

Since the newline can be represented by several different concepts like \r, \n, \r\n (Newline - Wikipedia) it depends on the browser and operating system you are using whether it is displayed as a new line or not. Since there is no consistent approach to displaying line breaks, they are converted to <br /> in the product description, added using the import feature.

But why are you implementing this? I don’t see a reason? This clearly makes undesired changes.

As I mentioned above, the newline is not displayed in every browser on every operating system, making its behavior unpredictable, so it is replaced by the HTML tag, which is treated identically everywhere.

What is “newline” and why you doing it to imported files? I have been a CSC user for app. 12 years. So you are telling me I have been importing incorrectly the whole time?

Please show me an example of a browser that does not support the code I provided in my import file that looks worse than what CSC has done to my import html.

Please also provide an official patch for this. It clearly is not right. I am surprised nobody else is complaining about this.

Please check the link in my previous message

I have double-checked the import file you provided. I can agree that in this case it breaks the prepared HTML code. I have created the new task on this case and can give you the workaround. Please apply the attached .diff file.

This issue was fixed and the fix will be included into the next version of CS-Cart. I’m attaching the changes that will be included into the next version.
e932ba62b2b0f8ed520296d093d9e85d16994dc9.diff (782 Bytes)

1 Like