I've created View with two fields with following order:
Node: Nid (default options)
Node: Body (Link path: node/add/something/[nid])

When I'm testing my View, first field appearing as number (that's fine), but second field where is pattern, [nid] is empty.

Any help?

Comments

kenorb’s picture

I think the problem can be related to PHP4 compability.
The same database on my local host is working, and on the server doesn't (where is still PHP4).
I can't upgrade it.
Which function is responsible for returning those Replacement patterns?

dawehner’s picture

you have to search for

function render_altered and get_render_tokens in handlers/views_handler_field.inc

kenorb’s picture

Title: Replacement pattern [nid] doesn't work » Replacement pattern [nid] doesn't work on PHP4

$this->view->display_handler->get_handlers('field')
returns different values on PHP4 and PHP5

stevekerouac’s picture

I've just had the same problem here http://drupal.org/node/456240 and upgrading to PHP5 has cured it.

kenorb’s picture

Thanks for pointing that.

kenorb’s picture

I wondering which PHP report is related to this behaviour.

Possible related bugs:
http://bugs.php.net/bug.php?id=39614

Related PHP4 issues:
#313371: On PHP 4.x evaluation of content type is always FALSE

vitamink’s picture

After hours trying to work out why the replacement patterns don't work in the online version of my site I've finally tracked it down to this issue. As this is caused by a php4 bug is it likely that there will never be a fix or does anyone know of a possible work around that doesn't invovle upgrading PHP versions.

kenorb’s picture

If there is some difference between 4 and 5 behaviour (related bug) for specified code, this code can be re-written in other way.
It could be related to wrong reference assignment, some code can give you just value instead of reference.
But I'm not sure which line exactly is responsible for that.

kenorb’s picture

For those who have similar problem, but on PHP 5.x, there is very similar issue:
#382852: [Calendar Views] Replacement patterns don't work if referencing a field excluded from display
But in this case I'm definitely sure that's PHP4 issue, because it's working fine on PHP5.

v8powerage’s picture

I have PHP 5.2.0-8+etch15 and this doesn't works neither for me…

kenorb’s picture

For PHP 5.x probably it's something different.
#456240: 'Output this field as a link' ignoring replacement patterns

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new660 bytes

Ok, spent a few minutes finding this.

I'm pretty sure this will work without breaking anything, but am posting it for testing just to see.

merlinofchaos’s picture

Status: Needs review » Fixed

Looks like I committed this by accident. No one reported any problems!

Status: Fixed » Closed (fixed)

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