Client updating a task error

sirc - April 19, 2008 - 05:48
Project:Case Tracker Services
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:duplicate
Description

Thanks for this great module, I can see some great potential for my sites...

Just noticed a small bug, when a user goes to update a task (http://test.planet-wealth.com/admin/casetracker_client/case/{nid}) and just adds a comment the case title disappears.

Not sure if this error is because of casetracker or casetrader_services but I fixed it by filling in the title field of the "Case attributes" section. Although that still doesn't prevent the problem where a user deletes the title and doesn't add something (problem is that once you delete the title and then from the list of support issues you can't access a case) - so there probably need some error checking for this case somewhere.

My temp fix, in casetracker_client.module: line 334

Add:

'#default_value' => ($node) ? $node['title'] : '',

So in the function casetracker_client_update from:

function casetracker_client_update($node) {
  // use the same form for case creation and alter it for the context of displaying a node.
  $form = casetracker_client_update_form($node);
  $form['nid'] = array(
    '#type' => 'hidden',
    '#default_value' => $node['nid'],
  );
  $form['title']['#title'] = 'Subject';
  $form['attributes']['#collapsed'] = true;
  $form['attributes']['new_title'] = array(
    '#type' => 'textfield',
    '#title' => t('New title for this case'),
  );
  $form['form_title'] = array(
   '#value' => '<h2>'. t('Update this case') .'</h2>',
   '#weight' => -2,
  );
  return $form;
}

to:

function casetracker_client_update($node) {
  // use the same form for case creation and alter it for the context of displaying a node.
  $form = casetracker_client_update_form($node);
  $form['nid'] = array(
    '#type' => 'hidden',
    '#default_value' => $node['nid'],
  );
  $form['title']['#title'] = 'Subject';
  $form['attributes']['#collapsed'] = true;
  $form['attributes']['new_title'] = array(
    '#type' => 'textfield',
    '#default_value' => ($node) ? $node['title'] : '',
    '#title' => t('New title for this case'),
  );
  $form['form_title'] = array(
   '#value' => '<h2>'. t('Update this case') .'</h2>',
   '#weight' => -2,
  );
  return $form;
}

#1

sirc - April 19, 2008 - 05:55
Status:active» duplicate

Sorry just realized there was already an issue related to this problem.

Although it doesn't appear to have been fixed in the dev version I just downloaded.

http://drupal.org/node/246858

 
 

Drupal is a registered trademark of Dries Buytaert.