Closed (fixed)
Project:
Profile 2
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2011 at 11:13 UTC
Updated:
23 Aug 2023 at 21:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bambilicious commentedSubscribing.
Comment #2
mh86 commentedThe problem comes from the reverse relations in entity_from_schema contexts. It takes the UID from the user object and loads the profile2 with entity_load('profile2', array($uid)), which can't work, as the profile ID is needed instead. Of course the other way round - using the UID from the profile entity to load the user - works.
Comment #3
bambilicious commentedHave you come up with any possible way to attack this problem?
Comment #4
mh86 commentedI'm using #1301080: Generic entity from view relationship handler in the meanwhile, but I think it's rather a workaround for such a simple use case.
Comment #5
bambilicious commentedThanks, I'll have a look.
Comment #6
scottsawyerHas anyone tested the patch?
I have 2 Profile2 types "Main", "company". I would like to have a context for each and selection rule based on they profile type. However, I can only seem to get the Main profile type to respond to my Panel.
Thoughts?
Comment #7
nagiek commentedCan't we just write our own plugin? profile2_from_user? We'd have to adjust the form to specify the profile2 type you want loaded, and boom!
Comment #8
nagiek commented.
Comment #9
nagiek commentedHere's the patch and the file for the new relationship. Just rename the file to .inc and place it in the plugins/relationships folder.
Comment #10
nagiek commented.
Comment #11
nagiek commentedComment #12
merlinofchaos commentedProfile2 is a module, not core; as such, the policy of CTools is to require this kind of support to either be in the module or in a glue module maintained by others. I am unable to accept maintenance of code like this. It takes ages just to keep up with changes in core, I am simply incapable of keeping up with changes in other code.
There are rare circumstances that I'll support modules directly, typically when it's not possible to put the code anywhere else, but this isn't one of them since these plugins are very portable and can live anywhere.
I highly recommend you submit this to profile2 and/or make a module. If you do make it a module and need help getting through the review process to get approved git access, I can try to use a little of my community karma to speed things up.
Comment #13
wjaspers commentedMoving to correct queue.
Comment #14
pwaterz commentedThe patch above didn't add the ctool plugin hook. Here is an updated patch
Comment #15
andypost#14 is a part of #1011370-21: Ctools relationship from user
Suppose we need to mark this issue as duplicate
Comment #16
andypostComment #17
zmove commentedReopen because that's not the same issue. The profile2 module just need to have the relationship defined as the patch provide and this patch fix it.
Comment #18
fago#1834920: Create profile2 ctools relationship context from node
Comment #19
zmove commentedNot sure it's a duplicate. In that case it create the relationship from user (profile2_from_user.inc), in the linked issue it's from node (profile2_from_node.inc).
I reoped just to have confirmation it's a duplicate. If it's different issues, I can confirm that the patch in #14 works like a charm.
Comment #20
fagoTrue sry, still we have #1011370: Ctools relationship from user - let's track this over there.
Comment #21
andypost@zmove Relation to profile from node should be build with relation from user from node, so @fago is right - let's focus on #1011370: Ctools relationship from user
Comment #22
zmove commented@fago @andypost Thank you for answers, I will follow that.
Comment #23
operations commentedPatch #14 works and solved my problem (profile2 fields not working well with panels).
Comment #24
Achille commentedSo, at this time, there is NO solution to this problem, correct?
Thanks
Comment #25
operations commentedAs far as I think :)
Comment #26
druvision commented#14 works for us, so I am repackaging the fix in this post.
- The 1st file is a new file under ctools/plugins/relationships/profile2_from_user.inc which should be run from the ctools directory.
- The 2nd file is a patch to profile2.module.
Comment #27
druvision commentedThis is the 1st file from comment #26 (added ctools plugin), in a patch format
Comment #28
druvision commentedThis is the 2nd file from comment #26, in a patch format (function added to profile2.module)
Comment #29
ledom commentedReopen, duplicates not solved this issue.
I try dev version, which solved #1011370 but still need to add inc file from #14 to get profile2 fields showing into panel (if not, no context from profile2)
After each upgrade, I lose this file...
Comment #30
kenorb commentedComment #31
kenorb commentedComment #32
MorinLuc0 commentedBeen reviewed and from what I can see it has been applied already to the dev branch, Just waiting on a new release once 2227945 has been fixed it can be marked as closed.
Comment #37
mlncn commentedAs noted by MorinLuc0 this was applied to the dev branch and that is why the patch started failing. This is fixed.