-
Notifications
You must be signed in to change notification settings - Fork 58
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
[NEW] upload media to order #153
base: master
Are you sure you want to change the base?
[NEW] upload media to order #153
Conversation
Thanks, but your code contains a lot of commented code and Laravel specific code as well as changed files not related to the feature. Can you clean up your PR first? |
<div class="upload-wrapper"> | ||
<div class="upload-view" | ||
data-title="<?= $enc->html( $this->translate( 'client/code', $attribute->getName() ) ) ?>" | ||
onclick="document.querySelector('#upload-<?= $enc->attr( $this->productItem->getId() . '-' . $key ) ?>').click()" |
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.
No inline JS please because this won't work because of Content Security Policy rules
$fs->writes($filepath, $stream); | ||
fclose($stream); | ||
} catch (\Exception $ex) { | ||
Log::error($ex->getMessage()); |
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.
Log::error()
is also Laravel specific. Use $this->getContext()->logger()->log()
instead
foreach ($entries[$i]['attrcustid'][$attrId] as $file) { | ||
$filepath = 'basket-upload/' . md5($file->getFilename() . microtime(true)) . '.' . $file->extension(); | ||
try { | ||
$stream = fopen($file->getRealPath(), 'r+'); |
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.
Please check return value of fopen()
@@ -87,6 +87,36 @@ | |||
|
|||
|
|||
?> | |||
<script type="text/javascript"> |
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.
Inline JS doesn't work with CSP and must be moved to the JS file
No description provided.