This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Update a field of all node with get or entity Query

use Drupal\node\Entity\Node;
$node = Node::load($nid);
$node->setTitle('MY NEW TITLE'); // This is a special meta field
$node->set('FIELD_NAME', 'THIS IS DATA'); // This is a Field added in to the content type
$node->save();

This code allows you to update the item (s) of a content type.
I need to update a boolean field of all nodes of a content type.
Is it possible to do this with getQuery or entityQuery to make it faster?
Or if there is another sql command to be able to do it

Installed module is not recognized as a service

I am currently in the process of updating a pre-existing drupal site from 8 to 9. This is being done on my local first using XAMMP, later we will update on the server.

I have managed to update all the modules, and then finished by updating drupal core. Everything was going smoothly however once running the site and trying to open it, It says that "The website encountered an unexpected error. Please try again later."

The logs say.... The service "samlauth.saml" has a dependency on a non-existent service "externalauth.externalauth"

How can I update an entity with a .yml file?

I see that EntityDefinitionUpdateManager::applyUpdates() has been removed.

Every time I add a new field to a .yml file or I add a new node.type.yml to the configuration directory in a module I am developing, I reinstall the module to see newly added fields.

How to attach a library to a multiple value field ?

Context:
I am building a "field formatter" custom module.
The field has multiple values. These values  are hidden in the node.
They appear in an animated overlay table when you click on a link "show the values" (a JS script is attached to the field)
It works.
But I have a question.

What is the proper way for attaching a library to a field ?

I did it this way in the formatter class:

Does Commerce have Strong Customer Authentication

Do anyone have a Commerce installation that is Strong Customer Authentication compliant. 

Is there any step by step documentation available that instructs on how to implement this protocol on a Drupal 9 site.

Really struggling to figure this one out

Any help would be fantastic.

Thanks

N

Can you change an event from one group to another?

I am exploring the Groups module - https://www.drupal.org/project/group

Is it possible to change which group an event (or article) belongs to?

Thanks

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions