Skip to content

Commit f7731d5

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - #16923: [Backport] Fix docBlock for hasInvoices(), hasShipments(), hasCreditmemos() (by @eduard13) - #16917: [Backport] Issue 5316 (by @ronak2ram) Fixed GitHub Issues: - #5316: [2.1.0] HTML minification problem with php tag with a comment and no space at the end (reported by @hostep) has been fixed in #16917 by @ronak2ram in 2.1-develop branch Related commits: 1. 28ef78d 2. 433a9c3
2 parents bfbdfa5 + c32a426 commit f7731d5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

app/code/Magento/Sales/Model/Order.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ public function getTracksCollection()
17701770
*/
17711771
public function hasInvoices()
17721772
{
1773-
return $this->getInvoiceCollection()->count();
1773+
return boolval($this->getInvoiceCollection()->count());
17741774
}
17751775

17761776
/**
@@ -1780,7 +1780,7 @@ public function hasInvoices()
17801780
*/
17811781
public function hasShipments()
17821782
{
1783-
return $this->getShipmentsCollection()->count();
1783+
return boolval($this->getShipmentsCollection()->count());
17841784
}
17851785

17861786
/**
@@ -1790,7 +1790,7 @@ public function hasShipments()
17901790
*/
17911791
public function hasCreditmemos()
17921792
{
1793-
return $this->getCreditmemosCollection()->count();
1793+
return boolval($this->getCreditmemosCollection()->count());
17941794
}
17951795

17961796
/**

lib/internal/Magento/Framework/View/Template/Html/Minifier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ public function minify($file)
131131
'#(?<!:|\\\\|\'|")//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
132132
'',
133133
preg_replace(
134-
'#(?<!:|\'|")//[^\n\r]*(\s\?\>)#',
135-
'$1',
134+
'#(?<!:|\'|")//[^\n\r]*(\?\>)#',
135+
' $1',
136136
preg_replace(
137137
'#(?<!:)//[^\n\r]*(\<\?php)[^\n\r]*(\s\?\>)[^\n\r]*#',
138138
'',

lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ public function testMinify()
155155
<?php echo '//some.link.com/' ?>
156156
<em>inline text</em>
157157
<a href="http://www.<?php echo 'hi' ?>"></a>
158+
<?php// if (\$block->getSomeVariable() > 1):?>
159+
<?php echo \$block->getChildHtml('someChildBlock'); ?>
160+
<?php //else:?>
161+
<?php // echo \$block->getChildHtml('anotherChildBlock'); ?>
162+
<?php // endif; ?>
158163
</body>
159164
</html>
160165
TEXT;
@@ -178,7 +183,7 @@ public function testMinify()
178183
}
179184
});
180185
//]]>
181-
</script><?php echo "http://some.link.com/" ?> <?php echo "//some.link.com/" ?> <?php echo '//some.link.com/' ?> <em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a></body></html>
186+
</script><?php echo "http://some.link.com/" ?> <?php echo "//some.link.com/" ?> <?php echo '//some.link.com/' ?> <em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a> <?php ?> <?php echo \$block->getChildHtml('someChildBlock'); ?> <?php ?> <?php ?> <?php ?></body></html>
182187
TEXT;
183188

184189
$this->appDirectoryMock->expects($this->once())

0 commit comments

Comments
 (0)