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.
I'm having the same bug as described here http://drupal.org/node/413678.
With the PHP stated below, the title (both when previewed and saved) only returns "ant". Here's my php code:
<?php
if (empty($node->nid)) {
// When the profile gets first created,
// use the username of the currently logged-in user
global $user;
return $user->name;
} else {
// When the profile gets edited,
// either by the user itself or
// an admin, use the existing title.
return $node->title;
}
?>
Doing a clean uninstall of version 1.2 and installing 1.0 fixes the problem.
Comments
Comment #1
fagoDue to the way ant works, it sets "ant" as title before it autogenerates it later on. Thus it your snippet will read out "ant". What you want is to allow reading the old title value. Perhaps this would help you?
Please report whether it worked.
Comment #2
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs for DrupalFit commented