Hello,

I'm currently trying to create a view to sort by top rated and also for most rated nodes and when I add the relationship and select data filter percent->myTagName->average or count I get this sql error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'votingapi_cache_node_percent_Votació_average.entity_id' in 'on clause'

this is the query generating the error


SELECT node.nid AS nid, node.title AS node_title, 'node' AS field_data_field_imatge_node_entity_type, 'node' AS field_data_field_comarca_node_entity_type, 'node' AS field_data_field_tipologia_node_entity_type, 'node' AS field_data_field_patrimoni_node_entity_type, 'node' AS field_data_field_duracio_node_entity_type, 'node' AS field_data_field_dificultat_node_entity_type, 'node' AS field_data_field_votacio_node_entity_type
FROM 
{node} node
INNER JOIN {votingapi_cache} votingapi_cache_node_percent_Votaci_average ON node.nid = votingapi_cache_node_percent_Votació_average.entity_id AND (votingapi_cache_node_percent_Votació_average.entity_type = 'node' AND votingapi_cache_node_percent_Votació_average.value_type = 'percent' AND votingapi_cache_node_percent_Votació_average.tag = 'Votació' AND votingapi_cache_node_percent_Votació_average.function = 'average')
LEFT JOIN {field_data_field_votacio} field_data_field_votacio ON node.nid = field_data_field_votacio.entity_id AND (field_data_field_votacio.entity_type = 'node' AND field_data_field_votacio.deleted = '0')
WHERE (( (node.status = '1') AND (node.type IN  ('ruta')) ))
ORDER BY field_data_field_votacio.field_votacio_rating ASC

I've seached for a solution in here with no sucess.

I'm using latest dev
Fivestar: 7.x-2.0-alpha2+3-dev
Voting API 7.x-2.6

Thanks in advance

Comments

joaoverissimo’s picture

Title: Views error when sorting by Votes - votes relationship » Views displays error when vote tag has accents
Priority: Major » Minor

After some time spent trying desperatly to understand the code and the new query API, I've realized that the error was coming from the use of an accent in the vote Tag (the ó in Votació ).I've just changed it to a normal "o" and case closed.

I don't know if the vote tag is displayed somewhere other than in configuration, but I've change the title issue, prioraty and leave it active waiting for an "won fix" or a "postponed" status.

pifagor’s picture

Status: Active » Closed (outdated)