Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions app/code/Magento/CatalogSearch/Block/Advanced/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,11 @@ public function getCurrencyCount()
*
* @param AbstractAttribute $attribute
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getCurrency($attribute)
{
return $this->_storeManager->getStore()->getCurrentCurrencyCode();

$baseCurrency = $this->_storeManager->getStore()->getBaseCurrency()->getCurrencyCode();
return $this->getAttributeValue(
$attribute,
'currency'
) ? $this->getAttributeValue(
$attribute,
'currency'
) : $baseCurrency;
}

/**
Expand Down
11 changes: 4 additions & 7 deletions app/code/Magento/MediaStorage/Model/File/Storage/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,10 @@ public function saveDir($dir)
*/
public function saveFile($file, $overwrite = true)
{
if (isset(
$file['filename']
) && !empty($file['filename']) && isset(
$file['content']
) && !empty($file['content'])
if (isset($file['filename'])
&& !empty($file['filename'])
&& isset($file['content'])
&& !empty($file['content'])
) {
try {
$filename = isset(
Expand All @@ -307,8 +306,6 @@ public function saveFile($file, $overwrite = true)
} else {
throw new \Magento\Framework\Exception\LocalizedException(__('Wrong file info format'));
}

return false;
}

/**
Expand Down
13 changes: 1 addition & 12 deletions app/code/Magento/Sales/Model/Service/CreditmemoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,11 @@ public function __construct(
* @param int $id Credit Memo Id
* @return bool
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function cancel($id)
{
throw new \Magento\Framework\Exception\LocalizedException(__('You can not cancel Credit Memo'));
try {
$creditmemo = $this->creditmemoRepository->get($id);
$creditmemo->setState(\Magento\Sales\Model\Order\Creditmemo::STATE_CANCELED);
foreach ($creditmemo->getAllItems() as $item) {
$item->cancel();
}
$this->eventManager->dispatch('sales_order_creditmemo_cancel', ['creditmemo' => $creditmemo]);
$this->creditmemoRepository->save($creditmemo);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('Could not cancel creditmemo'), $e);
}
return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ public function getRemoveUrl($track)
public function getCarrierTitle($code)
{
$carrier = $this->_carrierFactory->create($code);
if ($carrier) {
return $carrier->getConfigData('title');
} else {
return __('Custom Value');
}
return false;
return $carrier ? $carrier->getConfigData('title') : __('Custom Value');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ public function execute()
$this->_redirect('adminhtml/*/edit', ['_current' => true]);
return;
}
$this->_redirect('adminhtml/*/');
return;
}
}