Denis Cunha
Opencart Master
suporte@opencartmaster.com.br
Follow that post for the solution. It seems like a bug - I think. But the fix by viethemes seems to work.

Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
I see your point and it makes sense to do it that way too, but in this case, with this version, it seems to be "staying" in maintenance mode after refreshing.fido-x wrote:This is not a bug, merely an inconvenience. Your site will automatically be switched to maintenance mode when you refresh your modification cache. This gives you (as admin) the chance to check that the modification is working before allowing customers to view your store.
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
I made a while ago a pull request at GitHub to check the maintenance mode before doing the modification.fido-x wrote:You have to turn maintenance mode off yourself. It isn't done automatically.
During modification switch maintenance mode to OFF and restore afterwards to the state it was before.
Seems that got lost ...
And it seems useless to do PRs at GH, just wasting my time.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Code: Select all
$org_maintenance = $this->config->get('config_maintenance');
if (!$this->config->get('config_maintenance')) {
$this->load->model('setting/setting');
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', true);
}
And, further down (lines 418 to 420):
Code: Select all
if ($org_maintenance != $this->config->get('config_maintenance')) {
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Yes, this was my PR.fido-x wrote:This is in admin/controller/extension/modification.php (lines 62 to 68):This should store the maintenance mode setting prior to refreshing the modification cache.Code: Select all
$org_maintenance = $this->config->get('config_maintenance'); if (!$this->config->get('config_maintenance')) { $this->load->model('setting/setting'); $this->model_setting_setting->editSettingValue('config', 'config_maintenance', true); }
And, further down (lines 418 to 420):This should reset maintenance mode to what it was before refreshing the modification cache. Obviously not working, so I suppose this is a bug.Code: Select all
if ($org_maintenance != $this->config->get('config_maintenance')) { $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false); }
And yes, should be reworked, considering this as a bug - sorry.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Code: Select all
if ($org_maintenance != $this->config->get('config_maintenance')) {
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
Code: Select all
if (!$org_maintenance) {
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
A bit confusing now what I should be using. You say the viethemes vqmod is wrong but it works for me. But then today, the site made itself offline again. Not sure if it has something to do with cookies etc.fido-x wrote:Just change this bit from:to:Code: Select all
if ($org_maintenance != $this->config->get('config_maintenance')) { $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false); }
Code: Select all
if (!$org_maintenance) { $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false); }
So this code above... does anyone have a vqmod for it? or which file should it be done in? The same code is mentioned twice on this page so I'm not sure which one to follow now.
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
To fix, replace this (lines 418 to 420) in admin/controller/extension/modification.php
Code: Select all
if ($org_maintenance != $this->config->get('config_maintenance')) {
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
Code: Select all
if (!$org_maintenance) {
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
The code provided by viethemes only ensures that maintenance mode stays turned on.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Should now someone make a new PR ..
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Thank you for this, I have done it and will monitor. Thanks for the explanation too, it helps more.fido-x wrote: To fix, replace this (lines 418 to 420) in admin/controller/extension/modification.phpwith:Code: Select all
if ($org_maintenance != $this->config->get('config_maintenance')) { $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false); }
This will need to be hard-coded as the modification.php file can not be modified while it is in use.Code: Select all
if (!$org_maintenance) { $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false); }
The code provided by viethemes only ensures that maintenance mode stays turned on.

Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Surely I don't have to add special code patches so my shop can be viewed, or do I?
www.insideoutskiing.com/sales2
You have a choice. You can apply the fix as stated above. You can get an update from GitHub. Or, just remember that refreshing your modification cache will put your site into maintenance mode while rebuilding the modification cache and "forget" to take it out of maintenance mode. Which means you will have to go to your system settings and take it out of maintenance mode yourself. The choice is yours.skimottaret wrote:I am having the same issue, is this a bug? I have installed VQMod and am testing a new shop using 2.0.3.1 and Journal theme 2.5.2
Surely I don't have to add special code patches so my shop can be viewed, or do I?
http://www.insideoutskiing.com/sales2
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Yes fido-x you are right in this aspect but there is also one more problem and that is of mobile site, with one extension I have solved the maintenance issue for desktop version but the same when viewed on the mobile shows as the site in maintenance mode so what can be done about that ?fido-x wrote:You have a choice. You can apply the fix as stated above. You can get an update from GitHub. Or, just remember that refreshing your modification cache will put your site into maintenance mode while rebuilding the modification cache and "forget" to take it out of maintenance mode. Which means you will have to go to your system settings and take it out of maintenance mode yourself. The choice is yours.
Regards,
Sun Systems
Industrial Electronics and Instrumentation
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Users browsing this forum: No registered users and 5 guests