Skip to content

Commit 8d2ae8f

Browse files
author
Cari Spruiell
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-64047-WebAPI-Its-impossible-to-empty-numeric-fields
2 parents 14b9205 + 495d0c4 commit 8d2ae8f

File tree

1,868 files changed

+45988
-16930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,868 files changed

+45988
-16930
lines changed
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"Read Details","Read Details"
22
"Mark as Read","Mark as Read"
33
"Are you sure?","Are you sure?"
4-
"Remove","Remove"
4+
Remove,Remove
55
"Messages Inbox","Messages Inbox"
66
"You have %1 new system messages","You have %1 new system messages"
77
"You have %1 new system message","You have %1 new system message"
88
"Incoming Message","Incoming Message"
9-
"close","close"
10-
"Notifications","Notifications"
9+
close,close
10+
Notifications,Notifications
1111
"The message has been marked as Read.","The message has been marked as Read."
1212
"We couldn't mark the notification as Read because of an error.","We couldn't mark the notification as Read because of an error."
1313
"Please select messages.","Please select messages."
@@ -20,10 +20,10 @@
2020
"6 Hours","6 Hours"
2121
"12 Hours","12 Hours"
2222
"24 Hours","24 Hours"
23-
"critical","critical"
24-
"major","major"
25-
"minor","minor"
26-
"notice","notice"
23+
critical,critical
24+
major,major
25+
minor,minor
26+
notice,notice
2727
"Wrong message type","Wrong message type"
2828
"Wrong notification ID specified.","Wrong notification ID specified."
2929
"{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure URL / Base Secure URL. We highly recommend changing this value in your Magento <a href=""%1"">configuration</a>.","{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure URL / Base Secure URL. We highly recommend changing this value in your Magento <a href=""%1"">configuration</a>."
@@ -32,20 +32,19 @@
3232
"We were unable to synchronize one or more media files. Please refer to the log file for details.","We were unable to synchronize one or more media files. Please refer to the log file for details."
3333
"Synchronization of media storages has been completed.","Synchronization of media storages has been completed."
3434
"Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider.","Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider."
35-
"Close popup","Close popup"
36-
"Close","Close"
3735
"System Messages:","System Messages:"
3836
"Critical System Messages","Critical System Messages"
3937
"Major System Messages","Major System Messages"
4038
"System messages","System messages"
39+
Close,Close
4140
"See All (","See All ("
4241
" unread)"," unread)"
4342
"Show Toolbar","Show Toolbar"
4443
"Show List","Show List"
4544
"Use HTTPS to Get Feed","Use HTTPS to Get Feed"
4645
"Update Frequency","Update Frequency"
4746
"Last Update","Last Update"
48-
"Severity","Severity"
47+
Severity,Severity
4948
"Date Added","Date Added"
50-
"Message","Message"
51-
"Actions","Actions"
49+
Message,Message
50+
Actions,Actions

app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"autoOpen": true,
2020
"buttons": false,
2121
"modalClass": "modal-system-messages",
22-
"title": "<?php /* @escapeNotVerified */ echo $block->getHeaderText(); ?>"
22+
"title": "<?= /* @escapeNotVerified */ $block->getHeaderText() ?>"
2323
}
2424
}'>
2525
<li class="message message-warning warning">
26-
<?php /* @escapeNotVerified */ echo $block->getNoticeMessageText(); ?><br/>
27-
<a href="<?php /* @escapeNotVerified */ echo $block->getNoticeMessageUrl(); ?>"><?php /* @escapeNotVerified */ echo $block->getReadDetailsText(); ?></a>
26+
<?= /* @escapeNotVerified */ $block->getNoticeMessageText() ?><br/>
27+
<a href="<?= /* @escapeNotVerified */ $block->getNoticeMessageUrl() ?>"><?= /* @escapeNotVerified */ $block->getReadDetailsText() ?></a>
2828
</li>
2929
</ul>

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages.phtml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@
1515
<?php if ($lastCritical): ?>
1616
<ul class="message-system-list">
1717
<li class="message message-warning error">
18-
<?php /* @escapeNotVerified */ echo $lastCritical->getText();?>
18+
<?= /* @escapeNotVerified */ $lastCritical->getText() ?>
1919
</li>
2020
</ul>
2121
<?php endif; ?>
2222
<div class="message-system-short">
2323
<span class="message-system-short-label">
24-
<?php /* @escapeNotVerified */ echo __('System Messages:')?>
24+
<?= /* @escapeNotVerified */ __('System Messages:') ?>
2525
</span>
2626

