Skip to content

Commit e49f7c1

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #17163: Add meta NOINDEX,NOFOLLOW to admin scope to avoid accidental crawling (by @cmtickle) - #17124: Using interface instead of model directly (by @woutersamaey) - #16468: #16273: Fix bug in method getUrlInStore() of product model (by @vasilii-b) - #16401: Remove PDF files after generation (by @rogyar) - #15687: Fixes for #15393 (by @simonjanguapa) Fixed GitHub Issues: - #16273: Method $product->getUrlInStore() returning extremely long URLs, could be a bug (reported by @adampmoss) has been fixed in #16468 by @vasilii-b in 2.2-develop branch Related commits: 1. 1115b3f 2. 03afbc7 3. 7e3c3fc 4. 66ee827 5. 846f605 6. 65b735b - #3535: Print pdf don't delete file in var folder (reported by @quienti) has been fixed in #16401 by @rogyar in 2.2-develop branch Related commits: 1. 4989d8b 2. 9366da9 3. 70fed74 4. 31df140 5. 25d49eb - #14517: PDF invoices in /var folder (reported by @erichagz) has been fixed in #16401 by @rogyar in 2.2-develop branch Related commits: 1. 4989d8b 2. 9366da9 3. 70fed74 4. 31df140 5. 25d49eb - #15393: "Multiple Select" product attributes do not render HTML tags on the storefront view (reported by @jurpro) has been fixed in #15687 by @simonjanguapa in 2.2-develop branch Related commits: 1. a49618a 2. 28159a3 3. edb3516
2 parents 327d9d5 + 1253195 commit e49f7c1

File tree

20 files changed

+170
-35
lines changed

20 files changed

+170
-35
lines changed

