Dirty Butter Posted August 23, 2012 Share Posted August 23, 2012 PHP Warning: No callback method defined. in /home/XXX/public_html/plushcatalog/classes/cubecart.class.php on line 231 What does this mean? How do I track down where the actual problem is, as line 231 just creates the error message. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 23, 2012 Share Posted August 23, 2012 Well, it is true that line 231 sends an error message into the "system", but there is a very restrictive path on how we get to line 231. The function loadPage() is used for a few things but it seems mainly to give control over to the module or gateway's functions (to process the response from a payment transaction, for example). The function loadPage() is called from one location, the store-front controller. Here, everything has been setup to properly display a page. In the stuff that follows the question mark of a web address, there is a _g=something that Cubecart has not been programmed to look for. I will guess that a gateway (or other plugin) exists that expects some returning information, but the URL the gateway gives to the outside processor doesn't have the correct additional info which must include _g=rm or _g=remote. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 23, 2012 Author Share Posted August 23, 2012 Is there any message I can look for with Debug turned on that will give me a clue as to what _g=something is not being found? I do see this on the Dashboard: [Warning] /home/XXXX/public_html/plushcatalog/includes/lib/smarty/sysplugins/smarty_internal_write_file.php:49 - unlink(/home/XXXX/public_html/plushcatalog/cache/skin/d8fef77561a27ca254179bb8d4d0ac48822415d4.file.dashboard.index.php.php) [function.unlink.php]: No such file or directory Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 23, 2012 Share Posted August 23, 2012 Those Smarty unlink() warnings should have disappeared in CC514 (I think. Maybe it's only that I turned them off.) You won't know what the URL was because CC bounces you immediately to index.php. What you can try to do is edit line 231 to look like this: trigger_error('No useful GET['_g'] callback method defined. Got _g='.filter_var($_GET['_g'],FILTER_SANITIZE_STRING), E_USER_WARNING); Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 23, 2012 Author Share Posted August 23, 2012 I haven't upgraded yet, so I'm still on 5.1.1. Sorry for not saying that. But I do see the same no callback method warning on our 5.1.4 store. Trying your edit now. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 23, 2012 Author Share Posted August 23, 2012 Thanks for your patient help, Bsmither!!! Now the log says PHP Warning: No useful GET['_g'] callback method defined. Got _g=sw in /home/XXXX/public_html/plushcatalog/classes/cubecart.class.php on line 231 Debug showed no No Errors or Warnings So did this just stop me from seeing stuff I don't need to be worried about, or does the log message tell you something it sure doesn't tell me??? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 23, 2012 Share Posted August 23, 2012 It tells me that a gateway, module, or some plugin is telling the outside processor (Paypal, for example) the URL to send the response to is: www.store.com/index.php?_g=sw&... where the green &... is whatever else is needed to identify the module and info for the module. You haven't yet said what it is exactly you are doing just prior to getting this message. Viewing a product? Adding an address to your customer account's addressbook? Checking out using a particular payment gateway? Trying to switch to viewing the store in a different language or currency? trigger_error(' No useful GET['_g'] callback method defined. Got _g='.filter_var($_GET['_g'],FILTER_SANITIZE_STRING).' and type='.filter_var($_GET['type'],FILTER_SANITIZE_STRING).' and command='.filter_var($_GET['cmd'],FILTER_SANITIZE_STRING).' and module='.filter_var($_GET['module'],FILTER_SANITIZE_STRING) , E_USER_WARNING); You can try this expanded statement for line 231. It will tell us more info if there is any more to be had. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 23, 2012 Author Share Posted August 23, 2012 I've not been able to pinpoint what makes it happen. BUT, while trying to test various things to try to cause it, I found a non functional part that is VERY important. I need to start a new thread for it. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 29, 2012 Share Posted August 29, 2012 I just had this happen to me. And I am searching the forums for any specific reports, one of which is when an admin uses the flyout search window to search for a product, and when the admin clicks 'Search', and in their case, what happens? Quote Link to comment Share on other sites More sharing options...
matchattaxoutlet Posted August 12, 2013 Share Posted August 12, 2013 Any update on the cause of this problem? My phperrorlog contains hundreds of references to this. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 12, 2013 Share Posted August 12, 2013 Please make the edit in Post #7. Quote Link to comment Share on other sites More sharing options...
matchattaxoutlet Posted August 15, 2013 Share Posted August 15, 2013 Just made the the edit as per comment #7 and this is now my output: [15-Aug-2013 13:28:22 Europe/London] PHP Warning: No useful GET['_g'] callback method defined. Got _g=sw and type= and command= and module= in /home/xxxxx/public_html/classes/cubecart.class.php on line 237 Any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 15, 2013 Share Posted August 15, 2013 I cannot find anywhere in CC5, where the key, _g is given a value of sw, is constructed to give to the module's target to use as a call-back. What I have found is that in CC4, the selectors to let a customer choose a language or currency uses that key/value. This feature is called 'switch'. CC5 does not do it this way. (Unless a mod, or a CC4 skin converted to a CC5 variant is bad.) Here is a more finessed statement we can use: trigger_error('No useful GET['_g'] callback method defined. Got _g='.filter_var($_GET['_g'],FILTER_SANITIZE_STRING) . (isset($_GET['type'])) ? ' and type='.filter_var($_GET['type'],FILTER_SANITIZE_STRING) : '' . (isset($_GET['cmd'])) ? ' and command='.filter_var($_GET['cmd'],FILTER_SANITIZE_STRING) : '' . (isset($_GET['module'])) ? ' and module='.filter_var($_GET['module'],FILTER_SANITIZE_STRING) : '.' . ' The complete query string is ' . $_SERVER['QUERY_STRING'] . ' from ' . $_SERVER['REMOTE_ADDR'] . ' ' . (isset($_SERVER['REMOTE_HOST'])) ? $_SERVER['REMOTE_HOST'] : '' , E_USER_WARNING); This will let us see the IP address and maybe the domain name of the place that is making this request to your store. Quote Link to comment Share on other sites More sharing options...
matchattaxoutlet Posted August 16, 2013 Share Posted August 16, 2013 Hi Bsmithers, Now i just get the following; PHP Warning: in /home/xxxxx/public_html/classes/cubecart.class.php on line 237 Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 16, 2013 Share Posted August 16, 2013 A more straightforward series of statements, then:$trigger_error = 'No useful GET['_g'] callback method defined. Got _g='.filter_var($_GET['_g'],FILTER_SANITIZE_STRING); $trigger_error .= (isset($_GET['type'])) ? ' and type='.filter_var($_GET['type'],FILTER_SANITIZE_STRING) : ''; $trigger_error .= (isset($_GET['cmd'])) ? ' and command='.filter_var($_GET['cmd'],FILTER_SANITIZE_STRING) : ''; $trigger_error .= (isset($_GET['module'])) ? ' and module='.filter_var($_GET['module'],FILTER_SANITIZE_STRING) : '.'; $trigger_error .= ' The complete query string is ' . $_SERVER['QUERY_STRING'] . ' from ' . $_SERVER['REMOTE_ADDR']; $trigger_error .= ' ' . (isset($_SERVER['REMOTE_HOST'])) ? $_SERVER['REMOTE_HOST'] : ''; trigger_error($trigger_error, E_USER_WARNING); Quote Link to comment Share on other sites More sharing options...
matchattaxoutlet Posted August 16, 2013 Share Posted August 16, 2013 Here's the output: PHP Warning: No useful GET['_g'] callback method defined. Got _g=sw. The complete query string is _g=sw&r=%2Findex.php%3F_a%3DviewProd%26amp%3BproductId%3D508&lang=pt from 66.249.72.34 in /home/xxxxx/public_html/classes/cubecart.class.php on line 237 and PHP Warning: No useful GET['_g'] callback method defined. Got _g=sw. The complete query string is _g=sw&r=%2Findex.php%3F_a%3DviewCat%26amp%3BcatId%3D215%26amp%3Bpage%3D1¤cy=RUB from 66.249.72.34 in /home/xxxxx/public_html/classes/cubecart.class.php on line 237 Seems to be Googlebot related, any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 16, 2013 Share Posted August 16, 2013 I would conclude that at one time, your domain was running CubeCart 4 and Google is trying to discover the current contents of a link found on the main page of that CubeCart 4 storefront. That link was located in CC4's "Change Language" and "Change Currency" drop-down selectors. Now that you know from what and why this error message is showing up in your logs, you can either ignore it, add some code to CC5 to ignore it, or get on Google's WebMaster Tools area and request that Google dump everything it knows about this domain and re-index it all. (Creating a SiteMap would be the preferred method.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.