Skip to content
Snippets Groups Projects
Unverified Commit 816ec39b authored by Magento 2 Team's avatar Magento 2 Team Committed by GitHub
Browse files

:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop

Accepted Public Pull Requests:
 - magento/magento2#12752: magento/magento2#4292: Ability to sitch to default mode (by @Etty)
 - magento/magento2#12963: Sort configurable attribute options by sort_order (by @wardcapp)
 - magento/magento2#12953: [Backport to 2.2-develop] Fix #2156 Js\Dataprovider uses the RendererInterface. (by @dverkade)
 - magento/magento2#12521: Match flexible static file version in nginx sample config (by @scottsb)


Fixed GitHub Issues:
 - magento/magento2#4292: Why can't one switch back to default mode ? (reported by @digitalpianism) has been fixed in magento/magento2#12752 by @Etty in 2.2-develop branch
   Related commits:
     1. ba219b84

 - magento/magento2#7441: Configurable attribute options are not sorted (reported by @DariuszMaciejewski) has been fixed in magento/magento2#12963 by @wardcapp in 2.2-develop branch
   Related commits:
     1. 9794d38f

 - magento/magento2#2156: Why does \Magento\Translation\Model\Js\DataProvider use \Magento\Framework\Phrase\Renderer\Translate, not \Magento\Framework\Phrase\Renderer\Composite? (reported by @dmitry-fedyuk) has been fixed in magento/magento2#12953 by @dverkade in 2.2-develop branch
   Related commits:
     1. cfce6310
parents 79d8e9a0 ec6281c5
Branches
No related merge requests found
......@@ -91,6 +91,12 @@ class OptionSelectBuilder implements OptionSelectBuilderInterface
]
),
[]
)->joinInner(
['attribute_option' => $this->attributeResource->getTable('eav_attribute_option')],
'attribute_option.option_id = entity_value.value',
[]
)->order(
'attribute_option.sort_order ASC'
)->where(
'super_attribute.product_id = ?',
$productId
......
......@@ -66,7 +66,7 @@ class OptionSelectBuilderTest extends \PHPUnit\Framework\TestCase
->disableOriginalConstructor()
->getMockForAbstractClass();
$this->select = $this->getMockBuilder(Select::class)
->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns'])
->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns', 'order'])
->disableOriginalConstructor()
->getMock();
$this->connectionMock->expects($this->atLeastOnce())
......@@ -112,10 +112,28 @@ class OptionSelectBuilderTest extends \PHPUnit\Framework\TestCase
{
$this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('columns')->willReturnSelf();
$this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(3))->method('joinLeft')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('order')->willReturnSelf();
$this->select->expects($this->exactly(2))->method('where')->willReturnSelf();
$this->attributeResourceMock->expects($this->exactly(9))
->method('getTable')
->will(
$this->returnValueMap(
[
['catalog_product_super_attribute', 'catalog_product_super_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_link', 'catalog_product_super_link value'],
['eav_attribute', 'eav_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'],
['eav_attribute_option', 'eav_attribute_option value'],
['eav_attribute_option_value', 'eav_attribute_option_value value']
]
)
);
$this->abstractAttributeMock->expects($this->atLeastOnce())
->method('getAttributeId')
->willReturn('getAttributeId value');
......@@ -138,10 +156,27 @@ class OptionSelectBuilderTest extends \PHPUnit\Framework\TestCase
{
$this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
$this->select->expects($this->exactly(0))->method('columns')->willReturnSelf();
$this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('joinLeft')->willReturnSelf();
$this->select->expects($this->exactly(1))->method('order')->willReturnSelf();
$this->select->expects($this->exactly(2))->method('where')->willReturnSelf();
$this->attributeResourceMock->expects($this->exactly(7))
->method('getTable')
->will(
$this->returnValueMap(
[
['catalog_product_super_attribute', 'catalog_product_super_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_link', 'catalog_product_super_link value'],
['eav_attribute', 'eav_attribute value'],
['catalog_product_entity', 'catalog_product_entity value'],
['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'],
['eav_attribute_option', 'eav_attribute_option value']
]
)
);
$this->abstractAttributeMock->expects($this->atLeastOnce())
->method('getAttributeId')
->willReturn('getAttributeId value');
......
......@@ -101,6 +101,9 @@ class SetModeCommand extends Command
$modeController->enableProductionMode();
}
break;
case State::MODE_DEFAULT:
$modeController->enableDefaultMode();
break;
default:
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
}
......
......@@ -177,6 +177,25 @@ class Mode
$this->setStoreMode(State::MODE_DEVELOPER);
}
/**
* Enable Default mode
*
* @return void
*/
public function enableDefaultMode()
{
$this->filesystem->cleanupFilesystem(
[
DirectoryList::CACHE,
DirectoryList::GENERATED_CODE,
DirectoryList::GENERATED_METADATA,
DirectoryList::TMP_MATERIALIZATION_DIR,
DirectoryList::STATIC_VIEW,
]
);
$this->setStoreMode(State::MODE_DEFAULT);
}
/**
* Get current mode information
*
......
......@@ -67,6 +67,18 @@ class SetModeCommandTest extends \PHPUnit\Framework\TestCase
);
}
public function testSetDefaultMode()
{
$this->modeMock->expects($this->once())->method('enableDefaultMode');
$tester = new CommandTester($this->command);
$tester->execute(['mode' => 'default']);
$this->assertContains(
"default mode",
$tester->getDisplay()
);
}
public function testSetProductionSkipCompilation()
{
$this->modeMock->expects($this->once())->method('enableProductionModeMinimal');
......
......@@ -46,7 +46,7 @@ class DataProvider implements DataProviderInterface
/**
* Basic translate renderer
*
* @var \Magento\Framework\Phrase\Renderer\Translate
* @var \Magento\Framework\Phrase\RendererInterface
*/
protected $translate;
......@@ -54,7 +54,7 @@ class DataProvider implements DataProviderInterface
* @param \Magento\Framework\App\State $appState
* @param Config $config
* @param \Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory
* @param \Magento\Framework\Phrase\Renderer\Translate $translate
* @param \Magento\Framework\Phrase\RendererInterface $translate
* @param \Magento\Framework\Component\ComponentRegistrar $componentRegistrar
* @param \Magento\Framework\Component\DirSearch $dirSearch
* @param \Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList
......@@ -64,7 +64,7 @@ class DataProvider implements DataProviderInterface
\Magento\Framework\App\State $appState,
Config $config,
\Magento\Framework\Filesystem\File\ReadFactory $fileReadFactory,
\Magento\Framework\Phrase\Renderer\Translate $translate,
\Magento\Framework\Phrase\RendererInterface $translate,
\Magento\Framework\Component\ComponentRegistrar $componentRegistrar,
\Magento\Framework\Component\DirSearch $dirSearch,
\Magento\Framework\View\Design\Theme\ThemePackageList $themePackageList,
......
......@@ -13,7 +13,7 @@ class InlineTest extends \PHPUnit\Framework\TestCase
protected $translator;
/**
* @var \Magento\Framework\Phrase\Renderer\Translate
* @var \Magento\Framework\Phrase\Renderer\Inline
*/
protected $renderer;
......
......@@ -100,7 +100,7 @@ location /static/ {
# Remove signature of the static files that is used to overcome the browser cache
location ~ ^/static/version {
rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last;
}
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment