Latest Drupal related questions

Score: 0
Extect avatar
With sites/default/files not part of the git repo, which content will be used in dev?
cn flag

I am using a composer managed Drupal install and want to use git to move it between development and production environments. From what I understand, the only directory that is not supposed to be in the git repo is sites/default/files. Everything else incl. modules, themes, composer files etc. would be in the repo. Composer would only be run in local dev, but not in production.

What I don't unders ...

Score: 0
How can the Webform element Form display defaults be set?
cn flag

Every webform element has a little section like this:

Form display section with Title display, Description display, and Help display all set to " - Default -"

Where can one set these defaults, for Title display location, Description display location, and Help display location?

It does not appear to be in any of the webform overall settings or webform specific settings.

If it's the default for the element type, is there a programmatic way to override the default (but not if set for an individual ele ...

Score: 0
H M avatar
Integrating jQuery Auto Height with Views Infinite Scroll
mw flag
H M

I have a views block with an infinite scroll (using Views Bootstrap and Views Infinite Scroll modules). The block displays cards and I want them to have the same height. jQuery Auto Height does that well. However, it only happens for the initial load. Auto Height has no way of knowing to fire on subsequent Ajax calls. What is the best way to integrate them so that Auto Height is called on each infinite ...

Score: 0
Josh avatar
Underscore JS Not Loading
yt flag

I am writing code that uses Underscore JS in Drupal 9 that should be loaded from /core/assets/vendor/underscore.

I am using Chrome DevTools to see the sources and though jquery, jquery-once, and modernizer are all loading from /core/assets/vendor/ the underscore library is not.

I am almost positive that this was working last week. I have updated my code since then but it is the same use of underscor ...

Score: 0
peterbe avatar
FillPDF not displaying 'foreign' characters
in flag

I'm using the fillpdf module with the online FillPDF service to render the PDFs. Most everything is working great; however, if a database field I'm displaying on the PDF contains certain 'foreign' characters, those characters don't display at all.

Notably, this occurs with the circumflex (ĉ) and caron (č) characters. Other foreign chars display fine (eg ö, é, è ...).

Not sure if this is an issu ...

Score: 0
Managed_file with table of uploaded files
lc flag

Adding a file field to a custom node type results in a nice UI with a table appearing for all uploaded files, with a Remove button for each. But simply adding a managed_file to our own forms, eg:

$form['attachments'] = [
  '#type' => 'managed_file',
  '#title' => t('Attachments'),
  '#description' => $descriptions,
  '#upload_validators' => $validators,
  '#upload_location' => $this->get ...
Score: 0
Gabriel Fernandez avatar
How to handle large queue process
cn flag

I'm using the QueueWorker plugin to do some update/create node process in the background. On local there isn't an issue, it completes the whole queue process. However on the aws server it usually stops at some point. I'm assuming because of the resource consumption on the server. Whats the ideal way to optimize my QueueWorker?

Here is my code:

$offset = 0;

while (TRUE) {
  $nodes= \Drupal::entityQuer ...
Score: 0
steevee666 avatar
How to replace the default page and tab of profiles in the user account?
in flag

I installed the "Profile" module on my "Drupal 9" website. When I create a profile type, the module automatically creates a tab in the user account for each profile type.

For my profile type "projects" the user account tab displays the page for this profile type, with this path :

/user/ID/project/list

Here is the view added by the module :

enter image description here

Here are the tabs created in the user account :

enter image description here

I created ...

Score: 1
matsbla avatar
How can I provide my own replacement patterns to be used in config form?
pe flag

I want to give a configuration form where user can configuration text on a widget, like the description and button label, however I want to provide a replacement pattern to be used, like {{count}} so the user can write for instance "{{ count }} images remaining". How can I provide replacement patterns to be used in the configuration form?

Score: 1
Grayson Cooper avatar
Git branching strategies with a small team to develop a Drupal site
in flag

We're a small team (5-6 developers) building a Drupal 7 site. Previously, we've used Features (https://www.drupal.org/project/features) to export our configurations from development to production. We've relied largely on assigning developers discrete, unrelated tasks.

Our upcoming work has distinct, but related development. For example, I anticipate we'll need to add fields that will be used by two d ...

Score: 2
Rubix05 avatar
Shared Facet between Taxonomy and Content Field
cn flag

My search page needs to show results from both content types and taxonomies.

Both the content type and taxonomies that I am searching on have a field called training_location. The training_location field is also a taxonomy with only two options: "Remote" and "In-Person".

Is there a way to merge a facet so that I can filter results for both a content type and taxonomy that has the training_location ...

Score: 0
J.g avatar
How can I view the list of referenced nodes when viewing a node?
us flag
J.g

I have a content type with a Related pages field, which an entity reference field for nodes.

How can view those nodes while still on the current node?

I tried to achieve this by creating a block view, but this shows all the nodes, whereas I want only the nodes referenced by the Related pages field.

screenshot

Score: 1
How to set default value on Select2 Autocomplete via hook_alter
nl flag

What's the best way to set a default value to a Select2 autocomplete field widget on form load (I'm using a reference view to populate options). I've tried a ton of different variations from within form_alter with no success, such as...

$form['field_name']['widget']['#select2']['id'] = 12

I can set the hidden <select> element with...

$form['field_name']['widget']['#default_value'] = 12

...b ...

Score: 1
Format of callback arguments in YAML files
ke flag

For instance, for the Filter module, in filter.permissions.yml, custom permissions are defined:

permission_callbacks:
  - Drupal\filter\FilterPermissions::permissions

That looks like a static function, but it isn't. How does that work? Is the format for this kind of callback argument documented or defined anywhere?

Score: -1
Programmatically create a new image style
us flag

I'm creating my own module and I need to programmatically create an image style to use with a new media type.

I found the core/profile/standard/config/optional/image.style.max_1300x1300.yml file whose content is the following one.

name: max_1300x1300
label: 'Max 1300x1300'
effects:
  04caae9a-fa3e-4ea6-ae09-9c26aec7d308:
    id: image_scale
    data:
      width: 1300
      height: 1300
      upscale:  ...
Score: -1
steevee666 avatar
How can I re-organize the user account tabs?
in flag

I have a Drupal 9 site. I can't find how to rearrange or rename the user account tabs.

How can I re-organize the user account tabs?

screenshots

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.