Hi,

I had some error message of this kind as well when I re-activated this module again. I used it but deactivated as there was some trouble with Content Access. Then I decided not to use Content Access and installed the current version of this module (before I had an older version) and run update.php. This is just a little information in case that it might have something to do with that.

This is currently the error message which appears with every cron:

Duplicate key name 'similar_field_status_value' query: ALTER TABLE content_type_uprofile ADD FULLTEXT `similar_field_status_value` (`field_status_value`) in /var/www/vhosts/mysite.com/httpdocs/sites/all/modules/similar/similar.module in Zeile 97.

Best,
Tobias

Comments

droprocker’s picture

I do have the same issue!!! Ist there any solution yet?

This is the line 97 in the similar.module file we are talking about:

db_query("ALTER TABLE {". $table ."} ADD FULLTEXT `$index` (`%s`)", $column);

What's wrong here?

liland’s picture

have some problem. this error message and similar entries doesnt show any similar nodes anymore.

tobiberlin’s picture

Another error message appearing as well during cron is the following:

	Column 'field_magazin_video_format' cannot be part of FULLTEXT index query: ALTER TABLE content_type_magazinbeitrag ADD FULLTEXT `similar_field_magazin_video_format` (`field_magazin_video_format`) in /var/www/vhosts/diaet-clique.de/httpdocs/sites/all/modules/similar/similar.module in line 97.

This appears as well with some other CCK fields.

costinius’s picture

I guess the _similar_add_index function in the beta4 release is totally messed up (maybe due to a wrongly applied patch or something). I've tried to fix it and it seems to work fine now. Here is the corrected version:

function _similar_add_index($table, $column) {
  $indexed = similar_get_indices();
  if (db_table_exists($table)) {
	if (isset($indexed[$table][$column])) {
	  return;
	} 
    if (!empty($column)) {
      $index = 'similar_'. $column;
      db_query("ALTER TABLE {". $table ."} ENGINE = MYISAM");
      db_query("ALTER TABLE {". $table ."} ADD FULLTEXT `$index` (`%s`)", $column);
      $indexed[$table][$column] = $column;
    }
  }
  elseif (isset($indexed[$table])) {
    unset($indexed[$table]);
  }
  variable_set('similar_indices', $indexed);
}
dichevad’s picture

@Constantine

Thank you so much! Your corrected version worked for me - much appreciated!

droprocker’s picture

Thanx so much for the patch. It got much better, but I'm still getting the following error-message:

warning: array_filter() [function.array-filter]: The first argument should be an array in [my_path]/sites/all/modules/views/modules/node/views_plugin_argument_validate_node.inc on line 58.

any solution for this?

andyceo’s picture

Status: Active » Needs review
StatusFileSize
new863 bytes

Create a patch from #4.

jenlampton’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Issue queue triage, closing all 6.x issues. If this one is still a problem for Drupal 7, please re-open.