2727
<?php if ($block->getCriticalCount()): ?>
2828
<div class="message message-warning error">
29-
<a class="message-link" href="#" title="<?php echo $block->escapeHtml(__('Critical System Messages'));?>">
30-
<?php /* @escapeNotVerified */ echo $block->getCriticalCount();?>
29+
<a class="message-link" href="#" title="<?= $block->escapeHtml(__('Critical System Messages')) ?>">
30+
<?= /* @escapeNotVerified */ $block->getCriticalCount() ?>
3131
</a>
3232
</div>
3333
<?php endif;?>
3434

3535
<?php if ($block->getMajorCount()): ?>
3636
<div class="message message-warning warning">
37-
<a class="message-link" href="#" title="<?php echo $block->escapeHtml(__('Major System Messages'));?>">
38-
<?php /* @escapeNotVerified */ echo $block->getMajorCount();?>
37+
<a class="message-link" href="#" title="<?= $block->escapeHtml(__('Major System Messages')) ?>">
38+
<?= /* @escapeNotVerified */ $block->getMajorCount() ?>
3939
</a>
4040
</div>
4141
<?php endif;?>
4242
</div>
43-
<div id="message-system-all" title="<?php echo $block->escapeHtml(__('System messages'));?>" data-mage-init='<?php echo $block->escapeHtml($block->getSystemMessageDialogJson());?>'></div>
43+
<div id="message-system-all" title="<?= $block->escapeHtml(__('System messages')) ?>" data-mage-init='<?= $block->escapeHtml($block->getSystemMessageDialogJson()) ?>'></div>
4444
</div>
4545
</div>

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
?>
1010
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */ ?>
1111

12-
<div style="display:none" id="system_messages_list" data-role="system_messages_list" title="<?php echo $block->escapeHtml($block->getPopupTitle()); ?>">
12+
<div style="display:none" id="system_messages_list" data-role="system_messages_list" title="<?= $block->escapeHtml($block->getPopupTitle()) ?>">
1313
<ul class="message-system-list messages">
1414
<?php foreach ($block->getUnreadMessages() as $message): ?>
15-
<li class="message message-warning <?php /* @escapeNotVerified */ echo $block->getItemClass($message);?>">
16-
<?php /* @escapeNotVerified */ echo $message->getText();?>
15+
<li class="message message-warning <?= /* @escapeNotVerified */ $block->getItemClass($message) ?>">
16+
<?= /* @escapeNotVerified */ $message->getText() ?>
1717
</li>
1818
<?php endforeach;?>
1919
</ul>

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,70 +15,70 @@
1515
<div
1616
data-mage-init='{"toolbarEntry": {}}'
1717
class="notifications-wrapper admin__action-dropdown-wrap"
18-
data-notification-count="<?php /* @escapeNotVerified */ echo $notificationCount; ?>">
18+
data-notification-count="<?= /* @escapeNotVerified */ $notificationCount ?>">
1919
<?php if ($notificationCount > 0) : ?>
2020
<a
21-
href="<?php /* @escapeNotVerified */ echo $block->getUrl('adminhtml/notification/index'); ?>"
21+
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
2222
class="notifications-action admin__action-dropdown"
2323
data-mage-init='{"dropdown":{}}'
24-
title="<?php /* @escapeNotVerified */ echo __('Notifications'); ?>"
24+
title="<?= /* @escapeNotVerified */ __('Notifications') ?>"
2525
data-toggle="dropdown">
2626
<span class="notifications-counter">
27-
<?php /* @escapeNotVerified */ echo ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount; ?>
27+
<?= /* @escapeNotVerified */ ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount ?>
2828
</span>
2929
</a>
3030
<ul
3131
class="admin__action-dropdown-menu"
32-
data-mark-as-read-url="<?php /* @escapeNotVerified */ echo $block->getUrl('adminhtml/notification/ajaxMarkAsRead'); ?>">
32+
data-mark-as-read-url="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/ajaxMarkAsRead') ?>">
3333
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
3434
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?>
3535
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
36-
data-notification-id="<?php /* @escapeNotVerified */ echo $notification->getId(); ?>"
36+
data-notification-id="<?= /* @escapeNotVerified */ $notification->getId() ?>"
3737
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
3838
<?php
3939
$notificationDescription = $block->escapeHtml($notification->getDescription());
4040
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
4141
?>
4242
<strong class="notifications-entry-title">
43-
<?php echo $block->escapeHtml($notification->getTitle()); ?>
43+
<?= $block->escapeHtml($notification->getTitle()) ?>
4444
</strong>
4545
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
4646
<p class="notifications-entry-description _cutted">
4747
<span class="notifications-entry-description-start">
48-
<?php /* @escapeNotVerified */ echo substr($notificationDescription, 0, $notificationDescriptionLength); ?>
48+
<?= /* @escapeNotVerified */ substr($notificationDescription, 0, $notificationDescriptionLength) ?>
4949
</span>
5050
<span class="notifications-entry-description-end">
51-
<?php /* @escapeNotVerified */ echo substr($notificationDescription, $notificationDescriptionLength); ?>
51+
<?= /* @escapeNotVerified */ substr($notificationDescription, $notificationDescriptionLength) ?>
5252
</span>
5353
</p>
5454
<?php else : ?>
5555
<p class="notifications-entry-description">
56-
<?php /* @escapeNotVerified */ echo $notificationDescription; ?>
56+
<?= /* @escapeNotVerified */ $notificationDescription ?>
5757
</p>
5858
<?php endif; ?>
5959
<time class="notifications-entry-time">
60-
<?php /* @escapeNotVerified */ echo $block->formatNotificationDate($notification->getDateAdded()); ?>
60+
<?= /* @escapeNotVerified */ $block->formatNotificationDate($notification->getDateAdded()) ?>
6161
</time>
6262
<button
6363
type="button"
6464
class="notifications-close"
65-
title="<?php /* @escapeNotVerified */ echo __('Close'); ?>"
65+
title="<?= /* @escapeNotVerified */ __('Close') ?>"
6666
></button>
6767
</li>
6868
<?php endforeach; ?>
6969
<li class="notifications-entry notifications-entry-last">
7070
<a
71-
href="<?php /* @escapeNotVerified */ echo $block->getUrl('adminhtml/notification/index'); ?>"
71+
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
7272
class="action-tertiary action-more">
73-
<?php /* @escapeNotVerified */ echo __('See All (') ?><span class="notifications-counter"><?php /* @escapeNotVerified */ echo $notificationCount ?></span><?php /* @escapeNotVerified */ echo __(' unread)'); ?>
73+
<?= /* @escapeNotVerified */ __('See All (') ?><span class="notifications-counter"><?= /* @escapeNotVerified */ $notificationCount ?></span><?= /* @escapeNotVerified */ __(' unread)') ?>
7474
</a>
7575
</li>
7676
</ul>
7777
<?php else : ?>
7878
<a
7979
class="notifications-action admin__action-dropdown"
80-
href="<?php /* @escapeNotVerified */ echo $block->getUrl('adminhtml/notification/index'); ?>"
81-
title="<?php /* @escapeNotVerified */ echo __('Notifications'); ?>">
80+
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
81+
title="<?= /* @escapeNotVerified */ __('Notifications') ?>">
8282
</a>
8383
<?php endif; ?>
8484
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"Please correct the data sent.","Please correct the data sent."
2-
"Entity type model \'%1\' is not found","Entity type model \'%1\' is not found"
2+
"Entity type model '%1' is not found","Entity type model '%1' is not found"
33
"Entity type model must be an instance of \Magento\CatalogImportExport\Model\Export\Product\Type\AbstractType","Entity type model must be an instance of \Magento\CatalogImportExport\Model\Export\Product\Type\AbstractType"
44
"There are no product types available for export","There are no product types available for export"

app/code/Magento/Analytics/Controller/Adminhtml/Reports/Show.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Analytics\Controller\Adminhtml\Reports;
77

8+
use Magento\Analytics\Model\Exception\State\SubscriptionUpdateException;
89
use Magento\Analytics\Model\ReportUrlProvider;
910
use Magento\Backend\App\Action;
1011
use Magento\Backend\App\Action\Context;
@@ -55,6 +56,9 @@ public function execute()
5556
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
5657
try {
5758
$resultRedirect->setUrl($this->reportUrlProvider->getUrl());
59+
} catch (SubscriptionUpdateException $e) {
60+
$this->getMessageManager()->addNoticeMessage($e->getMessage());
61+
$resultRedirect->setPath('adminhtml');
5862
} catch (LocalizedException $e) {
5963
$this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
6064
$resultRedirect->setPath('adminhtml');

app/code/Magento/Analytics/Cron/Update.php

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
*/
66
namespace Magento\Analytics\Cron;
77

8+
use Magento\Analytics\Model\AnalyticsToken;
9+
use Magento\Analytics\Model\Config\Backend\Baseurl\SubscriptionUpdateHandler;
810
use Magento\Analytics\Model\Connector;
9-
use Magento\Analytics\Model\Plugin\BaseUrlConfigPlugin;
1011
use Magento\Framework\FlagManager;
1112
use Magento\Framework\App\Config\ReinitableConfigInterface;
1213
use Magento\Framework\App\Config\Storage\WriterInterface;
1314

1415
/**
15-
* Class Update
1616
* Executes by cron schedule in case base url was changed
1717
*/
1818
class Update
@@ -28,8 +28,6 @@ class Update
2828
private $configWriter;
2929

3030
/**
31-
* Reinitable Config Model.
32-
*
3331
* @var ReinitableConfigInterface
3432
*/
3533
private $reinitableConfig;
@@ -40,22 +38,29 @@ class Update
4038
private $flagManager;
4139

4240
/**
43-
* Update constructor.
41+
* @var AnalyticsToken
42+
*/
43+
private $analyticsToken;
44+
45+
/**
4446
* @param Connector $connector
4547
* @param WriterInterface $configWriter
4648
* @param ReinitableConfigInterface $reinitableConfig
4749
* @param FlagManager $flagManager
50+
* @param AnalyticsToken $analyticsToken
4851
*/
4952
public function __construct(
5053
Connector $connector,
5154
WriterInterface $configWriter,
5255
ReinitableConfigInterface $reinitableConfig,
53-
FlagManager $flagManager
56+
FlagManager $flagManager,
57+
AnalyticsToken $analyticsToken
5458
) {
5559
$this->connector = $connector;
5660
$this->configWriter = $configWriter;
5761
$this->reinitableConfig = $reinitableConfig;
5862
$this->flagManager = $flagManager;
63+
$this->analyticsToken = $analyticsToken;
5964
}
6065

6166
/**
@@ -65,13 +70,23 @@ public function __construct(
6570
*/
6671
public function execute()
6772
{
68-
$updateResult = $this->connector->execute('update');
69-
if ($updateResult === false) {
70-
return false;
73+
$result = false;
74+
$attemptsCount = $this->flagManager
75+
->getFlagData(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);
76+
77+
if ($attemptsCount) {
78+
$attemptsCount -= 1;
79+
$result = $this->connector->execute('update');
80+
}
81+
82+
if ($result || ($attemptsCount <= 0) || (!$this->analyticsToken->isTokenExist())) {
83+
$this->flagManager
84+
->deleteFlag(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);
85+
$this->flagManager->deleteFlag(SubscriptionUpdateHandler::PREVIOUS_BASE_URL_FLAG_CODE);
86+
$this->configWriter->delete(SubscriptionUpdateHandler::UPDATE_CRON_STRING_PATH);
87+
$this->reinitableConfig->reinit();
7188
}
72-
$this->configWriter->delete(BaseUrlConfigPlugin::UPDATE_CRON_STRING_PATH);
73-
$this->flagManager->deleteFlag(BaseUrlConfigPlugin::OLD_BASE_URL_FLAG_CODE);
74-
$this->reinitableConfig->reinit();
75-
return true;
89+
90+
return $result;
7691
}
7792
}

0 commit comments

Comments
 (0)