Closed (fixed)
Project:
Content Profile
Version:
6.x-1.x-dev
Component:
Panels integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2009 at 01:33 UTC
Updated:
19 Aug 2009 at 13:50 UTC
When you limit node types via access control in Panels, the CCK fields available becomes restricted to only relevant fields. When you add a content_profile relationship, only one node type is available. This patch adds restrictions so that irrelevant CCK fields will not appear in the add content dialog.
| Comment | File | Size | Author |
|---|---|---|---|
| panels-cck-fields-restrictions.patch | 1.92 KB | merlinofchaos |
Comments
Comment #1
markus_petrux commentedI think there's the same issue here with $context -vs- $new_context as in #523072: Have nodereference relationships limit CCK field availability as well.
Also, there's an
elseifmissing.I think the function could be fixed to look like this:
Comment #2
Daniel A. Beilinson commented@merlinofchaos, your patch brokes cck relationships.
Comment #3
fagooh nice, I'm not into panels (yet) - so which one is the correct patch? Please just set it RTBC once it's ready.
Comment #4
fagoComment #5
markus_petrux commentedI think the code I posted in #1 may work, but I haven't tried yet.
It is just that merlinofchaos posted this here and in the CCK issue queue, and I noticed it was buggy there because it was overriding the $context argument with the object created in this function. I fixed it in CCK, and I guess the same fix is valid here, more or less.
But, I haven't tested this, so better test first if the thing works ok. Try with the code in #1. ;-)
Comment #6
Daniel A. Beilinson commented@markus_petrux, your code with or without merlin's patch brokes cck integration. Can't see cck fields into user profile template content.
Comment #7
markus_petrux commentedWell, I have tested content profile with the function content_profile_node_from_user_ctools_context() as in the following snippet, and it worked for me.
@La_ntegral: I'm not sure what you mean. merlinofchaos' patch above has a bug, and the code I have posted here is just the whole code of the function that was patched, but with the bug fixed. And it worked here.
How to test:
1) Goto admin/build/pages/edit/user_view.
2) Create a variant and add a relationship with from "User being viewed" to "Profile Node".
3) Now you should be able to add CCK fields from your content profile to the user view panel.
FYI: merlinofchaos' patch tries to limit the number of CCK Fields available as panes to those that are related to the node type used for the content profile. And this worked like a charm here.
Comment #8
Daniel A. Beilinson commentedCool! It's work for me. Also marked #531092: cp context as fixed.
Problem was I tried to modify apk's user_view.
Comment #9
fagook, I've committed the function as given in #7. Thanks.