If {junk_node} table doesn't contain the nid of some node, in a view with Junk fields (Move to junk link, Restore link or Delete link) for this node I get the following URLs:

http://example.com/junk/%252Fdelete
http://example.com/junk/%252Frestore
http://example.com/node/%252Fjunk

which means that $nid variable in junk_views_handler_(delete|junk|restore)_link.inc is equal to NULL, and as result we get an extra slash which is being replaced to %252F

I get the correct URL only for nodes which have been moved to junk (so {junk_node} contains the nids of these nodes).

Any idea how to fix this?

Comments

quotesbro’s picture

I figured out that this problem can be solved by changing
$this->additional_fields['nid'] = array('table' => 'junk_node', 'field' => 'nid');
to
$this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
in Views handlers files.

I'm attaching 2 patches for junk_views_handler_junk_link.inc: against original .inc file from version 6.x-1.2 and another one, that should be used after patch from #1014264: junk_views_handler_delete_link is used instead of junk_views_handler_junk_link.

AliraSirin’s picture

Status: Needs review » Fixed

Now fixed in 1.3 release. Thanks for the patches!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.