I want to place a flag link on a page, as suggested on that page: https://www.drupal.org/node/295383
The flag will subscribe the user to the most recent content page, which is done in Views.
I have the Flags: subscribe (by current user) Relationship.
I have installed Views PHP and I want to add to the header of the view a Global:PHP with the code <?php print flag_create_link('subscribe', $node->nid); ?>
Unfortunately I receive an error:
Notice: Undefined variable: node in __lambda_func() (line 1 of .../sites/all/modules/views_php/plugins/views/views_php_handler_area.inc(39) : runtime-created function). Notice: Trying to get property of non-object in __lambda_func() (line 1 of .../sites/all/modules/views_php/plugins/views/views_php_handler_area.inc(39) : runtime-created function).
What could be the reason for that?
Any help appreciated.