Skip to content

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

Merged
magento-engcom-team merged 2 commits intomagento:2.1-developfrom
VitaliyBoyko:12304-Handle-empty-incorrect-lines-in-a-language-CSV
Jun 20, 2018
Merged

[Backport] Handle empty or incorrect lines in a language CSV#15287
magento-engcom-team merged 2 commits intomagento:2.1-developfrom
VitaliyBoyko:12304-Handle-empty-incorrect-lines-in-a-language-CSV

Conversation

@VitaliyBoyko
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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