Latest Drupal related questions

Score: 0
pepe199111 avatar
Modify paths for existing images on Amazon S3 to a public path
in flag

I'm going to change the way how images will be stored. At the moment I use Amazon S3 for the old added images, new images will be stored in the public destination and then S3 won't be used. My plan is to import all of them into a public destination. How can I change a path for already added images into S3, which will be stored in a public destination now?

enter image description here

That's what I've done for now is (a) changed file ...

Score: 0
Kevin avatar
Run an update hook after specific configuration has been imported?
in flag

I am introducing new configuration to an entity in Drupal that adds a few new boolean fields. The problem is, even though I set the default value as TRUE in the UI, this is only for new entities. Existing entities will have no value, or false, when evaluated in code.

I would like to script a change in that will default all existing entities to TRUE when the configuration is introduced for backwar ...

Score: 0
Get client credentials from Simple Oauth module

I am creating user authentification with Drupal 9 + NuxtJS. Using Simple Oauth module and create post requests to

oauth/token

with data

const data = {
  grant_type: 'password',
  client_id: '',
  client_secret: '!',
  username: username,
  password: password,
}

So, how can I get this client_id, client_secret to past it in JS file ?

Score: -3
NSp avatar
How to track recently viewed nodes using JavaScript on a completely cached website?
in flag
NSp

I want to make a block of recently viewed nodes on a website which is completely cached using Boost module (it saves a static HTML page for every request on the website). I don't want to disable Boost and recache a page every time this block updated, instead, I wondering if it possible to use JavaScript here. Is there any way I can do this?

Score: 0
Roi1001 avatar
Resizing the image on upload doesn't delete exif data
cn flag

When I set the max resolution of an image field's max resolution, it said that the Exif data would be removed if the image uploaded gets resized, which is exactly what I need.

[1]: https://i.stack.imgur.com/OBGZB.png

But after I saved the settings, I uploaded a large jpg file and then download it, it got resized, but the EXIF data (like GPS location) remained.

Is it a bug or do I need to change some configurations to make it work as it  ...

Score: 0
sea26.2 avatar
Webform address killing ajax?
om flag

How do I attach an Ajax behavior to my country field (that already has a dropdown behavior).

I have a simple form defined using the webform module. enter image description here

In an implementation of hook_webform_alter I have the following code that works...

$form['elements']['business_e_mail']['#ajax'] = [
    'callback' => 'ajax_callback',
    'wrapper' => 'opt-in-wrapper',
    'disable-refocus' => FALSE, 
    'event' = ...
Score: 0
How to use hook_node_insert to automatically flag nodes of a specific content type
pe flag

All nodes of one content type in my project need to get automatically flagged (by the Flags module) when created. I'm aware that there is probably a way to accomplish this using Rules module, but I'm attempting to build my first-ever custom module to do it, because a) I don't think I'm going to need Rules for anything else in this project and b) want to get my feet wet on making custom modules. (I've go ...

Score: 0
quantumized avatar
How can I display the current Search API filters to the user?
ng flag

Using Search API and Facets on Drupal 9. If a user selects some filters (facets, text), how can we display the current search criteria to the user?

For example, similar to a breadcrumb list shows all of the current filters.

I seem to remember seeing this option before but cannot seem to find it now.

Score: 0
Matt B avatar
Over-ride entity delete button permission
th flag

created a Form View mode and some custom permissions (pre node, based on a user list field in the node). I want a user with that permission to be able to delete the node as well, and have added a delete button using hook_form_alter:

                $route_info = $room->toUrl('delete-form');  // need to use a custom handler to overright the delete controls.

                $form['actions']['del ...
Score: 2
sea26.2 avatar
custom handler for webform?
om flag

I'm not sure how to go about this... Given a simple registration form that has three fields

  • email
  • country
  • optIn (conditional)

When this form is presented, I'd like the Opt-in field to be hidden unless a specific country is specified.

Easy, so far. Just specify a condition for the Opt-in field set to country being a specific value.

Here is the catch:

Instead of the country being a static single ( ...

Score: 0
How do I display nodes in a map block and in the page content, with shared filters?
cn flag

I am using the Olivero theme on my Drupal 9 site and building a map with the Geolocation module.

I want to create a Views to display these two displays of the same nodes :

  • one display which is a map (displayed in the "hero" region)
  • another display (e.g. a list of teasers) which is displayed in the "content" region.

I want them both displayed on the same page and have them share the same filters. If I  ...

Score: 1
José L. avatar
Problems in collations when restoring
ng flag

I'm quite lost with this issue I'm experiencing, so any clue will be appreciated. Let's start with the "symptoms".

Whenever I restore a Drupal 7 site that has been previously backed up with drush archive-dump (Drush 5.10), I get this in the panels page:

Notice: unserialize(): Error at -- of -- bytes in _ctools_export_unpack_object()

As a result, all the information in that panels page is gone in the a ...

Score: 0
Dynamic Registration Form submission using vanilla Javascript ajax
us flag

I want to use the ajax capability of not refreshing the page or rerouting the user to the registration page. Login / Register dialogue modals have been created. I have the login javascript ajax working perfectly using an ajax call to the login api without any configurations or added modules. I want to integrate the registration form in the same way. I would like the registration to:

  1. show in a modal  ...
Score: 0
How to remove a spurious entity update?
id flag

Something (I'm not sure what) has introduced what appears to be a spurious entity update into my Drupal 9 site. I'd like to delete the update so that I'm no longer prompted to apply it.

> drush dentup
user entity type :
The User ID field needs to be updated.

 Do you wish to run all pending updates? (yes/no) [yes]:
 > yes

In SqlContentEntityStorageSchema.php line 1842:

  The SQL storage can ...
Score: 0
Webform email duplicates uploaded file
in flag

I'm using Drupal 9 and only have site admin level access and no developer support. I've also only been working with Drupal for a few months. So total newbie here; I apologize in advance.

I've created a webform which should allow external (non-registered) users to upload a file. The file should, upon submit, be emailed to a specific email address within the company. The problem that I'm running in ...

Score: 0
sea26.2 avatar
Create address element for webform to output country code
om flag

I'd like to create a field using webform that accepts a country but outputs the country code.

I'm guessing one path forward is to find the handler used by contrib and extend it? Or is that functionality already in the plugin and hiding in plain sight?

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.