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.
Setup a field group with First Name | Last Name | Email
create 4 items so you have
FIRST NAME LAST NAME EMAIL
first1 last1 email 1
first2 last2 email 2
first3 last3 email 3
first4 last4 email 4
Edit the fields through the admin interface to remove the third last name and save. You will expectedly end up with:
FIRST NAME LAST NAME EMAIL
first1 last1 email 1
first2 last2 email 2
first3 email 3
first4 last4 email 4
Now edit this same node programmatically, just a simple title change will suffice:
$testnode = node_load(2802);
$testnode->title = 'my new title';
node_submit($testnode);
node_save($testnode);
Now view the node in the admin edit screen and notice that the last names have shifted like so:
FIRST NAME LAST NAME EMAIL
first1 last1 email 1
first2 last2 email 2
first3 last4 email 3
first4 email 4
I have attached a png that illustrates this effect as well.
Comment | File | Size | Author |
---|---|---|---|
field-group-bug.png | 71.54 KB | smoothoperatah |
Comments
Comment #1
swentel CreditAttribution: swentel commentedYou need to be carefull with partial updates, make sure you have fully loaded object before submitting and saving again.