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:

  1. Edit the view node_admin_content at admin/structure/views/view/node_admin_content
  2. Add a contextual filter for nid
  3. Select "Provide default value"
  4. Enter this (obviously just for this test, it will never work in a different context)
debug($_GET['title']);
return 1;

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 use debug() to output this value!

6. Visit admin/content/node?title=first&type=All&status=All in a clean install of BAckdrop

You 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.