Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Handle empty or incorrect lines in a language CSV #15287

Conversation

VitaliyBoyko
Copy link
Contributor

@VitaliyBoyko VitaliyBoyko commented May 17, 2018

Original PR: #12304

Description:
Reading language packs will break if the CSV file contains incorrect lines. For example an accidental empty line at the end of the file will cause an undefined index error.

@VitaliyBoyko VitaliyBoyko added backport partners-contribution Pull Request is created by Magento Partner Partner: Atwix Pull Request is created by partner Atwix labels May 17, 2018
@VitaliyBoyko VitaliyBoyko self-assigned this May 17, 2018
@hostep
Copy link
Contributor

hostep commented May 18, 2018

The original PR seems to have one extra newline in the csv file. Or is it just github's rendering that is confusing?

@DanielRuf
Copy link
Contributor

The original PR seems to have one extra newline in the csv file. Or is it just github's rendering that is confusing?

This is the line ending.

@hostep
Copy link
Contributor

hostep commented May 18, 2018

Yes, I know, but I mean this:

original:
original

new:
new

Unless I'm blind, there is an extra line in the original PR, right?

@DanielRuf
Copy link
Contributor

@hostep you are right, probably different EOL settings or just forgotten? Should be probably added here too as files should end with an empty line normally (this is alo what VSCode automatically does).

@hostep
Copy link
Contributor

hostep commented May 18, 2018

I actually think there are two empty lines, since github doesn't render the last empty line, hence why they use that symbol for indicating there is no empty line at the end. So in this case, there is no symbol and we see an empty line, so I assume there are 2 empty lines.

@VitaliyBoyko: it's probably best if you can exactly copy that file from the original PR including the exact same number of empty lines, thanks!

Added one more empty line
@magento-engcom-team
Copy link
Contributor

Hi @VitaliyBoyko. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.1.15 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/App Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants