Skip to content

Commit b0eea47

Browse files
committed
10509-Invalid-Key-Notification_v2
1 parent 1177298 commit b0eea47

File tree

6 files changed

+50
-46
lines changed

6 files changed

+50
-46
lines changed
Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@
1212
use Magento\Framework\App\ResourceConnection;
1313
use Magefan\Community\Model\SectionFactory;
1414

15-
class ModulesLinv extends Template
15+
class Linv extends Template
1616
{
1717
/**
1818
* @var ResourceConnection
1919
*/
20-
protected $resource;
20+
private $resource;
2121

2222
/**
2323
* @var SectionFactory
2424
*/
2525
private $sectionFactory;
2626

27-
2827
/**
2928
* @param SectionFactory $sectionFactory
3029
* @param Template\Context $context
@@ -45,36 +44,30 @@ public function __construct(
4544
/**
4645
* @return array
4746
*/
48-
public function getModulesLinv()
47+
public function getItems()
4948
{
5049
$connection = $this->resource->getConnection();
5150
$table = $this->resource->getTableName('core_config_data');
5251
$path = '/g'.'en'.'er'.'al'.'/l'.'in'.'v';
53-
$select = $connection->select()->from(
54-
[$table]
55-
)->where(
56-
'path LIKE ?',
57-
'%' . $path
58-
)->where(
59-
'value LIKE ?',
60-
'1'
61-
);
62-
$disabledConfigs = $connection->fetchAll($select);
63-
$disabledModules = [];
64-
65-
foreach ($disabledConfigs as $config) {
52+
$select = $connection->select()
53+
->from([$table])
54+
->where( 'path LIKE ?', '%' . $path )
55+
->where('value = ?',1);
56+
$items = $connection->fetchAll($select);
57+
$result = [];
6658

59+
foreach ($items as $config) {
6760
$configPath = explode('/', $config['path']);
6861
$moduleName = $configPath[0];
6962
$section = $this->sectionFactory->create([
7063
'name' => $moduleName
7164
]);
7265
$module = $section->getModule(true);
73-
if($module){
74-
$disabledModules[] = $module;
66+
if ($module) {
67+
$result[] = $module;
7568
}
7669

7770
}
78-
return $disabledModules;
71+
return $result;
7972
}
8073
}

Cron/Sections.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public function execute()
107107
$this->setLinvFlag->execute($moduleName, 1);
108108
} else {
109109
$this->setLinvFlag->execute($moduleName, 0);
110-
$request->setPostValue('groups', $groups);
111110
}
112111
}
113112
}

Observer/ConfigObserver.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ final public function execute(\Magento\Framework\Event\Observer $observer)
9999
);
100100
} else {
101101
$this->setLinvFlag->execute($module, 0);
102-
$request->setPostValue('groups', $groups);
103102
}
104103
}
105104
}

view/adminhtml/layout/default.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
10-
<referenceContainer name="content">
11-
<block class="Magefan\Community\Block\Adminhtml\ModulesLinv" name="magefan_community_check_modules_license" template="Magefan_Community::modules_linv.phtml" before="-" />
10+
<referenceContainer name="page.wrapper">
11+
<block class="Magefan\Community\Block\Adminhtml\Linv" name="magefan_community_linv" template="Magefan_Community::linv.phtml" after="header" />
1212
</referenceContainer>
1313
</body>
1414
</page>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* Copyright © Magefan ([email protected]). All rights reserved.
4+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+
*/
6+
?>
7+
<?php
8+
/**
9+
* Help template
10+
*
11+
* @var $block \Magefan\Community\Block\Adminhtml\Linv
12+
*/
13+
?>
14+
<?php if ($items = $block->getItems()) { ?>
15+
16+
<div class="messages">
17+
<div class="message message-notice notice">
18+
<div data-ui-id="messages-message-notice" class="linv">
19+
<?= 'So' . 'me ' . 'Mag'.'efan'.' Ex'.'tensions'.' a'.'re'.' dis'.'abl'.'ed d'.'ue '.'to i'.'nva'.'lid'.' Product K'.'ey: ' ?>
20+
<div style="margin-left: 30px">
21+
<br/>
22+
<ul>
23+
<?php foreach ($items as $key => $name) { ?>
24+
<li>
25+
<?= $block->escapeHtml($result = preg_replace('/([A-Z])/', ' $1', $name)); ?>
26+
</li>
27+
<?php } ?>
28+
</ul>
29+
</div>
30+
<?= 'Ple' . 'ase che' . 'ck exten' . 'sions config' . 'uration' ?>.
31+
</div>
32+
</div>
33+
</div>
34+
35+
<?php } ?>

view/adminhtml/templates/modules_linv.phtml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)