This forum is for questions about upgrading an existing Drupal site. Don't forget to read the UPGRADE.txt file that comes with every Drupal download.

4.7 cron fails with Fatal error: Call to undefined function: form_textfield() in common.inc

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

"href" syntax within 4.7

I've noticed since upgrading to 4.7 that the html syntax required within anchors, i.e. for "href" seems to have changed....

Whereas before:

a href=feedback

would have redireced to page with url "feedback", this no longer works, unless I insert the full url address:

a href=htttp://mydomain.org.uk/feedback

This seems to be happening because "node" gets inserted. Thus:

a href=feedback

directs to page

Amazon associate tools 4.6 -> 4.7

I haven't gotten any complaints yet, but...

The name of the node type that holds information from Amazon.com had to change from 'amazon-node' to 'amazon_node' for technical reasons. The first update doesn't make the necessary changes to the data though. This doesn't affect your ability to create new items, but prevents you from accessing the old ones after an upgrade.

drupal 4.6 -> 7

I am trying to update my drupal site from 4.6x to 4.7x but I am having problems.
I have created a test site, downloaded all my files from my 4.6 site and uploaded them to my test site. I have backed up my 4.6 databases and reloaded them on the test site. I have followed the instructions for upgrading but I have a problem with my .htaccess file. My hosting provider hides my .htaccess file.

from http://drupal.org/upgrade/downloading-drupal-gui
it says to copy

4.7 upgrade problem conent in FireFox but not anywhere else

OK I upgraded yesterday to 4.7 from 4.6 I can see my content in FireFox loged into admin but on my other browser I can see any of my articles and my mate can't as well.

Why could this be is there a setting atht will do it so that I dont have to show to visitors my content?

Please help, I have 8 weeks work of articles 3 a day and I dont want to loose them as I dont trust my backup system :(

Precondition failed errors

Since moving to 4.7, I've had a couple of users complain about "Precondition failed" errors. Here is the error:

Precondition Failed

The precondition on the request for the URL /classes/ evaluated to false.

Here is a post that causes this error:

This is a test. I am going to post an example of a command.

telnet www.mysite.com 80

This one posts OK:

telnet&nbsp;www.mysite.com 80

Here is a post that causes this error:

I use CVS. I like using CVS. When asked which CVS I used, I say just use it.

Here is a post that is OK:

I use CVS. I like using it. When asked which one I used, I say just use it.

The last one is particularly mystifying. Anyway, could anyone tell me what is making these checks and how I might make it a little less enthuiastic? Thanks ;)

JohnR

PS just tried turning off the HTML filter and the line-break filter and it seems to make no difference.

Pages

Subscribe with RSS Subscribe to RSS - Upgrading Drupal