Active
Project:
Views PHP
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
23 Feb 2012 at 18:21 UTC
Updated:
5 Jul 2014 at 17:04 UTC
Jump to comment: Most recent
Comments
Comment #1
smouhaer commentedtry this method
$myflagl=flag_create_link('myflag', $row->nid);
print $myflag;
Comment #2
Grzegorz Zbiński commentedI know, why it wasn't rendered.
I've put:
into wrong place...
It should be in Output code (and I've put it in Value code, which was wrong). Now it is working fantastic!
I've checked dblog where goes things like those:
Notice: Undefined variable: flag in __lambda_func() (line 1 from .../sites/all/modules/views_php/plugins/views/views_php_handler_field.inc(131) : runtime-created function).and
Notice: Undefined property: stdClass::$views_php_15 in views_php_handler_field->render() (line 223 from .../sites/all/modules/views_php/plugins/views/views_php_handler_field.inc).Comment #4
fehin commentedHow do I print a flag link for users and use a user reference field instead.
I have tried different method. The last one I tried was
and
but it didn't work.
I got Notice: Undefined index: value in __lambda_func() and Notice: Undefined index: uid in __lambda_func()
Comment #5
fehin commentedMy solution:
Comment #6
bharata commentedI'm trying to follow in your footsteps Grzegorz, and would like to ask you two questions.
Am I correct that I must leave out the begining and ending PHP tags?
Also, does it make a differece if I use " or ' ? 'myflag' vs "myflag"?
Just wanting ot be sure I am doing it correctly. It's not working anyway but I could rule syntax out if I'm at least entering the code in correctly.
I am still seeing:
Notice: Undefined property: stdClass::$views_php_2 in views_php_handler_field->render() (line 223 from .../sites/all/modules/views_php/plugins/views/views_php_handler_field.inc).
Thanks!
Comment #7
bharata commentedOK. I solved my problem. Grzegorz bold faced the answer. Others on other threads have mentioned this as well. But regardless, I did not actually understand because at the top of the entry screen for the global PHP field it says,
I assumed that meant I was doing the right thing. Wrong! You must scroll down. There are TWO fields.
Enter your code into the SECOND one. And DO use PHP tags.
Comment #8
marcoka commenteddeleted my comment. wrong statement.