Jump to content

Error Log Warning - No Callback Method Defined


Dirty Butter

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 11 months later...

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.

Link to comment
Share on other sites

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);
Link to comment
Share on other sites

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&currency=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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...