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

Accessing additional external database

I have some functionality that relies on me connecting to an external db (read only), and I have configured it in my settings.php as such;

$databases['atavism']['default'] = array (
'database' => 'world',
'username' => 'redacted',
'password' => 'redacted',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);

I then have this in my controller:

Add facabook-domain-verification metatag in home page

How do I add the below metatag to the <head> section in the html of the domain page/home page of the website.

<meta name="facebook-domain-verification" content="xyz" />

Urgent help required

Drupal merge query failed to get the entity id

I am trying to merge some of the node detail to custom table because of project requirement. Whatever I try, the below code is unable to fetch the entity-id();  and entity field value. 

Please rectify where I am doing mistake. 

//filename stackrecom09.module

<?php

use Drupal\Core\Entity;

/**
* Implements hook_node_update().
*/

Help debugging: TypeError: Argument 1 passed to Drupal\Core\Render\Element::children() must be of the type array, null given

When I enabling the module Subscribe mailchimp (part of this theme hosted on GitHub) I get a WSOD and this error message when visiting the site's front page:

Altering entity bundle add form with custom form mode programatically Drupal 8

I have created a custom entity type called custom_enitity and new bundle scores. Also got custom form mode called score to add scores entity via custom route. I am trying to create a route with an entry parameter in it and alter few form fields based on the entry id . I keep getting the following error message. Am I doing something wrong/missing something in routing.yml file ?

Comment attachments unpublished by default

I have a content type that is linked to a comment type. The comment type has comment and attachment fields. Is there a way to set up the comments with attachments alone to be unpublished by default? For comments that has attachments, the admin will have to login and publish it manually. Only comments that has attachments should be set unpublished by default. Is there a way to achieve this?

Pages

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