Fatal error: Call to undefined function: form_textfield() in /home2/kiev1or/public_html/drupal/modules/fckeditor/fckeditor.module on line 70

(module legacy is enable)
(Last week all worked, and now something in Drupal-cvs have spoiled)

CommentFileSizeAuthor
#2 fckeditor_setting.module1.86 KBEd Geraghty

Comments

webchick’s picture

This module needs to be updated to the new Forms API for Drupal 4.7.

See http://drupal.org/node/33338 for more info.

Ed Geraghty’s picture

StatusFileSize
new1.86 KB

I'm sort of a newbie but I started to convert the FCKeditor to the forms API.. I still need to figure out why the textfield is not calling the fckeditor editor. With the following patch you will get the Administration -> settings -> fckeditor menus.

kiev1.org’s picture

Thanks. I have already made it, but it all the same does not work, - not work hook Implementation of textarea function fckeditor_textarea ($op, $name)

kiev1.org’s picture

Really there is no idea? Help to repair please FCKeditor under Drupal 4.7

kiev1.org’s picture

That again normally worked WIZIWIG EDITORs it is necessary to return in a file form.inc this code

function theme_textarea($element) {
  $cols = $element['#cols'] ? ' cols="'. $element['#cols'] .'"' : '';



//////------------------------!!!!!!!!!!!!!!!-------------------------------///////
//////////////////////        It have lost for some reason             /////////////

  foreach (module_list() as $module_name) {
    if (module_hook($module_name, 'textarea')) {
      $pre  .= module_invoke($module_name, 'textarea', 'pre', $name);
      $post .= module_invoke($module_name, 'textarea', 'post', $name);
    }
  }
//////------------------------^^^^^^^^^--------------------------///////




  return theme('form_element', $element['#title'], '<textarea'. $cols .' rows="'. $element['#rows'] .'" name="'. $element['#name'] .'" id="' . $element['#id'] .'" class="'. _form_get_class('textarea', $element['#required'], form_get_error($element)) .'"'. drupal_attributes($element['#attributes']) .'>'. check_plain($element['#value']) .'</textarea>', $element['#description'], $element['#id'], $element['#required'], form_get_error($element));
}
Vidarls’s picture

Category: bug » task
Priority: Critical » Normal

I've updated the module to work with 4.7 (in my ingorance I didn't see this issue, so I started a new one here: http://drupal.org/node/41288 )
I used hook_elements insead of the obsolete hook_textarea. But as it is now the reworked module only replace textareas with the id edit-body, (the default body textarea for all nodes) this may or may not be a good thing, ideally one should be able to turn it on and off on a per textarea basis, and store a default setting for each textaera (something for the TODO list maybe :P )

I've tested my reworked module, and it works for me running 4.7 beta1 and FCKeditor 2.1.1

-Olegu

paddy_deburca’s picture

Hi,

I just installed your module on a 4.7.2 installation and all is well. I tried to make the module work myself - but with all the API changes since 4.6, using yours was a lot easier.

My only comment, though. My log shows errors with array handling on lines 231 and 234. I put a couple of tests around the effected lines and no more error messages in the log.


function _fckeditor_autoreplace($element) {
  static $fckeditor_autoreplace_textareas;

  if (empty($fckeditor_autoreplace_textareas)) {
    $names = array();
    $lines = split("[,\n\r]", variable_get('fckeditor_autoreplace', 'node/add/*|edit[body]'));
    foreach ($lines as $line) {
      if ($line = trim($line)) {
        list($path, $name) = explode('|', $line);
	    $names[$path][] = $name;
      }
    }
    $path = drupal_get_path_alias($_GET['q']);
    if (isset($names[$path])) { // make sure there is content
      $fckeditor_autoreplace_textareas = array_values($names[$path]);
    }
  }
 
  return is_array($fckeditor_autoreplace_textareas) && (in_array($element['#name'], $fckeditor_autoreplace_textareas)); // verify that it is an array first
}

I can submit a patch it you wish.

Thanks,

Paddy.

paddy_deburca’s picture

Sorry!

This should have been posted in http://drupal.org/node/41288

Paddy.

thierry_gd’s picture

Status: Active » Closed (duplicate)