Hello,
I am currently updating a Drupal 7 site to Backdrop CMS.
In the Drupal 7 site, I retrieved URL parameters in several places using $_GET['parameter']
. For example, in blocks (PHP filter) or PHP code in Views → Contextual Filters (default value / validation criteria). This always worked without any issues.
In Backdrop CMS, with a manually installed PHP filter, I never get a value using $_GET.
For the URL .../test?title=testtitle, the following code:
<?php print_r($_GET['title']); ?>
only returns an empty output.
Does anyone have an idea what the issue could be?
Comments
Are you using the
<?php ?>
tag when you set up the contextual filter in Views → Contextual Filters (default value / validation criteria)?It should not be used, according to the directions there.
In my testing, this is working just fine. This is what I'm doing:
node_admin_content
atadmin/structure/views/view/node_admin_content
5. Save everything. PLEASE NOTICE:
print
doesn't seem to work in this context (the print output gets flushed out when building the output). So, you must usedebug()
to output this value!6. Visit
admin/content/node?title=first&type=All&status=All
in a clean install of BAckdropYou get this:
As for the PHP filter module - this may be a separate problem. PHP filter doesn't have a release in BAckdrop and will not have one, and the last merge was done 3 years ago. There are ways to avoid using PHP filter. If you post here about your intended use, someone may be able to help.