Skip to content

Commit 9310155

Browse files
committed
MAGE-1379 Update deprecated method calls
1 parent 6d54976 commit 9310155

File tree

11 files changed

+100
-101
lines changed

11 files changed

+100
-101
lines changed

view/adminhtml/templates/analytics/form.phtml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/** @var \Magento\Backend\Block\Template $block */
33
/** @var \Magento\Framework\Escaper $escaper */
44
/** @var \Algolia\AlgoliaSearch\ViewModel\Adminhtml\Analytics\Form $form */
5-
/** TODO:revisit phpcs ignore in this code */
65
$form = $block->getViewModel();
76
?>
87

@@ -22,16 +21,16 @@ $form = $block->getViewModel();
2221
<div class="inline-field">
2322
<input type="text" id="analytics_from" name="from" <?= /** phpcs:ignore Magento2.Security.XssTemplate.FoundUnescaped **/ $isFormDisabled ?>
2423
class="admin__control-text input-text date-range-analytics-from"
25-
placeholder="<?php echo $block->escapeHtmlAttr(__('Start Date')) ?>" value="<?= $escaper->escapeHtmlAttr($form->getFormValue('from')) ?>"/>
24+
placeholder="<?php echo $escaper->escapeHtmlAttr(__('Start Date')) ?>" value="<?= $escaper->escapeHtmlAttr($form->getFormValue('from')) ?>"/>
2625
</div>
2726
<span class="divide">-</span>
2827
<div class="inline-field">
2928
<input type="text" id="analytics_to" name="to" <?= /** phpcs:ignore Magento2.Security.XssTemplate.FoundUnescaped **/ $isFormDisabled ?>
3029
class="admin__control-text input-text validate-date-range date-range-analytics-to"
31-
placeholder="<?php echo $block->escapeHtmlAttr(__('End Date')) ?>" value="<?= $escaper->escapeHtmlAttr($form->getFormValue('to')) ?>"/>
30+
placeholder="<?php echo $escaper->escapeHtmlAttr(__('End Date')) ?>" value="<?= $escaper->escapeHtmlAttr($form->getFormValue('to')) ?>"/>
3231
</div>
3332
<button type="submit" class="action submit primary algolia-daterange-submit" <?= /** phpcs:ignore Magento2.Security.XssTemplate.FoundUnescaped **/ $isFormDisabled ?>>
34-
<?php echo $block->escapeHtml(__('Update')) ?>
33+
<?php echo $escaper->escapeHtml(__('Update')) ?>
3534
</button>
3635
</form>
3736
</div>
@@ -72,4 +71,4 @@ $form = $block->getViewModel();
7271
}
7372
});
7473
});
75-
</script>
74+
</script>

view/adminhtml/templates/analytics/graph.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@
6060
</script>
6161
<?php else : ?>
6262
<div class="dashboard-diagram-nodata">
63-
<span><?php echo $block->escapeHtml(__('No Data Found')) ?></span>
63+
<span><?php echo $escaper->escapeHtml(__('No Data Found')) ?></span>
6464
</div>
65-
<?php endif ?>
65+
<?php endif ?>

view/adminhtml/templates/analytics/overview.phtml

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

