Latest Drupal related questions

Score: 0
zapico avatar
Link to images in form view creates wrong url
cn flag

I noticed this after drupal 9 update, but I've tried to find the exact moment when it was broken and I couldn't find it. I use S3 and cloudfront for images so maybe the problem is related with that config.

Apparently, the images work well (that's why I didn't realize it was broken). Images load correctly in my frontend and even the little preview in the backend is correctly shown. The problem is  ...

Score: 1
How to make media description show on form view when used as entity reference
pg flag

Drupal 9... I have a content type of "Resource" which uses a field "download" which references the media type "document", but when I upload a file to the field, it gives me no opportunity to enter a description for the newly uploaded file.

Resource content type Field_download (entity reference to Media Type = Document)

Media Type: Document

  • field_description (text -- required)

  • field_media_docume ...

Score: 0
Media migration results in numerous unexpected file usage records (CSV source): How to do this correctly?
pe flag

I'm migrating lots of records from a non-Drupal site into Drupal 9. The records have file 'attachments,' and I want these to be media in the Drupal site.

I have all the files already on the server where they need to permanently live and have all the paths/URI's stored with all the other site data in CSV files.

Successful so far: I can migrate the URIs into file entities without errors, using the mig ...

Score: 0
Primary tabs display differently for different roles?
ve flag
Sam

In my Drupal 8 site (using the Seven theme), the primary tabs navigation are displaying differently for different roles. See screenshots below.

It would appear that for the limited Editor role, it's showing the tabs in some sort of space saving '...' dropdown menu (all the other tabs are hidden underneath the '...').

The browser windows are the same size and there is clearly plenty of room for all o ...

Score: 4
Module is not longer supported on Drupal 8 but requires 8?
ve flag
Sam

I'm updating a Drupal 8 site that hasn't been touched in about a year (just updated to 8.9.12). One of the module updates is Menu Token.

The module page reads:

Drupal 7.x and 8.x versions
No longer supported.

But for the latest version (9.1.0-alpha1), it reads:

Requires Drupal: ^8 || ^9

So... I'm confused. Is this safe to install on D8? 8 isn't supported, but it requires 8?


Screen shot of Menu Token ...

Score: 1
ThePear avatar
Programmatically load the same view multiple times with different contextual filters values
cn flag

I'm trying to load a view X times but with a different contextual filter value each time. My code generates the correct amount of view blocks, but they are all the exact same. They all correspond to the first value passed. Here's my code (in hook_preprocess_node) :

  if ($node->getType() == 'parent'){
    $parent= $node->field_datas_taxonomy->getValue()[0]['target_id'];
    $terms = \Drupa ...
Score: -1
How can I use a token in a mailto link?
cn flag

I installed the Token and the Token filter modules.

I use a mailto link in the body of a block.

<a href="mailto:[email protected]?subject=The subject I want&body=Can you send me my invitelink for [site:name] please?">[email protected]</a>

The token isn't replaced by its value.

How can I use a token in that link?

Score: 0
thiokol avatar
Setting $order_item->setUnitPrice($price, TRUE);) stops cart items being merged, how to prevent this?
cn flag

Drupal Commerce 2, with Drupal 9.

In the CART_ENTITY_ADD event, if i set $order_item->setUnitPrice($price, TRUE); identical items added to the cart get added as new order items, but I want them to be merged.

If I comment out this line in my code the items get merged as expected and their quantity is summed.

How do i set the unit price without the order items being treated as distinct order items?

Score: 1
How can I use a JWT from a headless front end to automatically log in a user on a different subdomain?
cn flag

I've got a headless application with a vuejs frontend on mysite.com and a Drupal backend on backend.mysite.com, so that users can still leverage Drupal's forms, etc.

Of course, backend.mysite.com/user/login works out of the box, and I have login working on the frontend via https://www.drupal.org/project/simple_oauth (which generates a JWT for access/refresh tokens). The issue is that there is no  ...

Score: 0
Vince Saseniuk avatar
Custom styled tables
ck flag

I am trying to figure out a way for a content editor (with little to no coding experience) to add and style tables within their content. I was planning on creating a paragraph type where the editor could choose the various options to style their table and then add the table content via CKEditor.

Where I'm running into trouble is figuring out how to add classes to <table> that gets generated by CKE ...

Score: 2
Views performance: Teaser vs Fields
de flag

I have to create a view on a Drupal 7 site which will have 6/8 node fields. There will be some logic for which I will have to rewrite results as well as create a views-view-field-XX.tpl.php template file.

Thus, instead of using fields, using Content > Teaser and writing/reusing the logic in the node--CONTENT-TYPE.tpl.php template file looks more tempting to me. It also seems to make my work easie ...

Score: 0
How to provide an array of values from a context provider
in flag

I'm looking into building a custom Context Provider, specifically to provide "groups of the current user". I'm building this for another plugin, a Condition plugin, whose purpose is to filter things (e.g. Blocks) based on the current user's group roles.

I'm aware that the following issues and patches exist, which does get me somewhere:

Score: 0
Restrict permissions for user to only allow certain user managing actions
de flag

I would like to restrict permissions for a user to only allow certain user managing actions like for example blocking other users and / or deleting them.

This is meant for a user role like a moderator for forums.

Is there any module that can do that? I mostly found modules that restrict access to content but not much for restricting actions concerning user actions.

If not how could I implement this in  ...

Score: 0
Anshu Raj avatar
Search views broken/missing after upgrading Drupal 8.9x to Drupal 9.3x
cn flag

Getting error in search FILTER CRITERIA after upgrading Drupal 8.9x to Drupal 9.3x

please look into the image.views filter certeria broken/missing image

We are using :

  • solr server v6.6

Modules :

  • search_api_solr - 4.2.3x
  • search_api - 1.22x

I checked/verified the solr server and we are getting complete data in solr(query). what do I need to change in search...

please suggest..

Score: 2
Display custom module block in page content
br flag

I have created a custom module providing a block.

The block is available in the block library under "Block Layout" (/admin/structure/block).

On the other hand, I have a custom content type with an "Entity reference revisions" field that allows me to add any kind of content to a page. I can select "Add Drupal Block" in this field but my custom block either:

  1. Shows up in the list if it's placed in the bloc ...
Score: 0
Frédéric Hébert avatar
Dynamically add field to Views result row
us flag

i use views_data_export to export a list of nodes to excel. These nodes of type "proposition" have many paragraphs fields, with multiple values.

By default, views_data_export export all paragraphs values in only one cell per field. I want to split these multiple values in multiple columns. One value per column.

I've written a hook_views_pre_render function :

function ehess_propositions_4_views_pre_render ...

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.