Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
fieldapi data
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Dec 2010 at 04:27 UTC
Updated:
12 Jan 2011 at 19:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerPlease update to a recent version of ctools.
Comment #2
rosborn commentedThanks - That was the one module where I was still using an alpha version. That has fixed the immediate error, but my non-standard fields are still not being displayed, although I can now edit all their properties.
Comment #3
bojanz commentedWhat is a non-standard field?
A text/numeric field added via Fields UI?
Or a field whose type is defined by a contrib module (yours, perhaps)?
Can you give me a screenshot of the devel load node output (I want to see the structure of the fields not displayed).
Comment #4
rosborn commentedMy PHP isn't up to creating my own modules yet. I created text and term reference fields using the "Manage Fields" tab of the Account settings admin page (see screenshot). I then added the fields to the Views fields output (screenshot), but only the standard "User" fields show up in the preview (screenshot).
I am attaching the Devel Load output screenshot for one of the user pages, with one of the fields (field_phone) expanded. The fields show up without problem on the user pages themselves.
The MySQL query is here:
---
SELECT field_data_field_staff.entity_id AS field_data_field_staff_entity_id, field_data_field_staff.entity_type AS field_data_field_staff_entity_type, field_data_field_staff.delta AS field_data_field_staff_delta, field_data_field_staff.language AS field_data_field_staff_language, field_data_field_staff.field_staff_tid AS field_data_field_staff_field_staff_tid, users.picture AS users_picture, users.uid AS uid, users.name AS users_name, users.mail AS users_mail, field_data_field_profile.entity_id AS field_data_field_profile_entity_id, field_data_field_profile.entity_type AS field_data_field_profile_entity_type, field_data_field_profile.delta AS field_data_field_profile_delta, field_data_field_profile.language AS field_data_field_profile_language, field_data_field_profile.field_profile_value AS field_data_field_profile_field_profile_value, field_data_field_profile.field_profile_format AS field_data_field_profile_field_profile_format, field_data_field_phone.entity_id AS field_data_field_phone_entity_id, field_data_field_phone.entity_type AS field_data_field_phone_entity_type, field_data_field_phone.delta AS field_data_field_phone_delta, field_data_field_phone.language AS field_data_field_phone_language, field_data_field_phone.field_phone_value AS field_data_field_phone_field_phone_value, field_data_field_phone.field_phone_format AS field_data_field_phone_field_phone_format FROM {users} users INNER JOIN {users_roles} users_roles ON users.uid = users_roles.uid LEFT JOIN {field_data_field_staff} field_data_field_staff ON users.uid = field_data_field_staff.entity_id AND (field_data_field_staff.entity_type = :views_join_condition_0 AND field_data_field_staff.deleted = :views_join_condition_1) LEFT JOIN {field_data_field_profile} field_data_field_profile ON users.uid = field_data_field_profile.entity_id AND (field_data_field_profile.entity_type = :views_join_condition_2 AND field_data_field_profile.deleted = :views_join_condition_3) LEFT JOIN {field_data_field_phone} field_data_field_phone ON users.uid = field_data_field_phone.entity_id AND (field_data_field_phone.entity_type = :views_join_condition_4 AND field_data_field_phone.deleted = :views_join_condition_5) WHERE (( (users_roles.rid IN ('4')) )) ORDER BY field_data_field_staff_field_staff_tid ASC, users_name ASC
----
Hope this all helps.
Comment #5
rosborn commentedI just realized that I probably need to make this active again, now that I have provided extra information. Still new to this game.
I'm afraid that I haven't tested this with any Dev versions since Dec. 24, and I probably can't now until D7 is finally released since I don't want to break my site.
Comment #6
dawehnerIf you use drupal7 on your live site you should have a development setup. Therfore clone your drupal files + drupal database and setup your drupal somewhere else.
There you can experiment/test current versions/test your changes.
Comment #7
dawehner* Can reproduce the problem.
* Here is a fix.
Comment #8
dawehnerThis is a much better patch.
Comment #9
bojanz commentedWe don't need that (in fact, it won't work if we are passing $entity_type).
That is done automatically by field_info_instances:
The actual fix is in passing bundle as NULL, and not as empty string, allowing the code above to work correctly.
Comment #10
bojanz commentedLet's try just this :)
Comment #11
dawehnerOh
in entity_get_info();
Here is a new patch based on this.
Comment #12
dawehner@bojanz
When you just set the $bundle = NULL it fails with a php error :(
Comment #13
bojanz commentedYeah, I didn't realize it still keyed it by $entity_type if there was no $bundle. Sorry!
#11 looks fine.
I'd change this comment:
to
But that can be done before commit, and after rosborn confirms this works for him :)
Comment #14
dawehnerHere is a new patch.
Comment #15
rosborn commentedThat's impressive. Just applied the #14 patch, and now all my fields show up as requested.
Thanks for getting this fixed so quickly.
Comment #16
bojanz commentedComment #17
dawehnerThanks
Commited to the 7.x-3.x branch.