There is a linked entity id field in user points transactions table which references the entity of the transaction (ie; node id). When I try to add that relationship in views I get the following warning:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'userpoints_txn.nid' in 'on clause'
You can also see from the query below it is trying to find nid rather than entity id.
SELECT userpoints_txn.points AS userpoints_txn_points
FROM
{userpoints_txn} userpoints_txn
INNER JOIN {node} node_userpoints_txn ON userpoints_txn.nid = node_userpoints_txn.nid
Any suggestion? This is a view based on user points transactions and trying to link a node relationship. I will try a node view and link the transaction relationship.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | cant_relate_to_node-1668498-3-D7.patch | 609 bytes | dimilias |
Comments
Comment #1
IWasBornToWin commentedJust tried view other way around (node view with linked user point.). No option available.
Comment #2
holtzermann17 commentedI also have this issue on 7.x-1.0.
Modifying the 'field' on line 430 of userpoints.views.inc from 'nid' to 'entity_id', like so...
... gives me some results -- but for some reason it only seems to work for adding content, not for revisions or deletions. Also, with
'base' => 'node'hardcoded in there, I question whether this will work for points associated with other kinds of entities.I get this warning, which I think is associated with the revisions (for which no node-related info is showing up).
There are some relevant comments about setting up a "variable base" here: http://drupal.org/node/1748480
Comment #3
dimilias commentedI am changing this to 7.x-1.x as I have turned the answer from comment #2 into a patch. Don't know if it applies in 7.x-2.x but this is also an issue in 7.x-1.x. It can be ported for the newest dev.