Skip to content

Commit 2842e92

Browse files
Merge pull request #399 from magento-frontend/Kanban-2-PR-2.2
Bugs MAGETWO-56915 Versioning of static files (CSS, JS, Fonts, Images, etc.) doesn't enabled by default - for mainline MAGETWO-58367 Pattern in elements.xsd is too strict [GITHUB PR#6283] MAGETWO-58371 Use inline elements for inline links [GITHUB PR#1988]
2 parents 52c4963 + 3a2023f commit 2842e92

File tree

14 files changed

+47
-35
lines changed

14 files changed

+47
-35
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/widget/link/link_inline.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
// @codingStandardsIgnoreFile
88
?>
9-
<div class="widget block block-product-link-inline">
9+
<span class="widget block block-product-link-inline">
1010
<a <?php /* @escapeNotVerified */ echo $block->getLinkAttributes() ?>><span><?php echo $block->escapeHtml($block->getLabel()) ?></span></a>
11-
</div>
11+
</span>

app/code/Magento/Cms/view/frontend/templates/widget/link/link_inline.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<div class="widget block block-cms-link-inline">
7+
<span class="widget block block-cms-link-inline">
88
<a <?php /* @escapeNotVerified */ echo $block->getLinkAttributes() ?>>
99
<span><?php echo $block->escapeHtml($block->getLabel()) ?></span>
1010
</a>
11-
</div>
11+
</span>

app/code/Magento/Deploy/Model/DeployManager.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Magento\Deploy\Model\Deploy\TemplateMinifier;
1313
use Magento\Framework\App\State;
1414

15+
/**
16+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
17+
*/
1518
class DeployManager
1619
{
1720
/**
@@ -108,6 +111,9 @@ public function deploy()
108111
{
109112
if ($this->idDryRun) {
110113
$this->output->writeln('Dry run. Nothing will be recorded to the target directory.');
114+
} else {
115+
$version = (new \DateTime())->getTimestamp();
116+
$this->versionStorage->save($version);
111117
}
112118

113119
/** @var DeployStrategyProvider $strategyProvider */
@@ -133,7 +139,9 @@ public function deploy()
133139
}
134140

135141
$this->minifyTemplates();
136-
$this->saveDeployedVersion();
142+
if (!$this->idDryRun) {
143+
$this->output->writeln("New version of deployed files: {$version}");
144+
}
137145

138146
return $result;
139147
}
@@ -197,17 +205,4 @@ private function getProcessesAmount()
197205
{
198206
return isset($this->options[Options::JOBS_AMOUNT]) ? (int)$this->options[Options::JOBS_AMOUNT] : 0;
199207
}
200-
201-
/**
202-
* Save version of deployed files
203-
* @return void
204-
*/
205-
private function saveDeployedVersion()
206-
{
207-
if (!$this->idDryRun) {
208-
$version = (new \DateTime())->getTimestamp();
209-
$this->output->writeln("New version of deployed files: {$version}");
210-
$this->versionStorage->save($version);
211-
}
212-
}
213208
}

app/code/Magento/Theme/etc/config.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,10 @@ Disallow: /*SID=
6464
</allowed_resources>
6565
</media_storage_configuration>
6666
</system>
67+
<dev>
68+
<static>
69+
<sign>1</sign>
70+
</static>
71+
</dev>
6772
</default>
6873
</config>

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testSaveFilePlaceholder($model)
4646
public function testGetUrlPlaceholder($model)
4747
{
4848
$this->assertStringMatchesFormat(
49-
'http://localhost/pub/static/frontend/%s/Magento_Catalog/images/product/placeholder/image.jpg',
49+
'http://localhost/pub/static/%s/frontend/%s/Magento_Catalog/images/product/placeholder/image.jpg',
5050
$model->getUrl()
5151
);
5252
}

dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testGetConfig()
4242
public function testGetConfigCssUrls()
4343
{
4444
$config = $this->_model->getConfig();
45-
$publicPathPattern = 'http://localhost/pub/static/adminhtml/Magento/backend/en_US/mage/%s';
45+
$publicPathPattern = 'http://localhost/pub/static/%s/adminhtml/Magento/backend/en_US/mage/%s';
4646
$this->assertStringMatchesFormat($publicPathPattern, $config->getPopupCss());
4747
$this->assertStringMatchesFormat($publicPathPattern, $config->getContentCss());
4848
}

dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testGetFilesCollection()
5858
$this->assertInstanceOf(\Magento\Framework\DataObject::class, $item);
5959
$this->assertStringEndsWith('/1.swf', $item->getUrl());
6060
$this->assertStringMatchesFormat(
61-
'http://%s/static/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg',
61+
'http://%s/static/%s/adminhtml/%s/%s/Magento_Cms/images/placeholder_thumbnail.jpg',
6262
$item->getThumbUrl()
6363
);
6464
return;

dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ public function cssDirectiveDataProvider()
283283
* @magentoComponentsDir Magento/Email/Model/_files/design
284284
* @magentoAppIsolation enabled
285285
* @magentoDbIsolation enabled
286+
* @magentoConfigFixture default_store dev/static/sign 0
286287
* @dataProvider inlinecssDirectiveDataProvider
287288
*
288289
* @param string $templateText

dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function testGetProcessedTemplate()
122122
->getArea(Area::AREA_FRONTEND)
123123
->load();
124124

125-
$expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico';
125+
$expectedViewUrl = '/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico';
126126
$this->model->setDesignConfig([
127127
'area' => 'frontend',
128128
'store' => $this->objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)
@@ -578,7 +578,6 @@ public function testGetProcessedTemplateSubject()
578578
->getArea(Area::AREA_FRONTEND)
579579
->load();
580580

581-
$expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico';
582581
$this->model->setTemplateSubject('{{view url="Magento_Theme::favicon.ico"}}');
583582
$this->model->setDesignConfig([
584583
'area' => 'frontend',
@@ -588,10 +587,16 @@ public function testGetProcessedTemplateSubject()
588587
]);
589588

590589
$this->setNotDefaultThemeForFixtureStore();
591-
$this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
590+
$this->assertStringMatchesFormat(
591+
'%s/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico',
592+
$this->model->getProcessedTemplateSubject([])
593+
);
592594

593595
$this->setDefaultThemeForFixtureStore();
594-
$this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([]));
596+
$this->assertStringMatchesFormat(
597+
'%s/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico',
598+
$this->model->getProcessedTemplateSubject([])
599+
);
595600
}
596601

597602
/**
@@ -605,7 +610,7 @@ public function testGetDefaultEmailLogo()
605610
->load();
606611

607612
$this->assertStringEndsWith(
608-
'static/frontend/Magento/luma/en_US/Magento_Email/logo_email.png',
613+
'/frontend/Magento/luma/en_US/Magento_Email/logo_email.png',
609614
$this->model->getDefaultEmailLogo()
610615
);
611616
}

dev/tests/integration/testsuite/Magento/Framework/View/Element/AbstractBlockTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,10 @@ public function testGetUrl()
477477
public function testGetViewFileUrl()
478478
{
479479
$actualResult = $this->_block->getViewFileUrl('css/styles.css');
480-
$this->assertStringMatchesFormat('http://localhost/pub/static/frontend/%s/en_US/css/styles.css', $actualResult);
480+
$this->assertStringMatchesFormat(
481+
'http://localhost/pub/static/%s/frontend/%s/en_US/css/styles.css',
482+
$actualResult
483+
);
481484
}
482485

483486
public function testGetModuleName()

0 commit comments

Comments
 (0)