view/adminhtml/templates/indexing-manager/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $form = $block->getViewModel();
4242
indexingSubmit.on('click', function(e) {
4343
e.preventDefault();
4444
/** todo: enhance this prompt */
45-
if(confirm('<?php echo $block->escapeJsQuote(__($form->getConfirmMessage())) ?>')) {
45+
if(confirm('<?php echo $escaper->escapeJs(__($form->getConfirmMessage())) ?>')) {
4646
indexingForm.submit();
4747
}
4848
});

view/adminhtml/templates/indexing-manager/section.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/** @var \Magento\Framework\Escaper $escaper */
3-
/** @var \Algolia\AlgoliaSearch\Block\Adminhtml\IndexingManager\Section $block */
3+
/** @var \Magento\Backend\Block\Template $block */
44
/** @var \Algolia\AlgoliaSearch\ViewModel\Adminhtml\IndexingManager\Section $view */
55
$view = $block->getViewModel();
66
$view->setEntity($block->getData('entity'));
77
$relatedIndices = $view->getRelatedIndices();
88
?>
99

1010
<div class="algolia-indexing-manager-section">
11-
<h2><?php echo $block->escapeHtml($view->getSectionTitle()) ?></h2>
11+
<h2><?php echo $escaper->escapeHtml($view->getSectionTitle()) ?></h2>
1212
<?php if (count($relatedIndices) > 0) : ?>
1313
<?php foreach ($relatedIndices as $storeId => $relatedIndex) : ?>
1414
<p><?= $escaper->escapeHtml($relatedIndex['name']) ?> : <a href="<?= $escaper->escapeUrl($view->getIndexUrl($relatedIndex['index'], $storeId)) ?>" target="_blank" ><?= $escaper->escapeHtml($relatedIndex['index']) ?></a></p>

view/adminhtml/templates/landingpage/search-configuration.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $isConfig = [
4141
<p>2. Pre-select applicable filters, for example a price range that is interesting to your customers.</p>
4242
</div>
4343
<div class="col-middle">
44-
<img src="<?php echo $block->escapeUrl($merchIllustration); ?>"/>
44+
<img src="<?php echo $escaper->escapeUrl($merchIllustration); ?>"/>
4545
</div>
4646
<div class="col-right">
4747
<p>3. You can see which products (and in what order) will be shown on the final landing page. If you're on Algolia's higher plans, you may manually set specific order of products, promote or demote as desired.</p>

view/adminhtml/templates/queue/status.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
<div class="algolia-admin-content-links">
88
<p>
99
<span>
10-
<img src="<?php echo $block->escapeUrl($block->getViewFileUrl('Algolia_AlgoliaSearch::images/icon-docs.svg')) ?>">
11-
<a target="_blank" href="https://www.algolia.com/doc/integration/magento-2/how-it-works/indexing-queue/?utm_source=magento&amp;utm_medium=extension&amp;utm_campaign=magento_2&amp;utm_term=shop-owner&amp;utm_content=doc-link"><?php echo $block->escapeHtml(__('Indexing queue documentation')) ?></a>
10+
<img src="<?php echo $escaper->escapeUrl($block->getViewFileUrl('Algolia_AlgoliaSearch::images/icon-docs.svg')) ?>">
11+
<a target="_blank" href="https://www.algolia.com/doc/integration/magento-2/how-it-works/indexing-queue/?utm_source=magento&amp;utm_medium=extension&amp;utm_campaign=magento_2&amp;utm_term=shop-owner&amp;utm_content=doc-link"><?php echo $escaper->escapeHtml(__('Indexing queue documentation')) ?></a>
1212
</span>
1313
</p>
1414
<p>
1515
<span>
16-
<img src="<?php echo $block->escapeUrl($block->getViewFileUrl('Algolia_AlgoliaSearch::images/icon-docs.svg')) ?>">
17-
<a target="_blank" href="https://www.algolia.com/doc/integration/magento-2/troubleshooting/data-indexes-queues/?utm_source=magento&amp;utm_medium=extension&amp;utm_campaign=magento_2&amp;utm_term=shop-owner&amp;utm_content=doc-link"><?php echo $block->escapeHtml(__('Indexing troubleshooting guide')) ?></a>
16+
<img src="<?php echo $escaper->escapeUrl($block->getViewFileUrl('Algolia_AlgoliaSearch::images/icon-docs.svg')) ?>">
17+
<a target="_blank" href="https://www.algolia.com/doc/integration/magento-2/troubleshooting/data-indexes-queues/?utm_source=magento&amp;utm_medium=extension&amp;utm_campaign=magento_2&amp;utm_term=shop-owner&amp;utm_content=doc-link"><?php echo $escaper->escapeHtml(__('Indexing troubleshooting guide')) ?></a>
1818
</span>
1919
</p>
2020
</div>
2121
<div class="algolia-admin-content-videos">
2222
<p>
23-
<span><?php echo $block->escapeHtml(__('Related video:')) ?></span>
23+
<span><?php echo $escaper->escapeHtml(__('Related video:')) ?></span>
2424
<a target="_blank" href="https://www.youtube.com/watch?v=0V1BSKlCm10"><img src="https://img.youtube.com/vi/0V1BSKlCm10/mqdefault.jpg"></a>
25-
<a target="_blank" href="https://www.youtube.com/watch?v=0V1BSKlCm10"><?php echo $block->escapeHtml(__('The indexing queue')) ?></a>
25+
<a target="_blank" href="https://www.youtube.com/watch?v=0V1BSKlCm10"><?php echo $escaper->escapeHtml(__('The indexing queue')) ?></a>
2626
</p>
2727
</div>
2828
</div>

0 commit comments

Comments
 (0)