I'm trying to make views_megarow work with a url parameter, but I cannot get it to work because the ? and = characters are url-encoded, and apparently Drupal does not accept these.

I add a megarow like Create item|node/add/article?field_myfield=[field_myfield]. This outputs a link like display_megarow/3/node/add/article%3Ffield_myfield%3D9, which is displayed as the Megarow content "You have not created any content types yet. Go to the content type creation page to add a new content type".

This must be because node/add/article%3Ffield_myfield%3D9 is not found and goes to the node/add overview, while node/add/article?field_myfield=9 does work, and correctly prepopulates the field using entityreference_prepopulate.

I wonder why the slashes in node/add/article are not replaced with their hexadecimal variant %2F, but ? and = become %3F and %3D.

Can views_megarow support non-url-encoded characters in order to make url parameters work?

Comments

ar-jan’s picture

Issue summary: View changes
Artusamak’s picture

Category: Bug report » Support request
Status: Active » Closed (won't fix)

This is related to the fact that we are passing the url in the filter_xss() function to prevent security issues so we can't do much to prevent this.

I recommend that you use a custom menu entry instead calling your own form around the node form which will be in charge of sending the extra information.

gardy’s picture

I had the same issue.

I thinks this is not based on filter_xss().

The module generated links like this: /display_megarow/10164/node/10%2c164
Every link had the an extra comma (%2c) in it.
I can't find out why is it working like this, so I made a workaround for it:

In includes/views/plugins/views_plugin_style_table_megarows.inc after line 105 I just strip out the extra char.

$url = str_replace( ',','', $url );

I'm not sure it this works in every situation.