Add panels/ctools visibility control based on user relationships
rfay - July 2, 2009 - 18:40
| Project: | User Relationships |
| Version: | 6.x-1.0-beta10 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
The attached patch is a ctools/panels plugin (wirapped in a small module) which allows visibility of a profile panel or pane to be determined based on the viewing user's relationship to the profile owner.
| Attachment | Size |
|---|---|
| user_relationships_panels_visibility_01.patch | 5.62 KB |

#1
Here is another run at this patch/module based on feedback from merlinofchaos. This one allows you to select two users and the relationship between them
#2
On my site, the patch can not work, there has been the following error:Fatal error: “Cannot redeclare user_relationships_panels_visibility_ctools_access_settings() (previously declared in :”
I would like to have a solution, thank you
#3
@fafeng: Thanks for trying the patch. Please give the entire error message and maybe we'll know where it's been double-declared.
It sounds like perhaps the patch has been applied twice, or user_relationships is there twice?
Please grab a clean download of 6.x-1.0-beta10 and apply the patch to it. Then report back what the full error message is, and what you did to encounter it.
Thanks,
-Randy
#4
Another round of the patch. I found that the #default_value was not being handled correctly.
#5
I don't have the cycles to get involved in testing this, unfortunately, but I wanted to say thanks for doing this. This will go well with APK.
Michelle
#6
Could you provide a shot description or screenshot how this patch works? I would give it a try but I don't understand the matter of the patch.
#7
Instructions on how to use the feature provided by the patch:
You can also use the same technique to create a selection rule for the task handler.
This only works with Panels 3. (It's actually a ctools plugin; it may work with other things like views from merlinofchaos).
Although it might work other places, it's aimed at the user profile page.
Two screenshots attached show the creation and configuration of a new visibility rule.
#8
Hi there!
Thanks four your detailed instructions. I applied the patch and activeted the new module.
If I try to add a rule (before any rule exists) I get this error on the Rule Creation Window:
warning: Invalid argument supplied for foreach() in /var/www/***/includes/form.inc on line 1200.
But I can add a rule and it is working well.
This module was exactly what I was looking for and should be immediatly added to the user_relationship module set.
Thanks a lot!
#9
@ayalon: Please confirm that you applied the patch in #4, as I remember that this was a problem before that.
#10
I found that when two patch after patch at the same time, there I am talking about the problem, then I can only patch the first.
#11
@fafeng: You must start over with each patch, as the patch is intended to be applied to the *original* files (6.x-1.0-beta10, but should work with any other as well). You can't patch it and then patch it again.
#12
thx,:P
I found the latest version has solved these problems?
#13
Which files are we supposed to patch?
#14
Like all contrib patches, this one is intended to be executed from the module's directory. http://drupal.org/patch
#15
hi guys,
thanks for the great work. It works fine for me, only when I set the options in panels (panels 3 btw) I get following error:
"warning: Invalid argument supplied for foreach() in C:\htdocs\site\includes\form.inc on line 1200."
I just ignore the error and it works but would be good to have it disappear. ;)
#16
I will be pleased to take a look at this, but you'll have to do some things for me to sort it out. You'll have to give a much more detailed explanation.
1. What path are you on when you have the problem?
2. What do you do (EXACTLY) that causes the problem?
3. Is it possible that other modules are involved?
Please export your panel and attach it if you'd like me to work on it.
Even better: Send me your database and the exact version of Drupal core that you're using. http://drupal.org/user/30906/contact
-Randy
#17
@mitkoru, #15, I took a look at your issue and was able to recreate it. It was (as you surmised) a trivial issue that did not affect functionality. However, it's fixed in this patch (attached).
Those of you who are using this: If it works for you, why don't you mark it "reviewed and tested by the community".
#18
I tested it and it works. It's on my live site..
#19
Forgive the n00b, question.... I took a look at http://drupal.org/patch/apply and the only thing that isn't clear to me between reading that and this, is where I should apply the patch? Do I put it in the user_relationships/ module directory or the panels directory or some subdirectory of one of them so that I can actually run the patch < file.patch command, or does that even matter?
#20
nevermind! I ran it from the user_relationships module dir and worked fine...
#21
Oooh... I'd forgotten this issue existed. I was planning on writing this in the next month or so. Thanks for keeping me from re-inventing the wheel. LOL
Michelle
#22
Committed in http://drupal.org/cvs?commit=279844. Thanks a ton to @rfay and testers!
#23
Automatically closed -- issue fixed for 2 weeks with no activity.