Latest Drupal related questions

Score: 1
Giuseppe avatar
How can I customize the 403 page for specific routes?
br flag

On a D9 site, with an existing custom 403 page twig. I've been requested to show a different, variable, message from the "standard one" for a couple of specific routes.

I've tried with theme_preprocess_page__403(&$variables) but I couldn't determine the original route.

E.g. using \Drupal::routeMatch()->getRouteName() I got system.403 instead of the route name I need to check. I've checked solution ...

Score: 1
Thirsty Six avatar
Advagg with S3fs relative url() references inside of CSS files - broken image URL
gs flag

Background Images Paths are Changed when CSS Aggregation is On

s3fs module with AdvAgg to store CSS/JS aggregates on the S3 stream wrapper

Without Aggregation (Works well). fetch from domain base url.

background-image: url(/themes/THEME/images/test.jpg);

Src of the image in CSS, which is pointing to the CNAME for S3

With Aggregation isn't working. Because, my CNAME is different from my DOMAIN name.

 ...
Score: 2
edMan avatar
Set a dynamic filter value
pk flag

I want to construct a view with following constraints:

  • Show entries from the content-type XY AND it is authored by the currently logged in user

OR

  • Show entries from the content-type XY AND the first field/column corresponds to the currently logged in user

OR

  • Show entries from the content-type XY AND the second field/column corresponds to the currently logged in user

I do know about contextual filt ...

Score: 0
kumar saurabh avatar
Image is not showing on the product edit page after creating the product using API
th flag

I am trying to create a product with a product image on drupal using API. There was nothing given regarding uploading an image in API so I created a custom module under which i used this code to upload my image to the Drupal:

$data = base64_decode($encodedData['content']);
$file = file_save_data($data, 'public://astha.jpg');
$return['id'] = $file->id();

using this my image get uploaded to the follo ...

Score: 0
liquidcms avatar
Is it possible to define the destination that Views adds to links?
us flag

Views has a field to create a dropdown menu and this has the option of having the destination added to those links. This works great. Unfortunately, if the View is used through an AJAX call the destination ends up looking like it should return to the AJAX call rather than the page which launched the ajax call. This core Drupal bug: https://www.drupal.org/project/drupal/issues/2866386 is reporting this is ...

Score: 3
AndyRandom avatar
QuickEditIntegration can't process components for Quick Edit
cn flag

I have a content type that is displayed with Layout Builder. When I view it in default mode, the Quick Edit option does not appear in the contextual menu. This is because none of the fields have the data-quickedit-field-id attribute.

I spent a couple of days chasing this down. Apparently the issue comes up in this function in core/modules/layout_builder/src/QuickEditIntegration.php.

  private function sup ...
Score: 2
user105050 avatar
Unable to delete a tempstore that contains an en dash or an em dash
ca flag

I am trying to delete a shared temporary storage for a key containing an en dash or an em dash.

$keyword = '2020–2021';
$tempstore = \Drupal::service('tempstore.shared')->get('my_module_name');
$tempstore->delete($keyword);

It throws this exception.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8m ...

Score: 0
Is there a way to set a
wrapper around a webform without customizing the webform?
bj flag
hao

I would like to add a <div> wrapper around a webform. Is there a way to define the wrapper without customizing the webform?

Score: 0
Get path (alias) from SQL query
in flag

I have a SQL query to get all nodes with their ID, title, publish date, change date, etc.

Additionally I need to get path to each of them (probably from path_alias.alias).

Now I have following (without alias):

SELECT MIN(node_field_data.nid) AS nid,node_field_data.type, node_field_data.status, node_field_data.title, node_field_data.langcode AS node_field_data_langcode, node_field_data.created, node_field ...
Score: 0
yuuuu avatar
Prepopulate fields from json
ao flag

I am looking to prepopulate a page full of fields (not webform) from a json file. There are a lot of fields on the page and some of them contain a lot of info, so it doesnt appear that it is practical to use the prepopulate module. https://www.drupal.org/project/prepopulate

I have a rather long form that the user needs to fill in, but they likely already have the required info in a file on their p ...

Score: -1
latikas avatar
How to import Json file from Feeds module
ru flag

I am using Feeds import module with Feeds extensible parsers module, I am getting following error. I am not getting what is wrong with the json and settings. Can anyone help me to resolve this issue.

Thanks in advance,

enter image description here

My json look like,

[ { "lcia_id": , "name": "", "company_name": "", "company_id": , "net_weight": , "country": "", "address": "--", "serving_size": "-", "composition": [], "type": "",  ...

Score: 1
Add additional taxonomy term fields to an exposed filter form
in flag

Brief: How to add a custom field from a taxonomy term into a View's exposed filter form?

Specific: I have an image field added to taxonomy terms that I want to add to the exposed filter form along with the radio button and the TID's name (default is only radio + name), themed with Twig template.

More words:
Hello,
I'd like to modify an exposed Views filter form to include the rendered image field fro ...

Score: 3
sea26.2 avatar
Remove Configuration Installer (v1.8)
om flag

I'm upgrading a site from Drupal 8 to Drupal 9. One of the projects that is deprecated and incompatible with Drupal 9 is Configuration Installer

The "normal" workflow (e.g., drush pmu <module_name> doesn't work - perhaps because this thing isn't really a module?) I can't simply remove the project with composer because then drush cim fails because it expects the code to be in the base.

It is li ...

Score: 0
liquidcms avatar
InvalidArgumentException: Field field_message_header is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField()
us flag

At a total loss as to what is the cause of this error. The field was added to a Message Notify template entity. It is basically used as a token in emails sent using that module. The only place in my custom code that i use this field is to set its value from a value collected in a modal form. When submitting the modal; this error occurs.

The crazy part of this is that i have removed the field from ...

Score: -1
ldnddev avatar
Taxonomy term relationships
cn flag

I have 3 taxonomy terms that I would like to expose as filters but I would like to use JavaScript to disable filters as you make selections in the other related exposed filters. For example:

Styles Makes Models
Cars BMW 750i
Trucks Ford F-150

If you select "Cars" then the "Makes - Ford" and "Models - F-150" would be disabled. I currently have each item assigned a proper CSS class for ho ...

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.