I am trying to add a column (numeric), and it keeps giving me this error:

" * Low field is required for bar chart and must be numeric
* High field is required for bar chart and must be numeric"

This is only supposed to happen if I select Bar Chart...NONE of my columns are Bar Chart, yet it is saying I need to fill this out. Even if I do put in random numbers for bar chart, it still gives me that same error.

Comments

Anonymous’s picture

Oh and I forgot to mention. This only happens when I am trying to Edit and already created table.

pobster’s picture

Ah yeah... I'd forgotten about this... I put this in intentionally and then forgot to complete it... How bad is that?!!! ;o) I figured that it'd be handy to be able to allow high and low brackets to a numeric input if required. I erm, then got distracted somehow and forgot all about it... I still think it's a good idea to implement though? Anyways :o)

/**
 * Validation function for tablemanager_tableedit form
 */
function tablemanager_tableedit_validate($form_id, &$form) {
  global $form_values;
  tablemanager_validatestring($form['name'], 'name');
  for ($i = 1; $i <= $form['cols']; $i++) {
    if ($form['sort'.$i] && !$form['item'.$i]) {
      form_set_error('item'.$i, t('Due to Drupal restrictions, a sortable column cannot have a blank id.'));
    }
    $form['item'.$i] = check_plain($form['item'.$i]);
    // High and low value validation:
    if ($form['type'.$i] == "6" || $form['type'.$i] == "2") {  // change me to:
    if ($form['type'.$i] == "6") {

I don't think I'm going to bother releasing a fixed module as I'm close to a new release with a few more features in it. I think I'll just leave this ticket present so if anyone is experiencing this problem then they know how to fix it.

Thanks

Pobster

pobster’s picture

Oops, here also:

/**
 * Validation function for tablemanager_columnadd form
 */
function tablemanager_columnadd_validate($form_id, &$form) {
  global $form_values;
  tablemanager_validatestring($form['name'], 'name');
  for ($i = 1; $i <= $form['cols']; $i++) {
    if ($form['sort'.$i] && !$form['item'.$i]) {
      form_set_error('item'.$i, t('Due to Drupal restrictions, a sortable column cannot have a blank id.'));
    }
    $form['item'.$i] = check_plain($form['item'.$i]);
    // High and low value validation:
    if ($form['type'.$i] == "6" || $form['type'.$i] == "2") {  // change me to:
    if ($form['type'.$i] == "6") {

Pobster

Anonymous’s picture

I'm sorry, what do I do with this code you supplied me with? <---newbie

pobster’s picture

Open up the module in notepad or something and literally just change both the lines:

From:

  if ($form['type'.$i] == "6" || $form['type'.$i] == "2") {

To:

  if ($form['type'.$i] == "6") {

Pobster

pobster’s picture

Assigned: Unassigned » pobster
Status: Active » Fixed

FIXED in todays release. Sorry for the delay! ;o)

Pobster

pobster’s picture

Status: Fixed » Closed (fixed)