Call to undefined function _referral_uid2ref()
| Project: | User Referral |
| Version: | 6.x-1.x-dev |
| Component: | Code: referral |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I got the following error when I tried to add a custom block for referral module
Fatal error: Call to undefined function _referral_uid2ref() in /home2/expertsc/public_html/includes/common.inc(1652) : eval()'d code on line 6
Anyway. It isn't the initial error. It displayed after I deleted the referral module using my FTP client.
The actual error was
Fatal Error: Unsupported operand types in /home2/xxxxxxx/public_html/includes/common.inc(1376)
When I checked the line 1356, I found the following code above it
function url($path = NULL, $options = array()) {
// Merge in defaults.
$options += array(
'fragment' => '',
'query' => '',
'absolute' => FALSE,
'alias' => FALSE,
'prefix' => ''
);Well I tried to backtrace it and it showed something wrong with common.inc file at line 1652 and eval()'d code.
At line 1652 is the statement print eval('?>'. $code); .
Well this all started when I put the following in the custom block module to display referral link in block:
<?php
print url('referral/' . _referral_uid2ref($user->uid), NULL, NULL, TRUE);
?> I think this code is not compatible with Drupal 6 and that's why this fatal error came up. I tried to remove the module but of no use. I just want a solution to the problem immediately as my site could not be accessed currently. I think removing the custom block can solve the issue. Just tell me how to remove the custom blocks without going to the blockes page. Please help.

#1
#2
Issue resolved.
I tried to remove the following code around line 1652
ob_start();print eval('?>'. $code);
$output = ob_get_contents();
ob_end_clean();
saved the common.inc file and refreshed the site. Site was accessible this time. Then I immediately moved on to blocks page and deleted the cutom referral block. After saving changes, I reinstated the above mentioned code in the common.inc file and now everything is working fine for me.