Installation of module without problem, after adding a field to a term via "admin/content/taxonomy/term_fields/new" no result was given under admin/content/taxonomy/term_fields. I've searched for reason and found under the method term_fields_admin():
$result = pager_query('SELECT tf.fid AS fid, tf.title AS title, tf.description AS description, v.name AS name
FROM {term_fields} tf
LEFT JOIN {vocabulary} v ON tf.vid = v.vid
ORDER BY v.name, tf.title', variable_get('term_fields_per_page', 25));
$image_path = drupal_get_path('module', 'term_fields') . '/images/doc-option-add.png';
if (db_affected_rows()) {
$existing_fields = array();
I mean, that
if (db_affected_rows())
doesn't work. db_affected_rows() only determines the number of rows changed by the a query, the "select" doesn't work with my system (postgres).
My solution for that line of code: term_fields.admin.inc
$image_path = drupal_get_path('module', 'term_fields') . '/images/doc-option-add.png';
if ($result) {
$existing_fields = array();
Also the term_fields.module contains that
case 'update':
// see if theres a record for this term already.
// if so, update it. if not, insert a new record
$sql = 'SELECT tid FROM {term_fields_term} WHERE tid = %d';
db_query($sql, $tid);
if (db_affected_rows()) {
// update the existing record
term_fields_term_update_record($tid, $values);
}
else {
// insert a new record
term_fields_term_create_record($tid, $values);
}
break;
I replaced
db_query($sql, $tid);
if (db_affected_rows()) {
with
$result=db_query($sql, $tid);
$r=db_fetch_object($result);
if (is_numeric(intval($r->tid)) && $r->tid >0) {
Comments
Comment #1
archard commentedThanks, I wasn't aware that db_affected_rows doesn't work for postgres. The issue is fixed in the latest release, 6.x-1.2.