Latest Drupal related questions

Score: -2
Brian avatar
error The website encountered an unexpected error. Please try again later
np flag

The website encountered an unexpected error. Please try again later. My drupal version is 9.2.5. How to open dev mode

Score: 0
Render custom field from user registration form
zm flag

I'm trying to render a custom field that shows up on the user registration form on a separate new form that creates users of a particular role with specific permissions.

I have everything working except being able to render this custom field.

When I view the field under the user registration form settings page, it says it's an entity reference field. When it renders it has 4 check boxes.

I've figured o ...

Score: 0
hotwebmatter avatar
Display machine name in entity_form_display_edit_form
nr flag

The Entity Form Display edit form has a hidden field:

      'hidden_name' => [
        '#type' => 'hidden',
        '#default_value' => $field_name,
        '#attributes' => [
          'class' => [
            'field-name',
          ],
        ],
      ],

Can I make this field visible with a hook_form_alter() implementation?

Here's what I have so far:

/**
 * Implements hook_form_a ...
Score: 2
Ex0r avatar
Trouble with the upgrade of core 8.9 to 9.2
cn flag

We are in the process of migrating to Drupal 9, and I am having nothing but problems with composer and trying to get Drupal core updated.

I have provided my composer.json file, and a HUGE list of errors it's spitting out at me, and I have absolutely no idea how to fix it.

The command I have been running is composer update


Gathering patches for root package.
No patches supplied.
Loading composer repos ...
Score: -4
Shyam Jha avatar
The website encountered an unexpected error. Please try again later. as shown in body
uz flag

I tried to set up my drupal 8 full project on localhost but after set up when I run project getting error as shown below:-

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "node" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of core\lib\Drupal\Core\Entity\EntityTypeM ...

Score: -1
HasseWilson avatar
Views showing quizzes and content sharing taxonomy term
pf flag

I have a Drupal 9 site, with a lot of quizzes and content pages. Both have the same vocabulary attached (Category), and want to create a view showing all quizzes and nodes sharing same category.

Is that possible, or is it better to create a custom page and do the magic my self ?

Score: 0
Can't get field storage definition in custom entity
ni flag

I have a custom entity 'myentity' with some fields, and one of them is a taxonomy field with the next definition:

 $fields['colors'] = BaseFieldDefinition::create('entity_reference')
                ->setLabel(t('Colors'))
                ->setDescription(t(''))
                ->setRequired(FALSE)
                ->setSetting('target_type', 'taxonomy_term')
                ->setSett ...
Score: 0
big_smile avatar
How do I print the display name?
us flag

I have a view with multiple pages. In the Views interface, I can set a display name for each display.

screenshot

Is there anyway I can print this name in the view itself, for example adding a Global Text field to the views header?

Score: -3
Lenon Tolfo avatar
can I set multiple JavaScript files on a custom module library?
co flag

I created a new module and I need to add multiple JavaScript files to my pageI.

Should I create a new library for each file, or is it possible to add multiple JavaScript files on the same library as in the following library definition?

organigram_admin_library:
  version: 1.0
  js:
    js/admin/jquery-1.10.2.min.js: {}
    js/admin/admin.js: {}
Score: 3
Details wanted for "Mismatched entity and/or field definitions" message on custom field
in flag

I have developed a custom Drupal field.

All works fine. We are already using the field in production for a year. But the status report for exactly this field says:

Mismatched entity and/or field definitions

I would like to get rid of that message. It gives me a bad feeling about the reliability of my Drupal installation.

I could write an update hook if I knew in detail what is wrong.

How can I find ou ...

Score: 0
Javier Rey avatar
Custom entity with dynamic paths
eg flag

I am creating a new entity and would like it to be in the users profile.

The path should be "/user/{user-id}/documents/X":

/*
 *   links = {
 *     "canonical" = "/user/{user}/documents/{document}",
 *     "add-form" = "/user/{user}/documents/add",
 *     "edit-form" = "/user/{user}/documents/{document}/edit",
 *     "delete-form" = "/user/{user}/documents/{document}/delete",
 *     "collection" = "/use ...
Score: 0
Naser Nikzad avatar
Is there any way to revert the changes done by "drush cim"?
us flag

I usually take backup of the entire database before importing new configurations, but this time I didn't and now I need to double check something with old version of database. Is it possible to just revert the changes done by drush cim?

I am using Drupal 8.

Googling for this specific situation didn't give me any solution.

Score: 0
Michael Chaplin avatar
How to set the appropriate bundle for a paragraph on migration?
us flag

I'm trying to migrate some paragraphs from D7 to D9.

The bundle type is always set by the default_bundle setting for the destination migration eg:

destination:
 plugin: 'entity_reference_revisions:paragraph'
 default_bundle: text

Can anyone sign post me to a good example of a yml file that sets this for paragraphs with more than one field?

Here is the whole yml file:

langcode: en
status: true
dependenc ...
Score: 0
With Rules, how do I use variables with Calculate and Set a value actions?
us flag

Let's say I have an Entity with a custom integer field added. Let's call the field Global Total (field_global_total)

On some event, I want to

  • get the existing value of that field and store it in a variable

  • get the value of another integer field (from another entity) and store that in a variable

  • add the two variables together

  • save that sum as the new value of "Global Total"

Ultimately I want ...

Score: 0
Add access to a single node programatically via ACL module
ng flag

I spent a day trying to figure out why my code doesn't work. I'm trying to add access to a user on a single node programmatically. It saves record in DB and when I visit Access control page for a given node, user is listed under USER ACCESS CONTROL LISTS. However, when I visit the node as that user, I get access denied. I tried all sorts of combinations but my current code is something like this:

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.