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

Fix line endings in theme's JS files #7607

Merged
merged 1 commit into from Jun 21, 2017

Conversation

Projects
None yet
5 participants
@mcdado
Contributor

mcdado commented Feb 24, 2017

Questions Answers
Branch? 1.6.1.x
Description? Fix line endings in JavaScript theme files.
Type? bug fix
Category? FO
BC breaks? no
Deprecations? no
How to test? Check out the files and verify the line endings, they should be LF instead of CRLF.
@xBorderie

This comment has been minimized.

Show comment
Hide comment
@xBorderie

xBorderie Feb 24, 2017

Contributor

Thanks! Are you sure your indentation is correct? 'cos I need to point to https://github.com/PrestaShop/PrestaShop/pull/7607/files?w=1 :)

Contributor

xBorderie commented Feb 24, 2017

Thanks! Are you sure your indentation is correct? 'cos I need to point to https://github.com/PrestaShop/PrestaShop/pull/7607/files?w=1 :)

@mcdado

This comment has been minimized.

Show comment
Hide comment
@mcdado

mcdado Feb 24, 2017

Contributor

Well… I didn't want to put too many style corrections into this PR. All .js theme files are tab indented, I just followed that, and I don't think I made indentation mistakes, right? Otherwise let me know where exactly and I'll correct it, as usual.

That said, I had to correct the line endings because I have a big heart! ❤️ 😉

Contributor

mcdado commented Feb 24, 2017

Well… I didn't want to put too many style corrections into this PR. All .js theme files are tab indented, I just followed that, and I don't think I made indentation mistakes, right? Otherwise let me know where exactly and I'll correct it, as usual.

That said, I had to correct the line endings because I have a big heart! ❤️ 😉

@mcdado

This comment has been minimized.

Show comment
Hide comment
@mcdado

mcdado Feb 24, 2017

Contributor

I would gladly make a PR with an eslint run of all js files in the theme directory. Let me know! if that's be okay.

Contributor

mcdado commented Feb 24, 2017

I would gladly make a PR with an eslint run of all js files in the theme directory. Let me know! if that's be okay.

@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91

Quetzacoalt91 Mar 6, 2017

Member

Hello @mcdado,

What error are you trying to fix ? I tried to reproduce the initial problem but unfortunately nothing is reported in the console on this page.

capture d ecran 2017-03-06 a 09 29 18

Member

Quetzacoalt91 commented Mar 6, 2017

Hello @mcdado,

What error are you trying to fix ? I tried to reproduce the initial problem but unfortunately nothing is reported in the console on this page.

capture d ecran 2017-03-06 a 09 29 18

@mcdado

This comment has been minimized.

Show comment
Hide comment
@mcdado

mcdado Mar 6, 2017

Contributor

screen shot 2017-03-06 at 09 55 21

Line 410 of global.js is as follows in my current theme:
$.totalStorage('display', 'list');

Actually, now that I think of it, I didn't test it against current default theme, since we have a theme that is based on it, I thought it couldn't be too different since we generally pull upstream patches. Can you try to force running bindGrid() from global.js and see if that causes errors to you?

Contributor

mcdado commented Mar 6, 2017

screen shot 2017-03-06 at 09 55 21

Line 410 of global.js is as follows in my current theme:
$.totalStorage('display', 'list');

Actually, now that I think of it, I didn't test it against current default theme, since we have a theme that is based on it, I thought it couldn't be too different since we generally pull upstream patches. Can you try to force running bindGrid() from global.js and see if that causes errors to you?

@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91

Quetzacoalt91 Mar 6, 2017

Member

Hello,

On the default theme, the function bindGrid() handles properly the non-existing storage and returns before executing anything related to the view:

function bindGrid()
{
    console.log('bindGrid() called');
	var storage = false;
	if (typeof(getStorageAvailable) !== 'undefined') {
		storage = getStorageAvailable();
	}
	if (!storage) {
		return; // <- returns here
	}

Console output:
capture d ecran 2017-03-06 a 11 18 46

Member

Quetzacoalt91 commented Mar 6, 2017

Hello,

On the default theme, the function bindGrid() handles properly the non-existing storage and returns before executing anything related to the view:

function bindGrid()
{
    console.log('bindGrid() called');
	var storage = false;
	if (typeof(getStorageAvailable) !== 'undefined') {
		storage = getStorageAvailable();
	}
	if (!storage) {
		return; // <- returns here
	}

Console output:
capture d ecran 2017-03-06 a 11 18 46

@mcdado

This comment has been minimized.

Show comment
Hide comment
@mcdado

mcdado Mar 6, 2017

Contributor

That's right, it was already implemented… 6528fe9

Well, then let me amend my commits and do just the line ending fixes

Contributor

mcdado commented Mar 6, 2017

That's right, it was already implemented… 6528fe9

Well, then let me amend my commits and do just the line ending fixes

@mcdado mcdado changed the title from Fix localStorage JS Error in Safari Private Windows to Fix line endings in theme's JS files Mar 6, 2017

@mcdado

This comment has been minimized.

Show comment
Hide comment
@mcdado

mcdado Mar 6, 2017

Contributor

Okay I deleted the extra change, now it's only linde endings.

Contributor

mcdado commented Mar 6, 2017

Okay I deleted the extra change, now it's only linde endings.

@Quetzacoalt91

All right, this PR can now be merged.

@Quetzacoalt91 Quetzacoalt91 self-assigned this Mar 8, 2017

@mcdado

This comment has been minimized.

Show comment
Hide comment
@mcdado

mcdado Mar 14, 2017

Contributor

Rebased on top of 1.6.1.x.

Contributor

mcdado commented Mar 14, 2017

Rebased on top of 1.6.1.x.

@xBorderie

This comment has been minimized.

Show comment
Hide comment
@xBorderie

xBorderie Mar 14, 2017

Contributor

Cheers David! 🎉

Contributor

xBorderie commented Mar 14, 2017

Cheers David! 🎉

@xBorderie xBorderie added this to the 1.6.1.15 milestone Apr 25, 2017

@eternoendless eternoendless added the Bug label Jun 15, 2017

@maximebiloe maximebiloe merged commit 989e992 into PrestaShop:1.6.1.x Jun 21, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@maximebiloe

This comment has been minimized.

Show comment
Hide comment
@maximebiloe

maximebiloe Jun 21, 2017

Contributor

Thank you @mcdado

Contributor

maximebiloe commented Jun 21, 2017

Thank you @mcdado

@mcdado mcdado deleted the mcdado:fix-localstorage-error branch Jun 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment