Skip to content

Commit

Permalink
Use nowdoc instead of heredoc because $this is a valid PHP variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
fnogatz committed Feb 23, 2021
1 parent 2e2af0a commit c8a5013
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ script;
setLocation(url);
';
} else {
$scriptString .= <<<script
$scriptString .= <<<'script'
jQuery('#preview_selected_store').val(scopeId);
jQuery('#preview_form').submit();
Expand Down

4 comments on commit c8a5013

@mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented on c8a5013 Mar 11, 2021

Choose a reason for hiding this comment

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

Seem i got regression issue with this change after enabled minify html (production). Admin got error message block owner access dashboard
Here is my env.config setup

'dev' => [
'static' => [
'sign' => '1'
],
'template' => [
'minify_html' => '1'
],
'js' => [
'enable_js_bundling' => '0',
'merge_files' => '0',
'minify_files' => '1',
'move_script_to_bottom' => '1'
],
'css' => [
'merge_css_files' => '0',
'minify_files' => '1',
'use_css_critical_path' => '1'
]
],

Here is the log
ParseError: syntax error, unexpected '<<' (T_SL) in /var/www/html/var/view_preprocessed/pub/static/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml:45

CC @fnogatz

@mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented on c8a5013 Mar 11, 2021

Choose a reason for hiding this comment

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

switcher.val(val).trigger('change'); // Set the value & trigger event

Comment like should change to avoid break in JS in minify
From
// Set the value & trigger event
To
/* Set the value & trigger event */
CC: @ihor-sviziev

@ihor-sviziev
Copy link
Contributor

Choose a reason for hiding this comment

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

@mrtuvn could you create a pull request for fixing that?

@mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented on c8a5013 Mar 11, 2021

Choose a reason for hiding this comment

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

In my opinion i think this should need refactor to seperate js out. We pass data via php only in phtml to js file

Please sign in to comment.