When I run cron.php from address bar in my browser I get the following error:
Fatal error: Call to undefined function: form_textfield() in /home/genericg/public_html/includes/common.inc(1150) : eval()'d code on line 4
From another thread I changed the drupal_eval function from
function drupal_eval($code) {
ob_start();
print eval('?>'. $code);
$output = ob_get_contents();
ob_end_clean();
return $output;
}
to this:
function drupal_eval($code) {
ob_start();
$test = @eval('? >'. $code);
if (!$test) print $code;
$output = ob_get_contents();
ob_end_clean();
return $output;
}
After changing that code, I attempted to run cron again and got the following error:
'. $code); // $output = ob_get_contents(); // ob_end_clean(); // return $output; //} function drupal_eval($code) { ob_start(); $test = @eval('? >'. $code); if (!$test) print $code; $output = ob_get_contents(); ob_end_clean(); return $output; } /** * Returns the path to a system item (module, theme, etc.). * * @param $type * The type of the item (i.e. theme, theme_engine, module). * @param $name * The name of the item for which the path is requested. * * @return * The path to the requested item. */ function drupal_get_path($type, $name) { return dirname(drupal_get_filename($type, $name)); } /** * Returns the base URL path of the Drupal installation. * At the very least, this will always default to /. */ function base_path() { return $GLOBALS['base_path']; } /** * Provide a substitute clone() function for PHP4. */ function drupal_clone($object) { return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object); } /** * Add a tag to the page's HEAD. */ function drupal_add_link($attributes) { drupal_set_html_head('\n"); } /** * Add a JavaScript file to the output. * * The first time this function is invoked per page request, * it adds "misc/drupal.js" to the output. Other scripts * depends on the 'killswitch' inside it. */ function drupal_add_js($file, $nocache = FALSE) { static $sent = array(); $postfix = $nocache ? '?'. time() : ''; if (!isset($sent['misc/drupal.js'])) { drupal_set_html_head(''); $sent['misc/drupal.js'] = true; } if (!isset($sent[$file])) { drupal_set_html_head(''); $sent[$file] = true; } } /** * Generates a Javascript call, while importing the arguments as is. * PHP arrays are turned into JS objects to preserve keys. This means the array * keys must conform to JS's member naming rules. * * @param $function * The name of the function to call. * @param $arguments * An array of arguments. */ function drupal_call_js($function) { $arguments = func_get_args(); array_shift($arguments); $args = array(); foreach ($arguments as $arg) { $args[] = drupal_to_js($arg); } $output = ''; return $output; } /** * Converts a PHP variable into its Javascript equivalent. * * We use HTML-safe strings, i.e. with <, > and & escaped. */ function drupal_to_js($var) { switch (gettype($var)) { case 'boolean': return $var ? 'true' : 'false'; // Lowercase necessary! case 'integer': case 'double': return $var; case 'resource': case 'string': return '"'. str_replace(array("\r", "\n", "<", ">", "&"), array('\r', '\n', '\x3c', '\x3e', '\x26'), addslashes($var)) .'"'; case 'array': if (array_keys($var) === range(0, sizeof($var) - 1)) { $output = array(); foreach($var as $v) { $output[] = drupal_to_js($v); } return '[ '. implode(', ', $output) .' ]'; } // Fall through case 'object': $output = array(); foreach ($var as $k => $v) { $output[] = drupal_to_js(strval($k)) .': '. drupal_to_js($v); } return '{ '. implode(', ', $output) .' }'; default: return 'null'; } } /** * Wrapper around urlencode() which avoids Apache quirks. * * Should be used when placing arbitrary data in an URL. Note that Drupal paths * are urlencoded() when passed through url() and do not require urlencoding() * of individual components. * * @param $text * String to encode */ function drupal_urlencode($text) { return str_replace('%2F', '/', urlencode($text)); } /** * Performs one or more XML-RPC request(s). * * @param $url * An absolute URL of the XML-RPC endpoint. * Example: * http://www.domain.com/xmlrpc.php * @param ... * For one request: * The method name followed by a variable number of arguments to the method. * For multiple requests (system.multicall): * An array of call arrays. Each call array follows the pattern of the single * request: method name followed by the arguments to the method. * @return * For one request: * Either the return value of the method on success, or FALSE. * If FALSE is returned, see xmlrpc_errno() and xmlrpc_error_msg(). * For multiple requests: * An array of results. Each result will either be the result * returned by the method called, or an xmlrpc_error object if the call * failed. See xmlrpc_error(). */ function xmlrpc($url) { require_once './includes/xmlrpc.inc'; $args = func_get_args(); return call_user_func_array('_xmlrpc', $args); } function _drupal_bootstrap_full() { static $called; global $locale; if ($called) { return; } $called = 1; require_once './includes/theme.inc'; require_once './includes/pager.inc'; require_once './includes/menu.inc'; require_once './includes/tablesort.inc'; require_once './includes/file.inc'; require_once './includes/unicode.inc'; require_once './includes/image.inc'; require_once './includes/form.inc'; // Set the Drupal custom error handler. set_error_handler('error_handler'); // Emit the correct charset HTTP header. drupal_set_header('Content-Type: text/html; charset=utf-8'); // Detect string handling method unicode_check(); // Initialize all enabled modules. module_init(); // Undo magic quotes fix_gpc_magic(); // Initialize the localization system. $locale = locale_initialize(); } /** * Store the current page in the cache. * * We try to store a gzipped version of the cache. This requires the * PHP zlib extension (http://php.net/manual/en/ref.zlib.php). * Presence of the extension is checked by testing for the function * gzencode. There are two compression algorithms: gzip and deflate. * The majority of all modern browsers support gzip or both of them. * We thus only deal with the gzip variant and unzip the cache in case * the browser does not accept gzip encoding. * * @see drupal_page_header */ function page_set_cache() { global $user, $base_root; if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET') { // This will fail in some cases, see page_get_cache() for the explanation. if ($data = ob_get_contents()) { $cache = TRUE; if (function_exists('gzencode')) { // We do not store the data in case the zlib mode is deflate. // This should be rarely happening. if (zlib_get_coding_type() == 'deflate') { $cache = FALSE; } else if (zlib_get_coding_type() == FALSE) { $data = gzencode($data, 9, FORCE_GZIP); } // The remaining case is 'gzip' which means the data is // already compressed and nothing left to do but to store it. } ob_end_flush(); if ($cache && $data) { cache_set($base_root . request_uri(), $data, CACHE_TEMPORARY, drupal_get_headers()); } } } }