Latest Drupal related questions

Score: 0
user agent avatar
"composer install" works during upgrade but the autoload file is missing in the vendor directory
eg flag

I am upgrading a Drupal 8 site to Drupal 9. I removed the core, vendor, modules, and contrib directories; I ran composer install. All went well, but when I refreshed the page, I saw the following error.

Warning: require(/app/docroot/../vendor/autoload.php): failed to open stream: No such file or directory in /app/docroot/autoload.php on line 16 Fatal error: require(): Failed opening required '/app/docroo ...

Score: 1
Kevin avatar
Dynamic language links from menu?
in flag

I am trying to find a way to do the following:

  • Add languages to Drupal 9 menu items
  • Translate content/menu links
  • Provide (from the Main Navigation) a list of languages the current page is translated in

I was able to complete the first two, but I cannot see how to get a menu to list links that output the available language options for the current entity. I see that there is a Language Switcher block  ...

Score: 0
Mauricio avatar
How can I use the join handler plugin with groups and multiple conditions?
lb flag

I'm trying to build a custom view filter and in the query method I need to create this join.

LEFT JOIN node__field_list list ON node_field_data.nid = list.entity_id
AND list.deleted = 0
AND (list.langcode = node_field_data.langcode OR list.bundle IN ('option_1','option_2'))

Using the documentation for ViewsJoinHandler, I was able to create the join, but I couldn't recreate the conditionals in the "extra" ...

Score: 0
Lambic avatar
Page not found when viewing Group entities
ph flag

I'm using the Group module and I've defined an "Organization" group type.

When I create an entity of that type by going to /group/add and hit save, I get Page Not Found for the url /group/1.

If I go to the entity list view at /admin/group I see my group, and the title is linked to /group/1. Clicking on it gives me Page Not Found.

/group/1/edit works, as do other urls like group/1/delete, but group/1 404s ...

Score: 0
Vighnesh Sadagopal avatar
If i have to add a content in drupal through custom form which table in database should be used?
bd flag

I have created a custom Form through form api which only contains one form field of adding image to node and their will be a different form through which i am going to add body , title and tags in database . Now I am really confused that which table in database should i use to add the data so i can see the data in the content section on the user interface of the site( for admin ). I tried using some tab ...

Score: 0
"There have been more than 5 failed login attempts for this account. It is temporarily blocked." and the flood table is empty
cn flag

When I try to log in as an admin user, I am getting the following error:

There have been more than 5 failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.

This answer explains that this can usually be cleared up by truncating the flood table in the database.

However, when I checked my flood table in the database with PHPMyAdmin, it was empty.

Score: 0
Block doesn't show up in the entity reference UI
jp flag

I have an Entity Reference field, whose "type of item to reference" is block.

I have a View that creates a block called staff list but when I edit content that uses that field, I can't get it to present staff list as an option?

Why is this block not selectable? Surely all 'blocks' should be reference-able this way?

Screenshot

Score: 0
Bass-Ninja avatar
Submission query alter by entity ID
ru flag

I have a webform called Event Registration which has 3 fields: name, email and event(entity reference). I created a block view and I want to display the number of users registered to a certain event. I wanted to add contextual filters to the view but for some reason my custom fields are not displaying in the block, only global. I then attempted to alter the query but I have been unsuccessful in adding t ...

Score: 0
Can you add a node's translation to a different menu that the source node?
id flag

I would like to add a node's translation to a different menu than the node's source. Is that possible?

For example, English is placed in main menu and french translation is placed in a different menu.

Score: 0
Sorting on a custom date field is slower than sorting on relevance: Is there a solution?
pe flag

I'm using search api with database backend on a Drupal 9.3.3 site. I've indexed 26,000 nodes of a custom content type and these include a custom date field: field_display_date

The index is set up to do rendered html. Since I need users to be able to sort on field_display_date (descending) as well as relevance, I've exposed two sorts: relevance and date (using this custom date field) and have adde ...

Score: 0
Alex Sh avatar
Enable HTML for invite module email
de flag

I'm using Drupal 9 and the Group invite module, which allows me to alter the text sent on email invitations.

I'm trying to use HTML in Invitation e-mail, but the module replaces HTML markup with a *.

I've implemented hook_form_alter() in a custom module and put this code.

$form['invitation_email']['invitation_body']['#type'] = 'text_format';
$form['invitation_email']['invitation_body']['#format'] = ' ...
Score: 1
Vitaliy K avatar
How to override facets checkbox theme and style checkboxes checked state?
tr flag

I'm having trouble to style Drupal 9 facets checkbox in checked state. I have tried to override the theme by theme_preprocess_checkboxes with no effect.

here is my code :

 function mytheme_preprocess_checkboxes($variables) {

  $element = $variables['element'];
  $element['#attributes']['type'] = 'checkbox';
  element_set_attributes($element, array('id', 'name', '#return_value' => 'value'));

  //  ...
Score: 0
Sherry K avatar
How can I increase the SMTP email file size?
cn flag

I have a drupal 7 website with rules 7.x-2.13. There is a rule which sends html email with all the fields whenever a new node is created of a content type. There is a file field as well which allows user to upload PDF docs of max size 20MB But whenever user uploads file greater than 8MB rule to send html email doesn't go ( although the node is saved) there is an error: message file too big client denie ...

Score: 0
Equal-width columns in Olivero
tr flag

I display an entity reference field that holds 4 images (media items). By default they are displayed in 4 rows one below the other. I want to display them side by side. Olivero is the theme I am using.

If I set .grid-full to the parent element, then indeed the 4 images are arranged in columns. However, they only occupy 1 column each out of the 14 columns of the grid.

It seems I have to add someth ...

Score: 0
Interlated avatar
How can I increment and save an integer value in a single operation to avoid race conditions?
km flag

How can I increment and save an integer value in a single operation to avoid race conditions?

With MySQL, I could use the following query.

INSERT into mytable (logins)
 SELECT max(logins) + 1
 FROM mytable

I am currently using the following code.

$query = \Drupal::entityQuery('node')->condition('type', 'bond')
  ->condition('field_para_identifier.entity:paragraph.field_bond_pending_id', 'NULL', 'I ...
Score: 3
user780 avatar
How can I override the node template for one multi-site instance?
gb flag

I have several Drupal 9 sites on multi-site setup. currently all these sub sites use one theme placed in /themes/MyTheme folder.

now i need to theme few nodes on site A and site B and this is only difference between all sites. if i use page--node--x.html.twig convention to change layout of node x on site A, it changes layout of node x on all sites.

what is easiest way to apply page--node--x.html.twig ...

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.