Hi,

On various site pages, as an anonymous browser, I am getting this error with Ubercart installed:

Fatal error: Call to undefined function uc_product_is_product() in /var/www/www.quaker.org.uk/web/sites/all/modules/ubercart/uc_cart/uc_cart.module on line 292

I am not sure why this is happening, but I have found that line in the code and added a 'function_exists', which seems to solve the problem.

Patch attached.

-Ian

CommentFileSizeAuthor
#1 uc_cart-554638.patch532 bytesidmacdonald

Comments

idmacdonald’s picture

StatusFileSize
new532 bytes

Here's the patch...

-Ian

Island Usurper’s picture

I have no clue why this is happening. uc_cart depends on uc_product, and that function is definitely in that module. And it's not like we even have a weird situation where one module is trying to access a function before that file is loaded yet. I suppose some contrib module could be invoking hook_nodeapi() with its own $op before all of the modules are loaded (which doesn't sound like the greatest idea to begin with, I might add).

The only other option I can think of is that uc_product.module doesn't have uc_product_is_product(), which shouldn't be true for a rc3 version of it. Open up the file and check, I guess, or download the modules again.

Island Usurper’s picture

Status: Active » Postponed (maintainer needs more info)
betz’s picture

same here, when i call 'uc_cart_get_contents()' i get this error

Call to undefined function uc_product_is_product()

now i changed line 314 from

if (uc_product_is_product($node->type)) {

to

if ((function_exists('uc_product_is_product')) && (uc_product_is_product($node->type))) {

and it solved my problem.

PS: using the 2 dev version

Anonymous’s picture

Version: 6.x-2.0-rc3 » 6.x-2.2

I got that issue when upgrading to 2.2. I solved it with deleting the modules folder and uploading it again.

tr’s picture

Category: bug » support

Be aware that the "fixes" in #1 and #4 just suppress the error message by bypassing a block of code that needs to be run. This is not a solution. As #2 said, the function exists so your problem almost certainly lies outside of Ubercart. Without more information it's really impossible to help you debug what's going on.

tr’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)