app/code/Magento/Catalog/Helper/Output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function productAttribute($product, $attributeHtml, $attributeName)
151151
$attributeHtml = nl2br($attributeHtml);
152152
}
153153
}
154-
if ($attribute->getIsHtmlAllowedOnFront() && $attribute->getIsWysiwygEnabled()) {
154+
if ($attribute->getIsHtmlAllowedOnFront() || $attribute->getIsWysiwygEnabled()) {
155155
if ($this->_catalogData->isUrlDirectivesParsingAllowed()) {
156156
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
157157
}

app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ public function getOptionText($value)
167167
$optionsText = [];
168168
foreach ($options as $item) {
169169
if (in_array($item['value'], $value)) {
170-
$optionsText[] = $this->escaper->escapeHtml($item['label']);
170+
$optionsText[] = ($this->_attribute->getIsHtmlAllowedOnFront())
171+
? $item['label']
172+
: $this->escaper->escapeHtml($item['label']);
171173
}
172174
}
173175

app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/Pdfcreditmemos.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ public function __construct(
7474
*/
7575
public function massAction(AbstractCollection $collection)
7676
{
77+
$pdf = $this->pdfCreditmemo->getPdf($collection);
78+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
79+
7780
return $this->fileFactory->create(
7881
sprintf('creditmemo%s.pdf', $this->dateTime->date('Y-m-d_H-i-s')),
79-
$this->pdfCreditmemo->getPdf($collection)->render(),
82+
$fileContent,
8083
DirectoryList::VAR_DIR,
8184
'application/pdf'
8285
);

app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/PrintAction.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function __construct(
5353

5454
/**
5555
* @return ResponseInterface|\Magento\Backend\Model\View\Result\Forward
56+
* @throws \Exception
5657
*/
5758
public function execute()
5859
{
@@ -69,9 +70,11 @@ public function execute()
6970
$date = $this->_objectManager->get(
7071
\Magento\Framework\Stdlib\DateTime\DateTime::class
7172
)->date('Y-m-d_H-i-s');
73+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
74+
7275
return $this->_fileFactory->create(
7376
\creditmemo::class . $date . '.pdf',
74-
$pdf->render(),
77+
$fileContent,
7578
DirectoryList::VAR_DIR,
7679
'application/pdf'
7780
);

app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice/Pdfinvoices.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ public function __construct(
7575
*/
7676
public function massAction(AbstractCollection $collection)
7777
{
78+
$pdf = $this->pdfInvoice->getPdf($collection);
79+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
80+
7881
return $this->fileFactory->create(
7982
sprintf('invoice%s.pdf', $this->dateTime->date('Y-m-d_H-i-s')),
80-
$this->pdfInvoice->getPdf($collection)->render(),
83+
$fileContent,
8184
DirectoryList::VAR_DIR,
8285
'application/pdf'
8386
);

app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice/PrintAction.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function __construct(
4545

4646
/**
4747
* @return ResponseInterface|void
48+
* @throws \Exception
4849
*/
4950
public function execute()
5051
{
@@ -58,9 +59,11 @@ public function execute()
5859
$date = $this->_objectManager->get(
5960
\Magento\Framework\Stdlib\DateTime\DateTime::class
6061
)->date('Y-m-d_H-i-s');
62+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
63+
6164
return $this->_fileFactory->create(
6265
'invoice' . $date . '.pdf',
63-
$pdf->render(),
66+
$fileContent,
6467
DirectoryList::VAR_DIR,
6568
'application/pdf'
6669
);

app/code/Magento/Sales/Controller/Adminhtml/Order/Pdfcreditmemos.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function __construct(
7676
*
7777
* @param AbstractCollection $collection
7878
* @return ResponseInterface|ResultInterface
79+
* @throws \Exception
7980
*/
8081
protected function massAction(AbstractCollection $collection)
8182
{
@@ -85,9 +86,12 @@ protected function massAction(AbstractCollection $collection)
8586
$this->messageManager->addError(__('There are no printable documents related to selected orders.'));
8687
return $this->resultRedirectFactory->create()->setPath($this->getComponentRefererUrl());
8788
}
89+
$pdf = $this->pdfCreditmemo->getPdf($creditmemoCollection->getItems());
90+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
91+
8892
return $this->fileFactory->create(
8993
sprintf('creditmemo%s.pdf', $this->dateTime->date('Y-m-d_H-i-s')),
90-
$this->pdfCreditmemo->getPdf($creditmemoCollection->getItems())->render(),
94+
$fileContent,
9195
DirectoryList::VAR_DIR,
9296
'application/pdf'
9397
);

app/code/Magento/Sales/Controller/Adminhtml/Order/Pdfdocs.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function __construct(
113113
* @return ResponseInterface|\Magento\Backend\Model\View\Result\Redirect
114114
*
115115
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
116+
* @throws \Exception
116117
*/
117118
protected function massAction(AbstractCollection $collection)
118119
{
@@ -142,10 +143,11 @@ protected function massAction(AbstractCollection $collection)
142143
foreach ($documents as $document) {
143144
$pdf->pages = array_merge($pdf->pages, $document->pages);
144145
}
146+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
145147

146148
return $this->fileFactory->create(
147149
sprintf('docs%s.pdf', $this->dateTime->date('Y-m-d_H-i-s')),
148-
$pdf->render(),
150+
$fileContent,
149151
DirectoryList::VAR_DIR,
150152
'application/pdf'
151153
);

app/code/Magento/Sales/Controller/Adminhtml/Order/Pdfinvoices.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function __construct(
7575
*
7676
* @param AbstractCollection $collection
7777
* @return ResponseInterface|ResultInterface
78+
* @throws \Exception
7879
*/
7980
protected function massAction(AbstractCollection $collection)
8081
{
@@ -83,9 +84,12 @@ protected function massAction(AbstractCollection $collection)
8384
$this->messageManager->addError(__('There are no printable documents related to selected orders.'));
8485
return $this->resultRedirectFactory->create()->setPath($this->getComponentRefererUrl());
8586
}
87+
$pdf = $this->pdfInvoice->getPdf($invoicesCollection->getItems());
88+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
89+
8690
return $this->fileFactory->create(
8791
sprintf('invoice%s.pdf', $this->dateTime->date('Y-m-d_H-i-s')),
88-
$this->pdfInvoice->getPdf($invoicesCollection->getItems())->render(),
92+
$fileContent,
8993
DirectoryList::VAR_DIR,
9094
'application/pdf'
9195
);

app/code/Magento/Sales/Controller/Adminhtml/Order/Pdfshipments.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public function __construct(
7777
*
7878
* @param AbstractCollection $collection
7979
* @return ResponseInterface|\Magento\Backend\Model\View\Result\Redirect
80+
* @throws \Exception
8081
*/
8182
protected function massAction(AbstractCollection $collection)
8283
{
@@ -87,9 +88,13 @@ protected function massAction(AbstractCollection $collection)
8788
$this->messageManager->addError(__('There are no printable documents related to selected orders.'));
8889
return $this->resultRedirectFactory->create()->setPath($this->getComponentRefererUrl());
8990
}
91+
92+
$pdf = $this->pdfShipment->getPdf($shipmentsCollection->getItems());
93+
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];
94+
9095
return $this->fileFactory->create(
9196
sprintf('packingslip%s.pdf', $this->dateTime->date('Y-m-d_H-i-s')),
92-
$this->pdfShipment->getPdf($shipmentsCollection->getItems())->render(),
97+
$fileContent,
9398
DirectoryList::VAR_DIR,
9499
'application/pdf'
95100
);

0 commit comments

Comments
 (0)