$data array not available

Created on 5 April 2013, about 12 years ago
Updated 3 February 2025, 3 months ago

I defined the following custom token:

Type: custom
Content (PHP filter):

   $lr_node = menu_get_object( );//$data['node'];
   return substr( $lr_node->field_from_to['und'][0]['value'],0,10 );

The "field_from_to" is a date field that I defined for my event nodes.

When I create a new event node, the $data array is not available for pathauto (7.x-1.2). I also cannot get it by using menu_get_object( ) instead of directly accessing $data.

When I edit and save the same node, the path is generated properly - $data seems to exist here.

I also tried to set the type of the custom token to Node, but this also didn't work.

🐛 Bug report
Status

Closed: outdated

Component

Code

Created by

🇩🇪Germany redhawk07

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024