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

Fix line endings in theme's JS files #7607

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

mcdado
Copy link
Contributor

@mcdado 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
Copy link
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 :)

@mcdado
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
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

@mcdado
Copy link
Contributor Author

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
Copy link
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
Copy link
Contributor Author

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 Fix localStorage JS Error in Safari Private Windows Fix line endings in theme's JS files Mar 6, 2017
@mcdado
Copy link
Contributor Author

mcdado commented Mar 6, 2017

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

Copy link
Member

@Quetzacoalt91 Quetzacoalt91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, this PR can now be merged.

@Quetzacoalt91 Quetzacoalt91 self-assigned this Mar 8, 2017
@mcdado
Copy link
Contributor Author

mcdado commented Mar 14, 2017

Rebased on top of 1.6.1.x.

@xBorderie
Copy link
Contributor

Cheers David! 🎉

@xBorderie xBorderie added this to the 1.6.1.15 milestone Apr 25, 2017
@eternoendless eternoendless added the Bug Type: Bug label Jun 15, 2017
@maximebiloe maximebiloe merged commit 989e992 into PrestaShop:1.6.1.x Jun 21, 2017
@maximebiloe
Copy link
Contributor

Thank you @mcdado

@mcdado mcdado deleted the fix-localstorage-error branch June 21, 2017 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants