Order Total GV Not Working and Breaking in Admin
Hi guys, ages since I upgraded now to 1.5.1 but only just noticed this since I went to add a new order total module.
first I noticed that the admin side of order total is vroken and doesnt show the options to add and remove the modules then now ive gone and looked through checkout i notice that the gift voucher redeem bit has dissapeared, though I could have sworn this was working after my upgrade so a bit confused as to when this has gone wrong.
the error I get is this when I go to the admin settings:
[20-Aug-2013 10:08:59 UTC] PHP Fatal error: Call to a member function format() on a non-object in /home/site/public_html/includes/modules/order_total/ot_gv.php on line 49
I have replaced the
public_html/includes/modules/order_total/ot_gv.php
file with a fresh copy from a new downlaod and it still does the same.
any ideas whats causing this?
thanks
Re: Order Total GV Not Working and Breaking in Admin
Hmmmm...
Try removing the class. part from line 12 of /admin/includes/init_includes/init_currencies.php:
Code:
require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.currencies.php');
Re: Order Total GV Not Working and Breaking in Admin
No thats made no difference :(
Its really weird. I've seen lots of posts seeming to be related to the same error but some of them are saying they fixed it by refreshing cache etc. I tried that and nothing changed but i really cant see how cache could affect the server function.
It was defiantly working about a month a go as my wife processes internal orders using gift certificate redemption. and since her last one we not longer get the redemption part on the checkout payment page (assumably to do with this error).
Like I said I only noticed the error when I went to enable a new order total module and the admin screen wasn't rendering properly and I checked the error log files to see the above error.
I also removed the new order total mod incase it was that that was causing a conflict but it made no difference.
when I renamed the ot_gv.php to ot_gv.bak the admin setting page comes back to life with the other mods etc but obviously this is no good as I no longer have the gift certificate stuff during checkout :(
The only thing I wondered was a while back my host disabled some vulnerable functions on my server but I asked them to check that this would not cause this and they don't believe it could be.
Any other suggestions? Really need the gv stuff for internal order processing.
Cheers
Phil
Re: Order Total GV Not Working and Breaking in Admin
Well, the cause of that specific error message is that the $currencies variable isn't set correctly to be an object created from the currencies class.
Perhaps that can guide you in your investigation of why your site is having problems.
Re: Order Total GV Not Working and Breaking in Admin
I really don't have the first clue where to start looking. Would you be able to give me some suggestions on places to check? Maybe see if there is a way to debug to prove that by manually setting a variable or something to see if it fixes the problem?
Really have no idea how this can have happened as nothing has been changed since it was last known to be working.
Re: Order Total GV Not Working and Breaking in Admin
I suppose you could remedy it by making the following change to the beginning of line 49 in /includes/modules/order_total/ot_gv.php
Code:
if (IS_ADMIN_FLAG === FALSE) $this->checkbox = ... keep the rest of the line intact ...
Re: Order Total GV Not Working and Breaking in Admin
Quote:
Originally Posted by
DrByte
I suppose you could remedy it by making the following change to the beginning of line 49 in /includes/modules/order_total/ot_gv.php
Code:
if (IS_ADMIN_FLAG === FALSE) $this->checkbox = ... keep the rest of the line intact ...
OK that seems to have fixed it. very odd indeed.
I can now access the admin options and its now started appearing in the checkout pages and credit is applied to the order when selected.
Question is by adding that statement what is that doing? is that going to stop anyting else from working? and it still doesnt make sense as to why this needs changing all of a sudden?
Seems to work though so is it safe to leave with your tweek do you think?
Re: Order Total GV Not Working and Breaking in Admin
That change is safe, and is incorporated as part of the upcoming v1.6.0 release.
Re: Order Total GV Not Working and Breaking in Admin
ok cool thanks. very confused as to why its just suddenly needed this though?
what is that line of code actually doing/for? and what is the addition that you got me to apply doing to it?
hope you don't mind answering, I like to try and understand these things..
Re: Order Total GV Not Working and Breaking in Admin
There are a couple of issues here:
1) class.currencies.php does not exist
2) /admin/includes/init_includes/init_currencies.php is never included and is missing in /admin/includes/auto_loaders/config.core.php
Possible fix:
1) change class.currencies.php to currencies.php in /admin/includes/init_includes/init_currencies.php
2) add the following to /admin/includes/auto_loaders/config.core.php:
PHP Code:
$autoLoadConfig[120][] = array('autoType'=>'init_script',
'loadFile'=> 'init_currencies.php');
DrByte, can you confirm this is okay to do?