Hi. Lately I found a long sheet of error reports on every user profile on my site:
user warning: Unknown column 'user_relationships.uid' in 'on clause' query: SELECT COUNT(*) FROM (SELECT users_user_relationships.name AS users_user_relationships_name, users_user_relationships.uid AS users_user_relationships_uid, users_user_relationships.picture AS users_user_relationships_picture, users_user_relationships.mail AS users_user_relationships_mail, user_relationship_types_user_relationships.plural_name AS user_relationship_types_user_relationships_plural_name FROM user_relationships user_relationships LEFT JOIN users users_user_relationships ON user_relationships.uid = users_user_relationships.uid LEFT JOIN users users_user_relationships_1 ON user_relationships.uid = users_user_relationships_1.uid LEFT JOIN user_relationship_types user_relationship_types_user_relationships ON user_relationships.rtid = user_relationship_types_user_relationships.rtid WHERE (user_relationships.approved = '1') AND (user_relationships.requester_id = 1 ) ) count_alias in ..../sites/all/modules/views/plugins/views_plugin_pager.inc on line 141.
user warning: Unknown column 'user_relationships.uid' in 'on clause' query: SELECT users_user_relationships.name AS users_user_relationships_name, users_user_relationships.uid AS users_user_relationships_uid, users_user_relationships.picture AS users_user_relationships_picture, users_user_relationships.mail AS users_user_relationships_mail, user_relationship_types_user_relationships.plural_name AS user_relationship_types_user_relationships_plural_name FROM user_relationships user_relationships LEFT JOIN users users_user_relationships ON user_relationships.uid = users_user_relationships.uid LEFT JOIN users users_user_relationships_1 ON user_relationships.uid = users_user_relationships_1.uid LEFT JOIN user_relationship_types user_relationship_types_user_relationships ON user_relationships.rtid = user_relationship_types_user_relationships.rtid WHERE (user_relationships.approved = '1') AND (user_relationships.requester_id = 1 ) ORDER BY user_relationship_types_user_relationships_plural_name ASC LIMIT 0, 12 in ..../sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1150.
I wonder this bug is on User Relationships side or on a new version of Views (3.x)? User Relationships incompatible with Views 3.x or should I report about this on a Views bug tracking?
Comment | File | Size | Author |
---|---|---|---|
#41 | user_relationship_views.views_.inc_.patch | 1.19 KB | neurovation.kiwi |
#37 | user_relationship_views-views3-compatability-128563-37.patch | 2.48 KB | mrf |
#34 | Views 3 compatability fix | 2.2 KB | mrf |
#25 | relationship_fix-1285636-25.patch | 1.17 KB | vishun |
#19 | user_relationship_views.views_.vishun.inc_.patch | 1.66 KB | vishun |
Comments
Comment #1
mrf CreditAttribution: mrf commentedWell it looks like views 3 on Drupal 6 has over 8k users despite it being in alpha so we'll have to put it on the testing list for sure.
If you can provide more information about which UR views you have enabled when these errors were triggered that would be helpful.
Comment #2
STINGER_LP CreditAttribution: STINGER_LP commentedThat's the question... None of it, all UR views terned off.
Comment #3
mrf CreditAttribution: mrf commentedThe plot thickens, I'll try to take a look at this one soon. Tagging for a closer look.
Comment #4
MasterChief CreditAttribution: MasterChief commentedI have the same bug, and it was working before, i am using views 3.x too.
Comment #5
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedI've also got the same issue - recently upgraded to views 3 on the dev version of a site, and now get the same error. Am using UR 6.x-1.0
I've not enabled any of the default UR views, but the error appears on a custom view I built listing all relationships, and some views that were generated by Advanced Profile Kit on the profile panel.
I can test with the default UR views, if you need?
Comment #6
mrf CreditAttribution: mrf commentedAre you using 6.x-3.x-dev or 6.x-3.0-alpha of views? I didn't get errors with the two default views on the alpha.
Any chance you can attach an export of the problematic views?
Comment #7
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedah ok, yeah - it was 6.x-3.x-dev that was causing the issues.
6.x-3.0-alpha seems to play nicely - thanks!
Edit: Although reverting back has lost me a whole lot of styling :(
Comment #8
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedI had to admit defeat and go back to using 6.x-3.x-dev - too much of my site broke by reverting to the alpha.
Attached is an export of the view that results in this error:
user warning: Unknown column 'user_relationships.uid' in 'on clause' query: SELECT COUNT(*) FROM (SELECT user_relationships.approved AS user_relationships_approved, users_user_relationships_1.name AS users_user_relationships_1_name, users_user_relationships_1.uid AS users_user_relationships_1_uid, users_user_relationships.name AS users_user_relationships_name, users_user_relationships.uid AS users_user_relationships_uid, user_relationships.updated_at AS user_relationships_updated_at FROM user_relationships user_relationships LEFT JOIN users users_user_relationships ON user_relationships.uid = users_user_relationships.uid LEFT JOIN users users_user_relationships_1 ON user_relationships.uid = users_user_relationships_1.uid WHERE user_relationships.approved = '0' ) count_alias in /home/inkydcom/public_html/tickmarkers/sites/all/modules/views/plugins/views_plugin_pager.inc on line 141.
user warning: Unknown column 'user_relationships.uid' in 'on clause' query: SELECT user_relationships.approved AS user_relationships_approved, users_user_relationships_1.name AS users_user_relationships_1_name, users_user_relationships_1.uid AS users_user_relationships_1_uid, users_user_relationships.name AS users_user_relationships_name, users_user_relationships.uid AS users_user_relationships_uid, user_relationships.updated_at AS user_relationships_updated_at FROM user_relationships user_relationships LEFT JOIN users users_user_relationships ON user_relationships.uid = users_user_relationships.uid LEFT JOIN users users_user_relationships_1 ON user_relationships.uid = users_user_relationships_1.uid WHERE user_relationships.approved = '0' LIMIT 0, 10 in /home/inkydcom/public_html/tickmarkers/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1150.
Comment #9
iRex CreditAttribution: iRex commentedsubscribing
Comment #10
jimijamesi CreditAttribution: jimijamesi commentedThis also happens for us... user warning: Unknown column 'user_relationships.uid' ...etc.
using 6.x-3.x-dev version of views
basic views incl. in user-relationships work fine
my custom view breaks as soon as I add a value(displayed below) in the Relationships section (of the view build UI)
User relationships: Requestee user
(requestee) Node: Content Profile
each of the above Relationship values will cause an error to start appearing but the
user warning: Unknown column 'user_relationships.uid' is caused by the -> User relationships: Requestee user
let me know if you want an export of the view or more details.
edit: I was able to get my custom view working by regressing to views6.3alpha3 - however this is a year old and it may or may not work for some other functionality (apache solr map results)... I would much rather use views 6.3.x-dev (which is the latest nightly build)
Comment #11
mrf CreditAttribution: mrf commentedIn case someone else wants to get started on this before I get a chance. :)
Comment #12
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedI don't suppose anyone has been able to start looking at this yet?
My client wants to take the site live in the next week and wondering whether we'll have the UR views available.
if I could give him a time-frame it would also be helpful (a week, two weeks? A month?)
Comment #13
mrf CreditAttribution: mrf commentedI can't promise any time to this myself in the next couple of weeks. But if someone else has a chance to look at it I will definitely find the time to review and commit any necessary patches.
Comment #14
broncomania CreditAttribution: broncomania commentedSame Problem here.
Comment #15
gateway69 CreditAttribution: gateway69 commentedI also have this issue.. anyone found a solution outside of backing up to an alpha?
Comment #16
kevstav13 CreditAttribution: kevstav13 commentedBacking up to an earlier alpha version didn't do it for me, but I did have a previous 6.x-3.x-dev version before this last release, and backing up to that version saved me and I know longer get the "unknown column uid" error.
I've attached it. Hopefully it works out for all of you too.
Comment #17
vishun CreditAttribution: vishun commentedI believe I may have fixed the issue. I decided to focus on the 2nd database query error and basically it was trying to do a JOIN on the user_relationships database table with the database field 'uid' which is non-existent. Since JOINs and such are usually related to Relationships, I focused on that area of UR. A patch that fixes those 2 errors are attached, but whether or not it affects anything else regarding UR and views, not sure yet. Please test and let us know.
Comment #19
vishun CreditAttribution: vishun commented-p1 style patch
Comment #21
vishun CreditAttribution: vishun commented#19: user_relationship_views.views_.vishun.inc_.patch queued for re-testing.
bah :) its 2 simple changes
user_relationships/user_relationship_views/user_relationship_views.views.inc
line 89 change 'uid' to 'requester_id'
user_relationships/user_relationship_views/user_relationship_views.views.inc
line 120 change 'uid' to 'requestee_id'
Comment #23
knic CreditAttribution: knic commentedWorking for me so far so good...
Comment #24
BerdirThat's not a -p1 patch, it's the opposite.
I suggest you use git to create patches, because that isn't a unified patch format either.
Comment #25
vishun CreditAttribution: vishun commentedComment #26
vishun CreditAttribution: vishun commentedComment #28
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedI found another thread on this same topic, where the patch supplied has resolved the UR / views that were giving me issues:
http://drupal.org/node/1312956#comment-5168604
Comment #29
mrf CreditAttribution: mrf commentedI'm leaving this open for 6.x but it looks like people have had success with the patch on the 7.x issue linked above. Can anyone confirm if that patch or the one posted here resolves the issue for them on 6.x-1.0 or dev?
Comment #30
broncomania CreditAttribution: broncomania commentedI tested it with 6.x-1.0 and views 3 alpha 4 and it works for me. Thx for your work!
Comment #31
mrf CreditAttribution: mrf commentedOk, the other side of that equation, anyone run this patch and can confirm it doesn't break views 2? I'll test both scenarios myself before adding this in but I'd like to know if anyone has tried it.
Comment #32
Aldus CreditAttribution: Aldus commented6.x still has this problem. #16 hopefully solves it for me, but what happened to views after that version!? :|
Comment #33
ayalon CreditAttribution: ayalon commentedThe path in #25 works. It's now on my live system.
Important: you have to clear the cache after applying this patch, because the views schema is cached.
Comment #34
mrf CreditAttribution: mrf commentedReported success on d6 with this patch from #1312956: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user_relationships.uid' in 'on clause'. Credit to samhain and ghostthinker.
Anyone tried any of these patches with the Views 2.0 yet to make sure we're not breaking what used to work?
Comment #35
mrf CreditAttribution: mrf commentedComment #37
mrf CreditAttribution: mrf commentedOne more try with that patch, looks like we've moved things around a bit.
Comment #38
mrf CreditAttribution: mrf commentedDid some click-around testing on both Views 2.x and 3.x and Drupal 6 with the patch from 37.
Everything seems to be working correctly, but would love to get some feedback on this particular patch from someone running customized views and on real production relationship data.
Comment #39
mrf CreditAttribution: mrf commentedNote to self to remove duplicate line near #123 before committing this.
Comment #40
protoplasm CreditAttribution: protoplasm commentedI can confirm that this cleared up my problem with Views 3 and User Relationships not working in a totally up-to-date 6.x. installation on a relatively complex production site. I had to make the changes manually. Legacy patch, non-git, patching didn't work.
Comment #41
neurovation.kiwi CreditAttribution: neurovation.kiwi commentedhi folks,
it's not fixed with me. i had to change an additional thing (the relationship definition)
please review this patch
cu
kiwi
Comment #43
protoplasm CreditAttribution: protoplasm commentedI thought those relationships were fixed in #37. The patch in #37 failed to apply all of the changes when I used patch, so I made all the changes by hand and it worked.
#37 is working on a 2000 member social networking site with complicated UR relationships and filters. At least I can't see anything wrong yet and I've had no complaints--yet.
Comment #44
mrf CreditAttribution: mrf commentedneurovation, your changes are a small subset of what is included in #37, what you have is basically the absolute minimum to get this working, but 37 includes some additional data that ends up making UR views a lot more flexible, and I'm pretty sure the left field would speed this views query up, but not so sure about why that one is there, but want to match the d7 version as closely as possible to leave open the ability to move UR views from 6-7.
Comment #45
gateway69 CreditAttribution: gateway69 commentedthis getting pushed into a newer release?
Comment #46
mrf CreditAttribution: mrf commentedCommitted to 6.x-1.x-dev
Comment #47
mrf CreditAttribution: mrf commentedSince this was a pretty major bug for people on Views 3 (which now has a full release for 6) I went ahead and published 6.x-1.2 that includes this fix.