Scott,
Thanks in advance for both this module and content recommendations. I have a quick question regarding views and am not sure whether to ask it here or there. I am trying to create a view of either similar nodes (similarity) or recommended nodes (cre), both using the latest dev builds.
My similarity object is:
Name: Voting
Minimum similarity score: 50
Time limit: 1 min
Node Throttle: 100
Node Types: (My targeted node type)
Vote tag: vote
Now I go to create a view. I add field for node title only to make the output very basic with two filters - node:published:yes and node:type:mynodetype. I then try arguments -> similarity: voting similarity NID. After adding this, I get:
Error: handler for myhostname > mydomainname_similarity.nid2 doesn't exist!
OK, so I figure maybe argument isn't where to start. I remove argument, and then try it on sort criteria. I choose similarity -> voting similarity score for this. Now I see a different error:
Error: handler for myhostname > mydomainname_similarity.score doesn't exist!
OK, so I figure maybe this isn't working properly and I remove that and try a sort by Recommendations -> Predicted rating, descending. This comes up with 0 results, even though I have rated some content previously.
What am I missing? I thought we might need to bring in a relationship to the voting results but that didn't seem to go either. Maybe I am missing something here. I don't need a lengthy explanation but a pointer in the right direction would be much appreciated. Thanks in advance.
Comments
Comment #1
rjbrown99 commentedA few more notes.
When I try for the argument:similarity:voting similarity NID, if I ignore the error and click Update I see this in the http logs:
[Mon May 18 16:44:46 2009] [error] [client 1.2.3.4] PHP Fatal error: Call to a member function options_validate() on a non-object in /usr/local/www/apache22/data/sites/all/modules/views/includes/admin.inc on line 2338, referer: http://myhostname.com/admin/build/views/edit/myviewname
It breaks before the query is updated at the bottom, so the SQL statement is never updated.
It does not error on the Recommendations:Predicted Rating sort, but it comes back with no recommendations. Here is the resulting SQL statement if it helps.
SELECT node.nid AS nid,
node.title AS node_title,
cre_recommendations.score AS cre_recommendations_score
FROM node node
INNER JOIN cre_recommendations cre_recommendations ON node.nid = cre_recommendations.nid AND cre_recommendations.uid = '***CURRENT_USER***'
WHERE (node.status <> 0) AND (node.type in ('file'))
ORDER BY cre_recommendations_score DESC
Comment #2
Scott Reynolds commentedgoing to take a look and see if i can reproduce
Comment #3
rjbrown99 commentedThanks. I am using the Views 6.x-2.x-dev version as of May 20th. There was a new dev commit yesterday but it only has to do with Ukranian translation so it should not impact this. I can pull anything else you might need - SQL or otherwise. I appreciate your time!
Comment #4
rjbrown99 commentedInteresting things are showing up in the logs at the same time cron is run:
Log message #1:
array_merge(): Argument #3 is not an array in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 73.Log message #2:
Access denied for user 'mydrupaldbuser'@'localhost' to database 'mydrupaldb' query: CREATE TEMPORARY TABLE meta_data Engine=HEAP SELECT n.nid, SQRT(SUM(POW(v.value / 100, 2))) as mag FROM node n INNER JOIN votingapi_vote vote ON vote.content_id = n.nid AND vote.type = 'node' WHERE n.nid > 0 AND (n.type = '') GROUP BY n.nid ORDER BY v.content_id LIMIT 0, 0 in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 77.Log message #3:
Table 'mydrupaldb.meta_data' doesn't exist query: ALTER TABLE meta_data ADD PRIMARY KEY (nid) in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 78.Log message #4:
Access denied for user 'mydrupaldbuser'@'localhost' to database 'mydrupaldb' query: CREATE TEMPORARY TABLE mag_table Engine=HEAP SELECT v.content_id as nid, SQRT(SUM(POW(v.value / 100, 2))) as mag FROM votingapi_vote v WHERE v.type = 'node' GROUP BY v.content_id in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 81.Log message #5:
Table 'mydrupaldb.mag_table' doesn't exist query: ALTER TABLE mag_table ADD PRIMARY KEY(nid) in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 82.Log message #6:
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 '.com_similarity s INNER JOIN meta_data m ON m.nid = s.nid1' at line 1 query: DELETE s FROM myserver.mydomain.com_similarity s INNER JOIN meta_data m ON m.nid = s.nid1 in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 87.Log message #7:
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 '.com_similarity s INNER JOIN meta_data m ON m.nid = s.nid2' at line 1 query: DELETE s FROM myserver.mydomain.com_similarity s INNER JOIN meta_data m ON m.nid = s.nid2 in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 88.Log message #8:
Table 'mydrupaldb.meta_data' doesn't exist query: SELECT nid FROM meta_data in /usr/local/www/apache22/data/sites/all/modules/similarity/classes/similarity_cosine_vote.inc on line 92.FWIW, I am using MySQL 5.0.77 on FreeBSD 7.2.
Comment #5
Scott Reynolds commentedthe first message is a code error. I will try and find it.
The rest of the messages seem to be the result of your site not being set up properly. namely, the Access denied. Means that your user can't create temporary tables: http://drupal.org/requirements
This module requires the create temporary grant.
This is probably causing a lot of ur issues.
Comment #6
rjbrown99 commentedAah interesting, my initial permission set was:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES on drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'mypass';
I never had CREATE TEMPORARY TABLES since nothing else used them until now. I added that and it should take care of a number of issues.
Comment #7
Scott Reynolds commentedupdating title and tagging
Comment #8
socialnicheguru commentedI have for a field for views
Error: handler for mynode_terms_similarity > score doesn't exist!
the handler show up fine for sort.
Is there supposed to be one for filters?
Comment #9
Scott Reynolds commentedPlease open a separate issue. And no there isn't supposed to be a filter. Haven't decided on how that filter would work yet.