Answer the question
In order to leave comments, you need to log in
How to correctly set up contextual filters views in drupal?
There is a node with a field created using the user reference module . Those. when creating a node, I enter in the field the name of a user already registered in the system.
The user, when entering the site, on the main page, receives a list (block) that forms views. A list of those same nodes, with a field created using the user reference module.
The task is to display in this block only those nodes that belong to the user who views them.
Those. "Vasily Petrovich" enters the site, and there is a list for him on the main page. And for others, this list is invisible.
Thanks for the hints.
Answer the question
In order to leave comments, you need to log in
You need to use context filters. You press add, select the node field with a link to the user, in the "If the filter value is not in the URL" block, select "Pass the default value", in the "Logged in user ID" drop-down list (I don't know how in non-localized views, but I think figure it out). Should earn.
This is actually not an error, but a warning related to the fact that the $argv array is defined only when you run it from the command line, and you run the script through the Web server. Nevertheless, the code, in theory, fulfills normally.
To get rid of it, you need to add an additional check:
And I can’t help but notice: doing an include of a file whose name came from outside (from a GET request) without any checks is, in general, a very serious security hole.
$argv - Contains an array of all arguments passed to the script when run from the command line.
php.net/manual/en/reserved.variables.argv.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question