Latest Drupal related questions

Score: 0
amuli avatar
No more access to user login
jp flag

The URL mysite.com/user/login redirects to home page, so that I've lost access to administration.

I tried mysite.com/?q=user/login. Sadly, same redirection. :-(

Has anyone encountered this probleme or any idea ? Thanks :-)

Score: 0
NataN avatar
Right way to print logged in user custom fields
in flag

What is the right way to get the field value for the account used from the currently logged-in user and print it in a template file, for example a block or a page template file?

I was trying to use the following code, but it doesn't work.

use Drupal\Core\Entity\EntityTypeManager;
use Drupal\user\Entity\User;

$user_id = \Drupal::currentUser()->id();
$user_entity = \Drupal::entityTypeManager()->get ...
Score: 0
store user entered mail id to separate table
de flag

Have a requirement to develop drupal 9 custom module to get the mail id from the user registration form and store it separate table. I tried the hook_user_presave function to get the mail id but was not able to get it. Hereby sharing the code

function save_mail_user_presave(UserInterface $user)
 {

     try{
                $conn = Database::getConnection();
                $fields["mail"] = $user- ...
Score: 0
How can I alter the login form in the login block but not in the login page?
tr flag

How should I use hook_form_alter() to modify the user login block but not the user login form page? Everything I've tried either modifies both entities or doesn't work, not even using the following hooks.

function mymodule_form_user_login_block_form_alter(&$form, &$form_state, $form_id) {
  // …
}
function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_log ...
Score: 1
thunderblaster avatar
Installing to a MySQL database that requires SSL
sy flag

I am attempting to install Drupal 9 to a fresh host using an AWS MySQL RDS instance for a database. The database is configured to require SSL. When attempting to install via the web GUI, I receive PDOException: SQLSTATE[HY000] [3159] Connections using insecure transport are prohibited while --require_secure_transport=ON, which indicates that Drupal is attempting to connect without using SSL and that ...

Score: 0
Eric Waters avatar
How to create single view of webform submissions from multiple webforms
vg flag

I need to merge the submission data of fields from multiple webforms into a single view. For example, 3 webforms each with fields name, date, topic. I want a single view to pull submission data from all 3 forms and display these 3 fields sorted by submission date. Is this possible?

When creating this type of view using nodes, I can render the Title field from multiple content types in a single vi ...

Score: 0
thiokol avatar
How can i programmatically get the value of a views exposed filter after the user submits the form?
cn flag

I've searched and cant find an answer to this specific question.

If I have a view and an exposed filter for that view in a block, when the user clicks submit on the exposed filter form, how can I get the values of the exposed filters in order to use the value elsewhere for a different purpose? For example saving the value of one of the exposed filters into private temp store for use later.

What hook ...

Score: 1
Baud avatar
Unwanted fields added to translation
sa flag

I have a node with only 2 fields to translate (regular fields, not paragraph fields).

When I create a translation job (with tmgmt), I got those 2 fields (nice) and 2 others coming from a non translatable paragraph field.

I have followed all the rules for translating paragraphs (in this case, not translating)

$node->my_paragraph_field is not set as translatable

my_paragraph_field support only one ...

Score: 1
Dorian Winterfeld avatar
How can I delete bogus links under /admin/structure?
ae flag

I am running Drupal 9.3.4. I see four bogus links under /admin/structure. See the screen shot below. These were paths used by the Context module that were deleted. They are no longer listed under /admin/structure/context, but now they show up under /admin/structure. I assume that these are orphaned records in the database. Does anyone know where they would live in the database and how I can delete th ...

Score: 0
simp you avatar
Multiple gets in a module rest resource
ph flag

I have this module named elv_products. This module contains an rest resource with the uri_paths:

 *   uri_paths = {
 *     "canonical" = "/api/products",
 *   }

For example when i make a get request it looks like:

.../api/products?house_type=apartment&property_surface=84

the get returns all products where the house_type === 'apartment' and property_surface === '84'. But i also need a get to get  ...

Score: 1
simp you avatar
Get value from list_string instead of key
ph flag

I have this field created through baseFieldDefinition

$fields['type'] = BaseFieldDefinition::create('list_string')
        ->setRevisionable(TRUE)
        ->setLabel(t('Type'))
        ->setRequired(TRUE)
        ->setSettings([
            'allowed_values' => [
                'house'    => 'House',
                'business' => 'Company',
            ],
        ])
        -&g ...
Score: 0
rukya avatar
Can I use theme hook to display some extra fields in block?
id flag

Let's say I have 'opigno_documents_last_group_block' hook:

<!-- THEME DEBUG --> 
<!-- THEME HOOK: 'opigno_documents_last_group_block' -->
<!-- BEGIN OUTPUT from 'modules/contrib/opigno_learning_path/templates/opigno-documents-latest-group-block.html.twig' -->
<div class="content-box">
...

How can I enter it to pass some more variables to template?

I tried:

THEME_NAME_opigno_d ...
Score: 1
How to place facet blocks
ve flag

I got Search API and Facets configured, built a View Source, and connected the Facet to that source. Now I'm stuck with how to present that widget!

With D7 Facets, it configured Blocks that I could place. That isn't the case with D9. Anyone have a helpful hint?

Score: 0
Lambic avatar
Get count of referenced paragraph entities matching criteria
ph flag

I'm trying to get a view of nodes that have an entity reference to a paragraph. The paragraph entity contains a status field. I want the view to show a count of paragraphs that have a status of "done".

I can get a count of all the referenced paragraphs easily enough, but I can't constraint it to paragraphs of a certain status. Is there any way to do this in views?

Edit: Here's what I have so far:

Score: 0
Document File Field Ajax Error
bd flag

I am having trouble with file uploads for anonymous users. I get a non-descript ajax error. It works fine when signed in as an admin user. Any ideas on how to troubleshoot the problem? I've made dozens of sites the same way and never encountered this before.

Score: 0
How do I update existing paragraphs?
vn flag

I'm writing migrations to import source data as paragraphs.

This is the main migration (which is working).

id: resource_chapter_section_text
label: Import content from the resource.body column in the source database as chapter_section_text paragraphs.
migration_group: redacted_web
source:
  plugin: resource_chapter_section_text
  key: migrate_web
process:
  # a real value will be placed here by the res ...

The Stunning Power of Questions

Much of an executive’s workday is spent asking others for information—requesting status updates from a team leader, for example, or questioning a counterpart in a tense negotiation. Yet unlike professionals such as litigators, journalists, and doctors, who are taught how to ask questions as an essential part of their training, few executives think of questioning as a skill that can be honed—or consider how their own answers to questions could make conversations more productive.

That’s a missed opportunity. Questioning is a uniquely powerful tool for unlocking value in organizations: It spurs learning and the exchange of ideas, it fuels innovation and performance improvement, it builds rapport and trust among team members. And it can mitigate business risk by uncovering unforeseen pitfalls and hazards.

For some people, questioning comes easily. Their natural inquisitiveness, emotional intelligence, and ability to read people put the ideal question on the tip of their tongue. But most of us don’t ask enough questions, nor do we pose our inquiries in an optimal way.

The good news is that by asking questions, we naturally improve our emotional intelligence, which in turn makes us better questioners—a virtuous cycle. In this article, we draw on insights from behavioral science research to explore how the way we frame questions and choose to answer our counterparts can influence the outcome of conversations. We offer guidance for choosing the best type, tone, sequence, and framing of questions and for deciding what and how much information to share to reap the most benefit from our interactions, not just for ourselves but for our organizations.