Posted by tobiberlin on November 2, 2009 at 8:40am
Jump to:
| Project: | Flag |
| Version: | 6.x-1.1 |
| Component: | Flag core |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi,
I wanted to create a link to flag a user. The link should have been shown in a panel used to view user-profiles. I added a content pane using the function
<?php print flag_create_link('fools', $account->uid); ?>Everything works fine so far but when I click on the link and the page is refreshed the message appears:
warning: Missing argument 3 for flag_page() in /srv/www/vhosts/mysite/httpdocs/sites/all/modules/flag/flag.module on line 837.I had a look on the generated link and for me it looks as if it is not generated well (tutor is the name of the flag):
http://MYSITE/flag/flag/tutor/?destination=user%2F34&token=54bbc4864e5d9af05f4874c93a51885dThe same issue appears when I use a block including this function. Any ideas?
Greez,
Tobias
Comments
#1
I have to add that it seems that a user clicking on this link flags himself - and not the user shown on the page! After flagging the unflag-link appears with every user profile the current user visits.
And the function above is not right - I changed the flag "fools" to "tutor". Sorry for this mistake.
#2
It sounds like you're probably passing an invalid value to flag_create_link(). Are you sure that $account->uid has a value? The ID of the account to flag is missing from the URL, which is causing those errors.
#3
Thank you for this tipp - that helped me. I used a function to get the argument from a view so this was not the right function to get the argument from panels. So this was my sollution: http://drupal.org/node/292734
I changed
<?php
global $base_url;
$uid = arg(1);
print '<a href="' . $base_url . '/detailed_bio/' . arg(1) . '">More</a>';
?>
to
<?php
print flag_create_link('tutor', arg(1));
?>
This works fine for me
#4
Automatically closed -- issue fixed for 2 weeks with no activity.