Skip to content

Commit 11cd40e

Browse files
Oleksandr_HodzevychOleksandr_Hodzevych
authored andcommitted
MAGETWO-66442: Changes in default scope not effect product images in other scopes
- Fixed delete images for all store views and add tooltip when hover on delete button
1 parent 0e2bca6 commit 11cd40e

File tree

11 files changed

+57
-20
lines changed

11 files changed

+57
-20
lines changed

app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function processDeletedImages($product, array &$images)
3131

3232
foreach ($images as &$image) {
3333
if (!empty($image['removed'])) {
34-
if (!empty($image['value_id']) && !isset($picturesInOtherStores[$image['file']])) {
34+
if (!empty($image['value_id'])) {
3535
if (preg_match('/\.\.(\\\|\/)/', $image['file'])) {
3636
continue;
3737
}

app/code/Magento/ProductVideo/i18n/de_DE.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ Delete,Delete
4040
"Autostart base video","Autostart base video"
4141
"Show related video","Show related video"
4242
"Auto restart video","Auto restart video"
43+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/es_ES.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/fr_FR.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/nl_NL.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/pt_BR.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/zh_Hans_CN.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/view/adminhtml/layout/catalog_product_new.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<head>
10+
<css src="Magento_ProductVideo::css/gallery-delete-tooltip.css"/>
11+
</head>
912
<body>
1013
<referenceContainer name="content">
1114

app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,30 +140,37 @@ $elementToggleCode = $element->getToggleCode() ? $element->getToggleCode() : 'to
140140
alt="<%- data.label %>"/>
141141

142142
<div class="actions">
143-
<button type="button"
144-
class="action-remove"
145-
data-role="delete-button"
146-
title="<% if (data.media_type == 'external-video') {%>
143+
<div class="tooltip">
144+
<span class="delete-tooltiptext">
145+
<?= $block->escapeHtml(
146+
__('Delete image in all store views')
147+
); ?>
148+
</span>
149+
<button type="button"
150+
class="action-remove"
151+
data-role="delete-button"
152+
title="<% if (data.media_type == 'external-video') {%>
153+
<?= $block->escapeHtml(
154+
__('Delete video')
155+
); ?>
156+
<%} else {%>
157+
<?= $block->escapeHtml(
158+
__('Delete image')
159+
); ?>
160+
<%}%>">
161+
<span>
162+
<% if (data.media_type == 'external-video') { %>
147163
<?= $block->escapeHtml(
148164
__('Delete video')
149165
); ?>
150-
<%} else {%>
166+
<% } else {%>
151167
<?= $block->escapeHtml(
152168
__('Delete image')
153169
); ?>
154-
<%}%>">
155-
<span>
156-
<% if (data.media_type == 'external-video') { %>
157-
<?= $block->escapeHtml(
158-
__('Delete video')
159-
); ?>
160-
<% } else {%>
161-
<?= $block->escapeHtml(
162-
__('Delete image')
163-
); ?>
164-
<%} %>
165-
</span>
166-
</button>
170+
<%} %>
171+
</span>
172+
</button>
173+
</div>
167174
<div class="draggable-handle"></div>
168175
</div>
169176
<div class="image-fade"><span><?= $block->escapeHtml(
@@ -329,4 +336,4 @@ $elementToggleCode = $element->getToggleCode() ? $element->getToggleCode() : 'to
329336
</div>
330337
<script>
331338
jQuery('body').trigger('contentUpdated');
332-
</script>
339+
</script>

0 commit comments

Comments
 (0)