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

Change hook_schema to another database connectiom

Hi have two databases and i cant use the second one when i use hook_schema in my install file:

Custom fields on admin product page - Drupal 7

I'm new on Drupal.

I have successfully added several fields to the product page in the admin panel, but I cannot save the values ​​to use them in the future. What do I need to do?

$form_state->getFormObject()->getEntity() does not work in Drupal 7, similarly to $form_state->setValue() and $form_state->getValue().

What should I add to the code for this to work? How i can save values from this select fields?

Drupal Cache Issue

I want to get the cache object  but i am getting below error. Any help would be appreciated. I have this code in the core\lib\Drupal\Core\Database\Database.php

Code:

\Drupal::cache() ;

Error:

Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer()  

Inject CacheBackendInterface interface in a class to make use of cache

Below is my class and i am trying to inject CacheBackendInterface interface in my class but it is not working. any help please?

<?php

namespace Drupal\Core\Database;

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Aws\SecretsManager\SecretsManagerClient;
use Drupal\Core\Cache\BackendChain;
use Drupal\Core\Cache\MemoryBackend;

Modal dialog: (adding extra button to close)

I have created a page and added views block and listing articles from a specific content type. I added a global: Custom text field and added a link that successfully opens a modal_dialog window with the code below.

<a class="use-ajax button" data-dialog-type="modal" href="node/{{ nid }}">open modal</a>

How to set autofill or how to set it? in Drupal webform version 8

Form 1 has three elements:

Webform name: FormLogAC

1. AC Log Number (ac_log_number_mas2) - Text field

2. Building Name (building_name_mas2) - Entity select

3. Room Name (room_name_mas2) - Text field

Form 2 has four elements:

Webform name: activityform

1. AC Log Number (ac_log_number_keg) - Entity select

2. Building Name (building_name_keg) - Text field

3. Room Name (room_name_keg) - Text field

4. Officer Name (officer_name_keg) - Text field

Pages

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