Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 6, Recipe 4 (Updating an entities field values), Bad code example. #14

Open
NathanHealea opened this issue May 17, 2024 · 0 comments

Comments

@NathanHealea
Copy link

Hi Author and fellow developers.

Working through Chapter 6, Recipe 4 (Updating an entities field values, pg144-145) there is a bad code example.

On Page 144, step 4, the example shows updating the field_body value using the code $node->set('field_body', $json['body']);

image

This will throw a Field field_body is unknown.

In following step, on page 145 step 5, the code example is changed with no context as to why or that the code needs to be changed.

image

By using $node->set('body', $json['body']); the code will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant