Skip to content

Commit

Permalink
Merge pull request #1085 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
[EngCom] Public Pull Requests

 - MAGETWO-68979: Fix breadcrumbs extra space #9514
 - MAGETWO-68977: fix for Class Magento\Framework\Console\CLI not found in case sensitive scenarios #9539
 - MAGETWO-68861: Fix data deletion using the multiple delete command #9446
 - MAGETWO-67722: Add ability to inject exception code in LocalizedException #9363
  • Loading branch information
ishakhsuvarov authored May 9, 2017
2 parents 62667cb + 17c761b commit b6fb045
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Magento\Cron\Observer;

use Magento\Framework\App\State;
use Magento\Framework\Console\CLI;
use Magento\Framework\Console\Cli;
use Magento\Framework\Event\ObserverInterface;
use \Magento\Cron\Model\Schedule;

Expand Down Expand Up @@ -188,7 +188,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
) == 1
)) {
$this->_shell->execute(
$phpPath . ' %s cron:run --group=' . $groupId . ' --' . CLI::INPUT_KEY_BOOTSTRAP . '='
$phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
. self::STANDALONE_PROCESS_STARTED . '=1',
[
BP . '/bin/magento'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
<li class="item <?php /* @escapeNotVerified */ echo $crumbName ?>">
<?php if ($crumbInfo['link']) : ?>
<a href="<?php /* @escapeNotVerified */ echo $crumbInfo['link'] ?>" title="<?php echo $block->escapeHtml($crumbInfo['title']) ?>">
<?php echo $block->escapeHtml($crumbInfo['label']) ?>
</a>
<a href="<?php /* @escapeNotVerified */ echo $crumbInfo['link'] ?>" title="<?php echo $block->escapeHtml($crumbInfo['title']) ?>"><?php echo $block->escapeHtml($crumbInfo['label']) ?></a>
<?php elseif ($crumbInfo['last']) : ?>
<strong><?php echo $block->escapeHtml($crumbInfo['label']) ?></strong>
<?php else: ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ class LocalizedException extends \Exception
protected $logMessage;

/**
* Constructor
*
* @param \Magento\Framework\Phrase $phrase
* @param \Exception $cause
* @param int $code
*/
public function __construct(Phrase $phrase, \Exception $cause = null)
public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0)
{
$this->phrase = $phrase;
parent::__construct($phrase->render(), 0, $cause);
parent::__construct($phrase->render(), intval($code), $cause);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,16 @@ public function testGetLogMessage()
$expectedLogMessage = 'message parameter1 parameter2';
$this->assertEquals($expectedLogMessage, $localizeException->getLogMessage());
}

public function testGetCode()
{
$expectedCode = 42;
$localizedException = new LocalizedException(
new Phrase("message %1", ['test']),
new \Exception(),
$expectedCode
);

$this->assertEquals($expectedCode, $localizedException->getCode());
}
}
2 changes: 1 addition & 1 deletion setup/src/Magento/Setup/Model/UninstallCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function collectUninstall($filterModules = [])
$setup = $this->dataSetupFactory->create();
$result = $setup->getConnection()->select()->from($setup->getTable('setup_module'), ['module']);
if (isset($filterModules) && sizeof($filterModules) > 0) {
$result->where('module in( ? )', implode(',', $filterModules));
$result->where('module in( ? )', $filterModules);
}
// go through modules
foreach ($setup->getConnection()->fetchAll($result) as $row) {
Expand Down

0 comments on commit b6fb045

Please sign in to comment.