Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Today I updated the views module from a dev version from maybe 5 or 6 september to the latest dev version from 10 september.
Then I got this type of message from all my views that has a node_reference relationship
'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'field_data_field_noderef_frontpage_image.nid\' in \'on clause\''
in views_plugin_query_default->execute() (line 1386 of /drupal/dev-7/sites/all/modules/views/plugins/views_plugin_query_default.inc).
.
The view has a node_reference relationship that is the 'field_noderef_frontpage_image'.
If you need any more info, just ask.
Comment | File | Size | Author |
---|---|---|---|
#75 | view.txt | 45.02 KB | slashrsm |
#68 | column_not_found-1275096-68.patch | 1.02 KB | yched |
#56 | 1275096-56-references-column_not_found.patch | 590 bytes | pfrenssen |
#57 | column_not_found-1275096-56.patch | 1.15 KB | rvilar |
#53 | node_reference.module-1323253445.patch | 617 bytes | q11q11 |
Comments
Comment #1
dawehnerAn export which allows to reproduce the issue would be nice.
Comment #2
Scyther CreditAttribution: Scyther commentedBelow is the View that created the Exception above and ut uses the views_nivo_slider and is a views content pane display.
I have tried with a page and other displays and different formats and it still gives this error. Only thing that works is if I remove the relationship, so it seems that it is the problem.
Using latest dev version of Views, CTools and References.
Comment #3
mansspams CreditAttribution: mansspams commentedSame here.
On node page: Debug: 'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'field_data_field_owner_company.nid\' in \'on clause\'' in views_plugin_query_default->execute() (line 1386 of C:\wamp\www\test01\sites\all\modules\views\plugins\views_plugin_query_default.inc).
and on views page: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_supplier_company.nid' in 'on clause'
Comment #4
mansspams CreditAttribution: mansspams commentedProblem started with this commit http://drupalcode.org/project/views.git/commit/2df60e80e3741dadf6d7b2d1c... from issue #1248454: Relationships should respect real field keys
Comment #5
Wappie08 CreditAttribution: Wappie08 commentedI have the same problem, my relationships in views produce an error on every page (even for anonymous users), upgrading to major!
error in views: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_main_ref_comp.nid' in 'on clause'
error on pages containing my block from this view:
Comment #6
Wappie08 CreditAttribution: Wappie08 commentedWhen I try to add a relation and then filter on it I also get "No valid values found on filter: Field: Field_used_for_relationship."
Greetings Wappie
Comment #7
dawehnerIt's kind of funny that noone created an issue on the references module because this seems to bug in this module.
See 'field' this field DOES NOT exist in the $table, it should be probably 'entity_id'.
yes the error is caused by the update of views, but it was just luck that it worked before.
Comment #8
Scyther CreditAttribution: Scyther commentedYes that seems to be the problem dereine.
Patch to fix the problem for both node_reference and user_reference.
Comment #9
psychobyte CreditAttribution: psychobyte commentedScyther,
Applied your patch everything works now!!! Thanx! Any chance you can submit this patch to the references project so it gets into their next release?
Thanks Again!
Comment #10
dawehnerI'm a bit confused, because i never saw this key. Are you sure it is needed here? Did you tryed to drop it?
Comment #11
Scyther CreditAttribution: Scyther commentedI got the same error message for a user_reference relationship as of a node_reference relationship so that why I changed 'field' to 'entity_id' in user_reference.module too.
But after some testing what you said about droping that key and value from that array. It seems to work as well.
Here is a new patch to test.
My views skills is far from yours dereine when it comes to views, so you know this best.
Comment #12
Hydra CreditAttribution: Hydra commentedThis patch looks perfect!
Comment #13
MichelleThe patch in #11 fixed my issue. Thanks!
Michelle
Comment #14
MichelleWhoops, crosspost.
Michelle
Comment #15
awolfey CreditAttribution: awolfey commentedWorks for me.
Comment #16
MyXelf CreditAttribution: MyXelf commentedConfirming the patch in #11 works. Thanks.
Comment #17
DamienMcKenna+1 from me too. Can this be applied soon? Thanks :)
Comment #18
jago84 CreditAttribution: jago84 commentedHaving same problem here, columns 'node_changed_day' and 'node_created_day' (and smaller and bigger time units as well) as order clauses. Trying to create a descending newsfeed.
Comment #19
mErilainen CreditAttribution: mErilainen commentedSeems to be working, no more error message after clearing caches.
Comment #20
KarenS CreditAttribution: KarenS commentedI can confirm the bug. Based on http://drupalcode.org/project/views.git/commitdiff/2df60e80e3741dadf6d7b... this patch looks like it might be the right fix, but I need to poke around and see.
Comment #21
KarenS CreditAttribution: KarenS commentedI think this is the right patch to work with the current dev version of Views. I don't know what happens if this patch is used with the latest official release of Views, which doesn't have that change. It would be nice if someone could confirm if that works or not. If not, I guess we can add a note on the project page that you need the latest dev version of Views until that change gets into an official release.
Comment #22
pfrenssenI had the same problem, patch in #11 solved it.
Comment #23
katbailey CreditAttribution: katbailey commentedI can confirm that applying this patch causes no problems when working with Views 7.x-3.0-rc1 (reference fields in views work as before), and fixes the error when working with the latest Views code.
I also wanted to stick up a version of it with --no-prefix (to work with old drush make).
Comment #25
jmones CreditAttribution: jmones commentedsubscribe
Comment #26
Scyther CreditAttribution: Scyther commentedPatch in #11 seems to be the one to go with.
Comment #27
MyXelf CreditAttribution: MyXelf commented#23: column_not_found_1054_unknown_column-1275096-23.patch queued for re-testing.
Comment #29
dawehnerThe problem is that the patch is for patch -p0
Comment #30
johnvsubscribe.
Comment #31
jenlamptonFor some reason I couldn't get that patch to apply. I couldn't see what was wrong with it, but I made another one just in case.
Comment #32
Scyther CreditAttribution: Scyther commentedThere is no different between the patch in #29 and #31.
Comment #33
dgastudio CreditAttribution: dgastudio commentedCan my problem be related?
every time then i run cron, i have a lot of pages in admin/reports/dblog with the next errors:
Notice: Undefined offset: 1 in DatabaseStatementBase->fetchAllKeyed() (line 2178 of /home/u4586/domains/dev.yogalife.by/includes/database/database.inc).
Notice: Undefined index: uid in DatabaseStatementBase->fetchAllKeyed() (line 2178 of /home/u4586/domains/dev.yogalife.by/includes/database/database.inc).
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'uid' at row 1
Comment #34
pfrenssenKervi, no your problem does not seem to be related to this issue.
Comment #35
dgastudio CreditAttribution: dgastudio commentedsorry, thank u.
Comment #36
brycesenz CreditAttribution: brycesenz commentedsubscribing. The patch in #31 worked for me.
Comment #37
KarenS CreditAttribution: KarenS commentedThis has been committed. Thanks everyone!
Comment #38
Scyther CreditAttribution: Scyther commentedGreat! Thanks
Comment #40
amirtaiar CreditAttribution: amirtaiar commentedI am having this isuue which seems to be rekated:
in views_plugin_query_default->execute() (line 1380 of /home/clients/websites/w_tikke/public_html/tikke/sites/all/modules/contrib/views/plugins/views_plugin_query_default.inc).
And above:
Comment #41
julien.reulos CreditAttribution: julien.reulos commentedAfter upgrading Drupal core from 7.7 to 7.9 (I don't know if it's related), when visiting a view with Field view mode and a Relationship, I get the error too:
The header, exposed filters and the pager display well, but the table doesn't. The error only shows when the Fields view mode is chosen. If I change the Table display for Unformatted list, with Teaser view mode, it works. If I switch to Fields view mode, it doesn't work.
It occurs weither or not I put a Node Reference field, weither or not I add a Relationship to the view.
I have the last versions of References (dev) and Views (dev).
There are some related issues in the References module queue: http://drupal.org/node/1347642, and in the Views module queue: http://drupal.org/node/1344350 and http://drupal.org/node/1248454.
Comment #42
dawehnerDid you cleared your cache before reporing the issue? After the update to references dev you need to clear the cache at least once.
Comment #43
julien.reulos CreditAttribution: julien.reulos commentedYes, I cleared it twice!
So today, digging around more, it appears that the error is caused by the Field group views module. It took me a little time to find it out, as I wasn't expected this module could modify in some way my view.
Thanks for your work dereine, and sorry for the inconvenience.
Comment #44
boomboom3000 CreditAttribution: boomboom3000 commentedI'm very new to Drupal--I've only been working with it for a few weeks. I'm running into this error, as well.
I'm not sure how to apply the patch is my problem. I visited drupal.org/patch and looked at a number of other posts regarding applying patches, but I have to admit, I wasn't able to wrap my head around applying the patch. At this point, I have the patch file saved to the root views folder, but that is as far as I am. I wonder if someone might be able to instruct me on where to go from here.
Thanks!
Adam
Comment #45
dawehnerWell if you can't apply the patch use the dev version or wait until the next release comes out.
Comment #46
adamdicarlo CreditAttribution: adamdicarlo commentedUpdated to the dev version (latest git commit) and the problem's gone for me.
@boomboom3000 the patch is for the References module, not Views. As for how to apply it, well, a Google search for something like "applying patches drupal" should find plenty of resources for you.
Comment #47
dlhost89 CreditAttribution: dlhost89 commentedI have been receiving this error in connection with term references, which I understand are handled in Drupal core, not the References module. I have updated Views and References to their respective dev versions, to no effect (the error continues to appear). Does anyone have any further insights they can share?
Comment #48
Georgique CreditAttribution: Georgique commentedSubscribe
Comment #49
jboese CreditAttribution: jboese commentedRegarding the patch in #31, should it perhaps be:
Instead of:
- 'field' => 'nid',
and also:
Comment #50
shanejose CreditAttribution: shanejose commentedHi, I am new to Drupal and wanted to enquire how and where do I install this patch?
Thank you
Comment #51
pfrenssenShanejose, this is explained in detail in the documentation.
Comment #52
dabblela CreditAttribution: dabblela commentedThe patch did not fix the issue for me; however #49 did the trick.
Comment #53
q11q11 CreditAttribution: q11q11 commentedPatch for node_reference.module according to #49
Comment #54
pfrenssenLet's feed it to the testbot.
Comment #56
pfrenssenThe patch from #53 was rolled against 7.x-2.0-beta3. I rerolled it against 7.x-2.x.
Comment #57
rvilarI attach a patch according to #49.
Comment #58
pfrenssenDisregard patches #53 and #56, they are incomplete.
Comment #59
rvilarPatch in #57 is complete and pass tests.
Comment #60
dlhost89 CreditAttribution: dlhost89 commentedWith all due appreciation for the patches provided (and I am sure they have resolved most of the reported problems), I am still experiencing what appears to be a much broader issue. I am receiving the same error - but not just for node references - in fact, this error is randomly arising when I seek to add Views fields involving term references and even text fields. I applied the patch in #57 to see if it might help in some respect; it did not (and I have cleared cache). Does anyone have any suggestions? This is a major problem impeding my use of Views in many respects. I would really appreciate some help! Thanks.
Comment #61
drupal a11y CreditAttribution: drupal a11y commentedFor me the patch #57 worked well on the latest dev-version for d7. THANKS !!!
Comment #62
nstahl CreditAttribution: nstahl commented..
Comment #63
Nielsa CreditAttribution: Nielsa commentedI used the dev version from october 10th with the patch from comment #57 and it works. thanksI have to come back on my statement. It works if a node has been reference, if there is no reference on a node to a node I get the following error:
I use a contextual filter on my view to fetch the teaser of nodes that are referenced un my current node.
The above error has been solved by setting the relationship in my view to "require this relationship". Now it works like a charm. The patch was good!
Comment #64
puddyglumUpgraded to Drupal 7.9 and had this issue, resolved it by applying this patch.
Comment #65
Crell CreditAttribution: Crell commented#57 Fixed the issue for me as well. This is ready for maintainers, I think.
Comment #66
dawehnerActually $id_column should already contain the right database column, so there is no need to specify field here.
Comment #67
dawehnerSo 'field' => $id_column should fix it as well.
Comment #68
yched CreditAttribution: yched commentedAs per dereine's #67, committed the attached patch.
Truely sorry for letting this drop by for so long.
I'll try to go round the issue queue and roll a new release in the next couple days.
Comment #69
yched CreditAttribution: yched commentedAlso, added a "new maintainer needed" announcement on the project page. It's quite clear now that fgm and I are not putting up (both locked on D6 projects, I'm afraid...)
I'll still try to roll a release asap, though.
Comment #70
owntheweb CreditAttribution: owntheweb commentedHowdy,
I keep running into this issue, and keep finding this page to fix the issue. Thanks for the fix! Can we apply the patch? With a smiley face on top? :D
Thanks for your efforts!
Best regards,
Chris
EDIT: Whoa! It looks like the train has already left the station. I updated to the latest dev version and life is nice. Thanks.
Comment #71
Syd Barrett CreditAttribution: Syd Barrett commentedThe 7x.x-2.x-dev (21-dec) hasn't got this problem .
Thanks for your efforts!
Comment #72
PeteS CreditAttribution: PeteS commentedLatest dev version seems to have cleared this up for me as well. Note: problem wasn't resolved until I cleared caches.
Comment #73
pmflav CreditAttribution: pmflav commentedLatest Dev version as of today seems to have broken this again.
Comment #74
yched CreditAttribution: yched commented@pmflav: there were no recent changes in this area.
Try clearing your caches ?
Comment #75
slashrsm CreditAttribution: slashrsm commentedI confirm existance of this error on 7.x-2.0 from 2011-12-22. Cleared cache a few times and error still appears. I am using Views 7.x-3.0.
This is my query:
and this is my error:
Exported view is attached in .txt.
Comment #76
carvalhar CreditAttribution: carvalhar commentedI got this error today with 7.x-2.0-beta3
#67 and #68 can fix it.
Comment #77
yched CreditAttribution: yched commentedThe 2.0 release contains #68.
@slashsrm : that's surprising - Maybe try recreating the view ?
Comment #78
slashrsm CreditAttribution: slashrsm commented@yched: It was my mistake. I had another instance of references in site's folder, but I upgraded just the one in 'all' folder.
Sorry for that.
Comment #79
yched CreditAttribution: yched commented@slashsrm: OK, thanks for reporting back !
Comment #81
christianchristensen CreditAttribution: christianchristensen commentedRelated issue (in Location module...): http://drupal.org/node/1423540
Comment #82
Ashutosh.tripathi CreditAttribution: Ashutosh.tripathi commented#11 working fine for me