Protect install.xml with is_file and try-catch against abrupt uninstall
This commit is contained in:
parent
41b4fbaa35
commit
d6a56769a2
10
install.xml
10
install.xml
|
|
@ -11,6 +11,8 @@
|
||||||
<operation error="skip">
|
<operation error="skip">
|
||||||
<search><![CDATA[if ($this->user->hasPermission('access', 'catalog/product')) {]]></search>
|
<search><![CDATA[if ($this->user->hasPermission('access', 'catalog/product')) {]]></search>
|
||||||
<add position="before"><![CDATA[
|
<add position="before"><![CDATA[
|
||||||
|
try {
|
||||||
|
if (is_file(DIR_APPLICATION . 'controller/module/poll_widget_nat.php')) {
|
||||||
$this->load->model('setting/setting');
|
$this->load->model('setting/setting');
|
||||||
$nat_status = $this->config->get('module_poll_widget_nat_status');
|
$nat_status = $this->config->get('module_poll_widget_nat_status');
|
||||||
if ($nat_status === null || $nat_status) {
|
if ($nat_status === null || $nat_status) {
|
||||||
|
|
@ -48,6 +50,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
}
|
||||||
]]></add>
|
]]></add>
|
||||||
</operation>
|
</operation>
|
||||||
</file>
|
</file>
|
||||||
|
|
@ -56,9 +61,11 @@
|
||||||
<operation error="skip">
|
<operation error="skip">
|
||||||
<search><![CDATA[$data['logout'] = $this->url->link('common/logout']]></search>
|
<search><![CDATA[$data['logout'] = $this->url->link('common/logout']]></search>
|
||||||
<add position="before"><![CDATA[
|
<add position="before"><![CDATA[
|
||||||
|
try {
|
||||||
if (!isset($data['nat_menus'])) {
|
if (!isset($data['nat_menus'])) {
|
||||||
$data['nat_menus'] = array();
|
$data['nat_menus'] = array();
|
||||||
}
|
}
|
||||||
|
if (is_file(DIR_APPLICATION . 'controller/module/poll_widget_nat.php')) {
|
||||||
$this->load->model('setting/setting');
|
$this->load->model('setting/setting');
|
||||||
$nat_status = $this->config->get('module_poll_widget_nat_status');
|
$nat_status = $this->config->get('module_poll_widget_nat_status');
|
||||||
if ($nat_status === null || $nat_status) {
|
if ($nat_status === null || $nat_status) {
|
||||||
|
|
@ -73,6 +80,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
}
|
||||||
]]></add>
|
]]></add>
|
||||||
</operation>
|
</operation>
|
||||||
</file>
|
</file>
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue