Skip to content

Commit 08b8956

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #15171: AD-HOC feat (Profiler): Allow supplying complex profiler configuration (by @andrewhowdencom) - #16855: Doesn't work if use date as condition for Catalog Price Rules (by @GlennCheng)
2 parents f66f469 + e521de5 commit 08b8956

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

app/bootstrap.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@
5454
&& isset($_SERVER['HTTP_ACCEPT'])
5555
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
5656
) {
57-
$profilerFlag = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
57+
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
5858
? $_SERVER['MAGE_PROFILER']
5959
: trim(file_get_contents(BP . '/var/profiler.flag'));
6060

61-
\Magento\Framework\Profiler::applyConfig(
62-
$profilerFlag,
61+
if ($profilerConfig) {
62+
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
63+
}
64+
65+
Magento\Framework\Profiler::applyConfig(
66+
$profilerConfig,
6367
BP,
6468
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
6569
);

app/code/Magento/CatalogRule/Model/Rule/Condition/Product.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ protected function _prepareDatetimeValue($value, \Magento\Framework\Model\Abstra
9999
{
100100
$attribute = $model->getResource()->getAttribute($this->getAttribute());
101101
if ($attribute && $attribute->getBackendType() == 'datetime') {
102+
if (!$value) {
103+
return null;
104+
}
105+
$this->setValue(strtotime($this->getValue()));
102106
$value = strtotime($value);
103107
}
104108

0 commit comments

Comments
 (0)