I have a number of custom modules developed for a client in 6.x. The most recent enhancements require the use of jQuery 1.4 and jQueryUI 1.8. The existing modules make use of 6.x AHAH, which appears to not be compatible with jQuery 1.4. Thus a migration to 7.x core.

I am having problems converting even the simplest part of the system to 7.0's new form system and could use some help. Here is one working 6.x hook_form -

function workshop_description_form($form, &$form_state, $node) {
 
  $type = node_get_types('type', $node);
    if ($type->has_title) {
    $form['title'] = array(
      '#type' => 'textfield',
      '#title' => check_plain($type->title_label),
      '#required' => TRUE,
      '#default_value' => $node->title,
      '#weight' => -5
    );
  }

  if ($type->has_body) {
    $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
  }
  
  $form['workshop_short_description'] = array(
    '#type' => 'textarea',
    '#title' => t('Workshop Short Description'),
	'#rows' => 5,
    '#default_value' => isset($node->workshop_short_description) ? $node->workshop_short_description : '',
    '#text_format' => isset($edit->format) ? $edit->format : FILTER_FORMAT_DEFAULT,
	'#required' => TRUE,
  );

  $form['workshop_code'] = array(
    '#type' => 'textfield',
    '#title' => t('Workshop Code'),
    '#default_value' => isset($node->workshop_code) ? $node->workshop_code : '',
    '#size' => 5,
    '#maxlength' => 5,
	'#required' => TRUE,
  );

  $form['workshop_bgcolor'] = array(
    '#type' => 'select',
	'#title' => t('Workshop Calendar Background Color'),
	'#default_value' => isset($node->workshop_bgcolor) ? $node->workshop_bgcolor : '#FAF8AC',
	'#required' => TRUE,
	'#options' => array(
	  '#FAF8AC' => t('yellow'),
	  '#B6DDE8'=>t('blue'), 
	  '#99FF99'=>t('green'),
	  '#FCD5B4'=>t('pink'),
    ),
  );	  

  return $form;
}

This was the simplest and I expected the easiest to convert, but it is not working. Suggestions, or pointer to a node edit form example would be greatly appreciated.

Thanks,
Tim

Comments

tim foley’s picture

While I realize that these are trivial fields that could be easily addressed through the Fields API, the majority of the system relies on data presented through views from external databases/servers. So I either have to resolve the 6.x AHAH/jQuery 1.4 incompatibility or move forward to 7.0.

Thanks,
Tim

tim foley’s picture

Okay, I think I have found the issue. In 6.x hook_info used 'module' to define the module name and establish the default name for all other hook functions. This appears to have changed in 7.0 to 'base'. Once this change was made, the edit form now appears to be working correctly. Hope this helps others out...

kars-t’s picture

Status: Active » Fixed

Dear fellow Drupal enthusiasts,

this issue is now lasting for a very long time in the issue queue and was unfortunately never solved. As Drupal is a open source project everyone is helping on voluntary basis. So that this is was not solved is nothing personal and means no harm. But perhaps no one had time to deal with this issue, maybe it is too complex or did not pose the problem comprehensible.

But this issue is not the only one. There are thousands of issues on Drupal.org that have never been worked on or could not be processed. This means that we are building a wave that is unmanageable and just a problem for the Drupal project as a whole. Please help us keep the issue queue smaller and more manageable.

Please read again, "Making an issue report" and see if you can improve the issue. Test the problem with the current Core and modules. Maybe the problem doesn't exist anymore, is a duplicate or has even been solved within this issue but never closed.

Help can also be found for it on IRC and in the user groups.

In order this issue no longer remains, I put this issue to "fixed".

If there is new information, please re-open the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.