Skip to content

Commit 84230b9

Browse files
author
Alexander Akimov
authored
Merge pull request #2207 from magento-plankton/forwardports
[Plankton] Forwardports
2 parents 7acc042 + 0883d68 commit 84230b9

File tree

10 files changed

+518
-84
lines changed

10 files changed

+518
-84
lines changed

app/code/Magento/Config/Block/System/Config/Form.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Config\App\Config\Type\System;
99
use Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker;
1010
use Magento\Config\Model\Config\Structure\ElementVisibilityInterface;
11+
use Magento\Framework\App\Config\Data\ProcessorInterface;
1112
use Magento\Framework\App\Config\ScopeConfigInterface;
1213
use Magento\Framework\App\DeploymentConfig;
1314
use Magento\Framework\App\ObjectManager;
@@ -425,23 +426,21 @@ private function getFieldData(\Magento\Config\Model\Config\Structure\Element\Fie
425426
if ($placeholderValue) {
426427
$data = $placeholderValue;
427428
}
428-
if ($data === null) {
429-
if (array_key_exists($path, $this->_configData)) {
430-
$data = $this->_configData[$path];
431-
} elseif ($field->getConfigPath() !== null) {
432-
$data = $this->getConfigValue($field->getConfigPath());
433-
} else {
434-
$data = $this->getConfigValue($path);
435-
}
436429

430+
if ($data === null) {
431+
$path = $field->getConfigPath() !== null ? $field->getConfigPath() : $path;
432+
$data = $this->getConfigValue($path);
437433
if ($field->hasBackendModel()) {
438434
$backendModel = $field->getBackendModel();
439-
$backendModel->setPath($path)
440-
->setValue($data)
441-
->setWebsite($this->getWebsiteCode())
442-
->setStore($this->getStoreCode())
443-
->afterLoad();
444-
$data = $backendModel->getValue();
435+
// Backend models which implement ProcessorInterface are processed by ScopeConfigInterface
436+
if (!$backendModel instanceof ProcessorInterface) {
437+
$backendModel->setPath($path)
438+
->setValue($data)
439+
->setWebsite($this->getWebsiteCode())
440+
->setStore($this->getStoreCode())
441+
->afterLoad();
442+
$data = $backendModel->getValue();
443+
}
445444
}
446445
}
447446

app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,8 @@ public function initFieldsDataProvider()
546546
return [
547547
[
548548
['section1/group1/field1' => 'some_value'],
549-
false,
550-
null,
549+
'some_value',
550+
'section1/group1/field1',
551551
false,
552552
'some_value',
553553
null,

app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Save.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public function execute()
6363
}
6464
$resultRedirect->setPath('sales/*/');
6565
} catch (\Magento\Framework\Exception\LocalizedException $e) {
66+
// customer can be created before place order flow is completed and should be stored in current session
67+
$this->_getSession()->setCustomerId($this->_getSession()->getQuote()->getCustomerId());
6668
$message = $e->getMessage();
6769
if (!empty($message)) {
6870
$this->messageManager->addError($message);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Config\Block\System\Config;
7+
8+
use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;
9+
10+
/**
11+
* Backend system config array field renderer for integration test.
12+
*/
13+
class FieldArray extends AbstractFieldArray
14+
{
15+
/**
16+
* @inheritdoc
17+
*/
18+
protected function _toHtml()
19+
{
20+
$value = '';
21+
$element = $this->getElement();
22+
if ($element->getValue() && is_array($element->getValue())) {
23+
$value = implode('|', $element->getValue());
24+
}
25+
26+
return sprintf(
27+
'<input id="%s" name="%s" value="%s" />',
28+
$element->getId(),
29+
$element->getName(),
30+
$value
31+
);
32+
}
33+
}

0 commit comments

Comments
 (0)