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

THIS FORUM IS NOT FOR "What module..." or module support questions-- it's for module development and code related questions.

The module development and code questions forum is intended to aid those who are developing modules or writing code for Drupal.

Please note that this forum is also not intended for "Is there a module that does..." or "I need help with module x..." questions. It's also not a place to ask developers to write your code for you. Please respect this.

Please do not post general discussions intended to target module developers. If the question you have isn't specifically related to writing a drupal module, please post it in a more appropriate forum.

  • If you you have drupal installed already and are seeking a module that does a specific task, have a question about a specific module and what it does or if it will fit your use case, please place your questions in the Post installation forum.
  • If you have a problem or question about a specific module, you should create an issue in the module's issue queue (after checking for an existing issue first).
  • If you don't have drupal installed yet, please place your questions in the Before you start forum.

Finding entity and field property values when creating entity in code

I have code which creates an artice from JSON.

$article = $node_storage->create([
      'type' => 'article',
      'title' => $json['title'],
	  'field_int100' => $json['int100'],
	  'field_text100' => $json['text100'],
      'body' => $json['body'],
    ]);
    $article->save();

By default, the text format is Plain Text. Modifying the code which specifies the value of the body field will import the text with HTML formatting.

Module array output which fails validation when loaded into new variable

multiple

I am trying to understand the code for a contributed module.  A controller query generates the following print_r output from a loadMultiple statement on the query output.

Syncing Commerce product data via webhooks — architecture feedback?

I needed to sync Commerce product data to an external service and tried the API client approach first — query Drupal's entity system from outside. It broke between stores because every store has different field configurations, entity references, and content types. An API client that works for one store fails on the next.

PHPUnit testing within multisite setups, its posible?

I have a problem:

I want to run PHP unit tests that run on all Multisite sites. But when I run the tests on site “B,” everything uses the default site (“A”) as the database.

Does anyone have an example of how to configure this? Or is it not possible?

PHPUnit in Drupal Multisite loading 'default' instead of specific site directory. Its posible?

Hey everyone, I'm running into a frustrating issue with a Drupal Multisite setup and could use some help.

I'm on a Linux server running Drupal 10.6.2 and Drush 12.5.3.0. My working directory is /var/www/uat.

In the multisite I have /var/www/uat/web/sites/myWebsiteBBB AND /var/www/uat/web/sites/default

Here is my /var/www/uat/phpunit.myWebsiteBBB.xml:

Pages

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