Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
What is the correct way to do this with rules?
<?php
$meters = '[node:field_track_distance]';
$seconds = '[node:field_track_time]';
$kmh = $meters / $seconds * 3.6;
print round($kmh, 2);
?>
If I just want to save a token value <?php print '[node:field_track_distance]'; ?>
it works fine but as soon as I try to do anything else with the tokens I just get 0 saved. I am doing this with "set a data value'.
Thanks.
Comments
Comment #0.0
hampshire CreditAttribution: hampshire commentedfixed code typo
Comment #1
TR CreditAttribution: TR commentedIf you continue to have a problem with this in the current version of Rules please open a new issue.