Post by swatpc » Mon Jun 01, 2015 12:15 am

installing modules OCMOD the store goes into maintenance

Denis Cunha
Opencart Master
suporte@opencartmaster.com.br


User avatar
Newbie

Posts

Joined
Mon Feb 02, 2015 10:11 pm

Active Member

Posts

Joined
Fri Jul 18, 2014 4:39 pm

Post by aljawaid » Mon Jun 01, 2015 3:34 am

http://forum.opencart.com/viewtopic.php ... 48#p563468

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.


Active Member

Posts

Joined
Fri Oct 10, 2014 10:33 pm
Location - UK

Post by fido-x » Thu Jun 04, 2015 4:13 pm

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.

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by aljawaid » Thu Jun 04, 2015 4:20 pm

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.
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.

Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.


Active Member

Posts

Joined
Fri Oct 10, 2014 10:33 pm
Location - UK

Post by fido-x » Thu Jun 04, 2015 4:29 pm

You have to turn maintenance mode off yourself. It isn't done automatically.

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by OSWorX » Thu Jun 04, 2015 4:35 pm

fido-x wrote:You have to turn maintenance mode off yourself. It isn't done automatically.
I made a while ago a pull request at GitHub to check the maintenance mode before doing the modification.
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.

Forum Rules [en]: viewtopic.php?f=176&t=200480
Forumregeln [de]: viewtopic.php?f=37&t=114208
Commercial Request: viewforum.php?f=88

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by fido-x » Thu Jun 04, 2015 4:55 pm

This is in admin/controller/extension/modification.php (lines 62 to 68):

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);
}
This should store the maintenance mode setting prior to refreshing the modification cache.

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);
}
This should reset maintenance mode to what it was before refreshing the modification cache. Obviously not working, so I suppose this is a bug.

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by OSWorX » Thu Jun 04, 2015 6:00 pm

fido-x wrote:This is in admin/controller/extension/modification.php (lines 62 to 68):

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);
}
This should store the maintenance mode setting prior to refreshing the modification cache.

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);
}
This should reset maintenance mode to what it was before refreshing the modification cache. Obviously not working, so I suppose this is a bug.
Yes, this was my PR.
And yes, should be reworked, considering this as a bug - sorry.

Forum Rules [en]: viewtopic.php?f=176&t=200480
Forumregeln [de]: viewtopic.php?f=37&t=114208
Commercial Request: viewforum.php?f=88

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by fido-x » Thu Jun 04, 2015 6:28 pm

Just change this bit from:

Code: Select all

if ($org_maintenance != $this->config->get('config_maintenance')) {
 $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
to:

Code: Select all

if (!$org_maintenance) {
 $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by aljawaid » Thu Jun 04, 2015 11:10 pm

fido-x wrote:Just change this bit from:

Code: Select all

if ($org_maintenance != $this->config->get('config_maintenance')) {
 $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
to:

Code: Select all

if (!$org_maintenance) {
 $this->model_setting_setting->editSettingValue('config', 'config_maintenance', false);
}
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.

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.


Active Member

Posts

Joined
Fri Oct 10, 2014 10:33 pm
Location - UK

Post by fido-x » Thu Jun 04, 2015 11:22 pm

When you click the "Refresh" button to refresh your modification cache, your site is put into maintenance mode so that while the modification cache is being rebuilt, any visitors to your site will see it in maintenance mode. The problem is, that it is not being taken out of maintenance mode when finished.

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);
}
with:

Code: Select all

if (!$org_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.

The code provided by viethemes only ensures that maintenance mode stays turned on.

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by OSWorX » Thu Jun 04, 2015 11:29 pm

fido-x is correct - thanks for the update (made that PR very fast, too fast).
Should now someone make a new PR ..

Forum Rules [en]: viewtopic.php?f=176&t=200480
Forumregeln [de]: viewtopic.php?f=37&t=114208
Commercial Request: viewforum.php?f=88

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by aljawaid » Fri Jun 05, 2015 5:52 am

fido-x wrote: 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);
}
with:

Code: Select all

if (!$org_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.

The code provided by viethemes only ensures that maintenance mode stays turned on.
Thank you for this, I have done it and will monitor. Thanks for the explanation too, it helps more. O0

Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.


Active Member

Posts

Joined
Fri Oct 10, 2014 10:33 pm
Location - UK

Post by skimottaret » Wed Jun 10, 2015 6:45 pm

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?

www.insideoutskiing.com/sales2

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by fido-x » Thu Jun 11, 2015 11:47 pm

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
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.

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by skimottaret » Fri Jun 12, 2015 12:34 am

Thank you, looking closer I didn't appreciate that there was a selectable system setting for taking out of maintenance mode.

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by sunsys » Sat Jul 11, 2015 7:44 am

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.
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 ?

Regards,
Sun Systems
Industrial Electronics and Instrumentation


User avatar
Active Member

Posts

Joined
Tue Jan 27, 2015 5:19 am

Post by fido-x » Sat Jul 11, 2015 2:55 pm

Could be related to the caching on your mobile device. Suggest clearing the cache in your mobile device's browser.

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 6 guests