-
Notifications
You must be signed in to change notification settings - Fork 9.4k
fix: do not forcefully set area in template if it is already set, fixes #14968, fixes #13530 #15137
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
Changes from all commits
0ae1230
3df51d4
0dec988
d92b679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -534,10 +534,9 @@ protected function cancelDesignConfig() | |
*/ | ||
public function setForcedArea($templateId) | ||
{ | ||
if ($this->area) { | ||
throw new \LogicException(__('Area is already set')); | ||
if (!isset($this->area)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that I knew, it is either set or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, then simplify condition please. Commit amend is preferable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. empty and isset check are different, what should I change here? It can just be null or set and isset checks for it already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DanielRuf I meant that there is no reason to change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isset is more strict and still correct so I think we can keep it like this. |
||
$this->area = $this->emailConfig->getTemplateArea($templateId); | ||
} | ||
$this->area = $this->emailConfig->getTemplateArea($templateId); | ||
return $this; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there any logic in this exception before? Any idea why it was introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was still the original code from 3 years ago which was untouched. The annotations and exception class are not correct imo but should be solved in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the blame view of the file in the original repo and you see that the code was never really touched ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielRuf Is there any patch available for temporary. I need to fix this in my Magento v.2.2.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hitesh-wagento simply add
.patch
to the pull/number URL and you get https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/15137.patch