When I open the term that I would like to configure with new two term fields that I previously set up. Drupal send me this WARNING:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release FROM themask_term_fields_term WHERE tid = 4' at line 1 query: SELECT release FROM themask_term_fields_term WHERE tid = 4 in /home1/wrongdes/public_html/drupal/sites/all/modules/term_fields/term_fields.module on line 95.

When I save term with edited term fields. Drupal send me this two warnings (by two term fields).

# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release, number_of_singles) VALUES (4, 'sdfsdf', 'sfsdf')' at line 1 query: INSERT INTO themask_term_fields_term (tid, release, number_of_singles) VALUES (4, 'sdfsdf', 'sfsdf') in /home1/wrongdes/public_html/drupal/sites/all/modules/term_fields/term_fields.module on line 442.

# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release FROM themask_term_fields_term WHERE tid = 4' at line 1 query: SELECT release FROM themask_term_fields_term WHERE tid = 4 in /home1/wrongdes/public_html/drupal/sites/all/modules/term_fields/term_fields.module on line 342.

Thank you for help!

CommentFileSizeAuthor
#4 term_fields_e_all_save-D6.patch772 byteshass

Comments

discuss’s picture

Priority: Normal » Critical
discuss’s picture

Category: bug » support
hass’s picture

Status: Active » Postponed (maintainer needs more info)

Are this really the warning messages or have you altered them? I cannot see anything wrong in the above statements...

hass’s picture

Priority: Critical » Normal
StatusFileSize
new772 bytes

The only notices I've found are these after saving a term:

# notice: Undefined property: stdClass::$fid in sites\all\modules\term_fields\term_fields.module on line 551.
# notice: Undefined property: stdClass::$title in sites\all\modules\term_fields\term_fields.module on line 551.
# notice: Undefined property: stdClass::$fid in sites\all\modules\term_fields\term_fields.module on line 551.
# notice: Undefined property: stdClass::$fid in \sites\all\modules\term_fields\term_fields.module on line 552.
# notice: Undefined property: stdClass::$name in sites\all\modules\term_fields\term_fields.module on line 552.
# notice: Undefined property: stdClass::$fid in sites\all\modules\term_fields\term_fields.module on line 553.
# notice: Undefined property: stdClass::$description in sites\all\modules\term_fields\term_fields.module on line 553.
# notice: Undefined property: stdClass::$fid in sites\all\modules\term_fields\term_fields.module on line 554.
# notice: Undefined property: stdClass::$fid in sites\all\modules\term_fields\term_fields.module on line 554.

And one minor in the admin file. Patch attached.

hass’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Needs review
overbythere’s picture

I can confirm these errors happen, here is my log:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc,title FROM term_fields_term WHERE tid = 13' at line 1 query: SELECT desc,title FROM term_fields_term WHERE tid = 13 in /home/hens/public_html/att/sites/all/modules/term_fields/term_fields.module on line 357.

I have noticed that it is due to the fields not being contained in quotes, I have updated the module accordingly for myself, however when I create the diff file from the HEAD or 6.1 it seems a lot more has changed, so I have included my code changes:

Find where the function term_fields_get_fields starts, and amend:

function term_fields_get_fields($term) {
  if ($fids = term_fields_get_fids($term->vid)) {
    $field_list = "'".implode("', '", $fids)."'"; //Fields (on some SQL setups) need to be in quotes, this includes them.
    $sql = 'SELECT ' . $field_list .  ' FROM {term_fields_term} WHERE tid = %d';
    $result = db_query($sql, $term->tid);

    return db_fetch_array($result);
  }

  return NULL;
}
b-prod’s picture

Version: 6.x-1.9 » 6.x-1.x-dev
Status: Needs review » Fixed

Ported in the 1.16 release

hass’s picture

The standard should be [date], [time] as I know.

Status: Fixed » Closed (fixed)

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