Closed (fixed)
Project:
FullCalendar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2011 at 20:07 UTC
Updated:
27 Feb 2011 at 16:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
tim.plunkettWe're talking about the following:
Comment #2
tim.plunkettFrom http://drupal.org/node/1043222#comment-4039750, users->name should be a valid title field.
This is basically a duplicate of #1045530: Properly convert from node view to fields view in a way, in that Views can handle non-Field API fields, and we cant'.
Comment #3
geerlingguy commentedThat would definitely be a nice fix.
Comment #4
aspilicious commentedUsers-> name is a valid title field under normal situations... (tested users->name and commentID)
That is working, only if you have situations where the info is not directly linked to the entity (in relationship stuff) it doesn't work. But I don't know how to test that. Could someone give me step by step insctructions to break our code :).
Thnx!
Comment #5
ben kuper commentedAs asked by tim.plunkett, i repost my patch here.
It's not much for now and i don't know if it would fit most situations, but i works for me with a relationship profile->user.
I didn't want to break the current code so my code will run if $entity->title or $entity->url have not been setup by the current code.
There are a lot of data in $vars, i'm sure there is a way to get all the fields data we want without trying at multiple places.
PS : Does anybody knows where i can find the anatomy of drupal's and module's objects? Like a cheat sheet with user object properties and method, as well as node, entity, view.... That could speed up the dev and searching.
Comment #6
aspilicious commentedHow can I reproduce....
How do you do the relationship stuff...
Comment #7
ben kuper commentedSorry, i'm a bit tired...
- Create a view (in my case profile view, with both latest profile2 & entity api dev modules).
- Add a profile -> user relationship
- Add a date field (must have created at least one date field in the profile).
- Add a user field (like user name or other, it must relies on the relationship)
In the FC Field settings, choose custom title->[the user field], and optionnally custom date->[the date field].
I guess you can use any view base type with any relationship to reproduce it, as the problem is that in the preprocess function, the fields datas are retrieved from the entity. From what i saw, the fields datas seem to present many times in the $vars, so i think there is a place in $vars where we can retrieve all the datas at once.
I didn't modify the date handling part of the preprocess, so it'll probably won't work if the date field comes from a relationship.
Comment #8
aspilicious commentedI can't find the profile view (installed everyhting you said)...
Comment #9
ben kuper commentedI don't know if it's a bug or something i forgot, i couldn't find it for a while too, tried a lot of version, but the patch we were working on entity to support the profile view has been integrated on the last commit (i don't think the downloadable version on the entity homepage is up to date). This is discussed here : #965860: Add views integration
If you downloaded the dev version via the module's homepages, try using the latest cvs version or try applying the entity-views.patch, i don't remember if i had to do it or not.
I also needed to do clear the cache a couple of times to finally see it.
But this is not the only scenario. You can test it with any field that depends on a relationship. If it doesn't belong to the base entity, it won't be found because datas are retrieved from the entity object passed in the $vars.
Comment #10
tim.plunkett#9, this issue was split off from #1043222: Remove the node (load) dependency. See comments #5-8 there.
Comment #11
aspilicious commentedNever mind..
Comment #12
tim.plunkettThere is a lot of confusion in this thread.
I know what proffy means, but I can understand why aspilicious is lost.
I'll work on this one soon.
Comment #13
aspilicious commentedpasting code from irc
Comment #14
tim.plunkettBOOM.
Comment #15
tim.plunkettUpdated to work with $node->created etc. The custom date field doesn't work with it yet, nor does the style validation warning.
Also, URL fields need work.
Comment #16
tim.plunkettOkay, now the validation works.
It also prevents you from dragging or resizing when the date field is a timestamp.
Now onto URLs. Let's see how many patches I get in before aspilicious wakes up.
Comment #17
tim.plunkettThe custom URL field was intended for use with the link module, and if you choose to output it as "URL, plain text", it works fine.
Also, if you use a custom field (either the global one, or by rewriting it), it works fine.
For example, add Node: Path, and set the Rewrite to be "[path]/edit", and it works.
So I think this needs to be reviewed as is, and the URL thing can be revisited.
Comment #18
aspilicious commentedTested this very hard. And I still think the url thing is a regression. In previous version you could like to a username and it would be user/name not some kinda html output. OK you can rewrite the output but that is not rly user friendly. We can do that in a followup but it has to get in quickly.
Except for that this is good to go.
(and it works with profile2)
Comment #19
tim.plunkettIf you uncheck "Link this field to its node/user/whatever", it works just fine. And that's an advanced feature that users of Views may have encountered before. Either way, it needs documentation.
Committing soon.
Comment #20
aspilicious commentedNot rly the solution, "link to .." field was alrdy unchecked...
Comment #21
tim.plunketthttp://drupal.org/cvs?commit=497390
Link module is also broken in several ways, so the custom URL should live on as its own issue.
Comment #22
geerlingguy commentedSounds good.
Comment #23
tim.plunkettThis was broken if no Field API fields were added to the view, which is now possible with node->created etc.
Here's a fix, loading the entity if it's not present. Needs some code comments, but wanted to get this up here today.
Comment #24
tim.plunkettEven though this works, I might try to move some of that into fullcalendar_handler_field_date.inc instead...
Comment #25
aspilicious commentedWatch out for strict warnings, you can't do all that stuf into the reset.
You need to do:
I'm serious :) my browser is good at complaining.
But it actually works well now :)
Comment #26
tim.plunkettI took that directly from core!
modules/file/file.module, line 164,
$entity = reset(entity_load($entity_type, array($id)));What error does it give? How do I make sure I get strict errors?
Comment #27
aspilicious commentedUse latest version of php, the higher the version the stricter the errors ;).
Comment #28
tim.plunkettChanged it in the update function too.
Comment #29
aspilicious commentedRTBC as it is now :)... But maybe you're planning to move the code around.
Nice job :).
I would say it is time for making a default view, and giving the people another alpha.
Comment #30
aspilicious commentedThis is committed if I can trust the logs...
Marking this fixed.
Comment #31
tim.plunkettYup, forgot to do my normal "paste the commit message and mark as fixed" routine.
http://drupal.org/cvs?commit=499022