Implementing hook_entity_presave

Hi,

I want to set a field value in a content type using hook_entity_presave. Please let me know how can I set the field value.

Currently I am using $entity->set("field_myfield","some value") , but it wont work.

Can a user with translation permissions translate other people's content?

I can't set my roles and permissions as expected.

Can users with a role with translation permission translate content posted by others?
Can't translate content posted by others, what is the setting to translate only my content?

Settings to translate only your own content and settings to translate other people's content.
What is the difference between these settings?

Thank you.

Samworth Brothers - Rapid launch of new food retail brand 'Fresh Food for Now'

Fresh Food for Now is a revamped business proposition from UK food manufacturing company, Samworth Brothers. The company's aim is to corner the growing UK food-to-go market by rebranding its food delivery service from its previous incarnation as Ginsters.

Sectors: 
Retail and Distribution

Implementing hook_entity_update

I am trying to update a content type source_node using hook_entity_update as follows: I am getting an error for using $entity->getType() == 'source_node'

I have tried using $entity->getEntityType() == 'source_node' but it is not updating correctly.

function heritage_schema_entity_update(Drupal\Core\Entity\EntityInterface $entity) {

Views AND/OR logic not working

I have logic on my filter criteria that goes like this.

(A | B) 

&

(C & D & E)

But when I look at the SQL output it says

(A & B)

&

(C & D & E)

This means that my view wont display the content correctly. Is this a bug with views or have i set it up wrong?

How to update multiple entities at once

Hi,

Let's say I create a field X for a taxonomy term , I want to update multiple terms's field X at once,  Is it possible? 

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x