Latest Drupal related questions

Score: 3
Interlated avatar
How do I use the markdown module to print the module README.md file?
km flag

I've created a README.md file in the custom module and would like to provide this as the help page in formatted HTML.

Raw text is being printed out, how do I get the HTML?

The module is drupal/markdown 3.0.0-rc1.

function cbi_bond_id_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
   case 'help.page.cbi_bond_id':
      $text = file_get_contents(dirname(__FILE__) . "/README. ...
Score: 0
Creating a store in the Commerce module fails
cn flag

Using Drupal 9, latest release of Commerce 8.x-2.28. I followed the Lugwig install instructions for the Commerce module. Everything seemed to install OK.

When I fill out the Create Store form, I get an error. The log shows: Location http://d9.susansmithjones.com/store/add/online Referrer http://d9.susansmithjones.com/store/add/online

Message Error: Class 'Doctrine\Common\Collections\ArrayColle ...

Score: 0
Installing the dependencies of local modules without composer merge plugin
in flag

Currently I have a composer-based Drupal project with both third-party and custom modules. Third-party modules are managed by composer without any issues. But I would like my custom modules to declare their dependencies in a composer.json within their directories, and also have them install when I run composer install at the root of the project.

composer.json
web/
  modules/
    contrib/
      address/  ...
Score: 0
bigboy avatar
How to add Views total rows count in page title?
gu flag

I want to add the total rows count in my page title (not the view title).

Tried using the metatag module for that, but instead of [view:total-rows] token, which is shown as supported for the title field, I get 0 (zero).

I was able to change the view title through hook_views_pre_render(ViewExecutable $view), but this didn't change the page title. Moreover, I want them to be separated: page title !=

Score: 0
How do I programmatically set a flag's custom entity reference field when programmatically setting the flag?
pe flag

Some background: I'm new to Drupal 8/9 module building. I need a particular content type's nodes to be automatically flagged. I have this working using the code below. However, the flag involved also has a custom field I need to set.

  • It's an entity reference field (to another node)
  • I want to set the flag's custom entity reference field to be the same value as an entity reference field on the flagged n ...
Score: 1
Hometoy avatar
Add Composer to an existing site
in flag

I built a Drupal 8.9 site with Composer on a DEV server and copied the files (& db) over to the LIVE server.

The LIVE server did not have Composer installed previously so I installed it, locally.

The new website has its composer.json file from when I created the site and added modules.

I tried composer update to verify that composer will work when the time comes.

It fails and I don't know if I n ...

Score: 0
How can I use CloudFront together Cloudflare?
na flag

Cloudflare is used on the Drupal 9 site. I should add CloudFront functional to the site. I set CloudFront on AWS. When I enable CloudFront, all images of the site got the CloudFront URL as necessary. But all images were created after CloudFront was enabled are not available.

Has anyone encountered such a problem?

Score: 0
Jason avatar
Nested views ajax pagination
in flag

I am using Drupal 9 and views_field_view to embed a "child" view within a "parent" view. Because there are multiple rows in the parent view, I end up with multiple of the same "child" view being rendered. This prevents the "pagination" from rendering because the "pager id" is the same for the multiple rendered child views.

I am able to circumvent that render issue by programmatically setting the pager  ...

Score: 4
pglatz avatar
Loading individual css files for custom modules
in flag

I have a custom module that creates three pages. Each page has a controller, twig file, and css file. What I'd like to do is only load the css files when they are needed. I created a libraries.yml file like this:

mymodule:
  version: 1.x
  css:
    theme:
      css/page1.css: {}
      css/page2.css: {}
      css/page3.css: {}

This loads the three css files whenever I display any of the three files. Wh ...

Score: 3
Derive all image styles when user uploading
cn flag

I have several image styles defined but only thumbnail and medium styles(images) can be derived from the original image.

I know those two styles are set in the "manage field" of image and my usage is not going to switch thumbnail nor medium to other styles. My use-case is to generate all styles when/after users upload.

Please help, Thanks!

Score: 0
nathan111777 avatar
How to correctly add a slideshow to Content type using a module paragraphs?
fr flag

I created a Content type - News. Then using modules View, Slick Carousel, Slick View I displayed my news in a block as a slideshow enter image description here

But now I need to add a slideshow to a paragraph and display it on the front page.

Since the paragraph itself will not show anywhere, I did the following:

  1. Сreated Content type Slide
  2. Сreated Paragraph, add to the paragraph field Viewfield provided by the module View ...
Score: 0
liquidcms avatar
Is it possible to render a View based on the Content language?
us flag

Drupal supports the concept of Interface Language and Content Language. I (and every client I have ever asked) seem to have a different opinion of what is "content" and what is "interface" than Drupal does (in most cases). I consider Interface as the items an administrator or editor would use to do their job (admin menu, edit tab, help details on forms, etc) and Content is what non-admins (often this is ...

Score: 0
Hometoy avatar
Copied Drupal 8 to Live server now can't log in
in flag

I built a simple Drupal 8 website on my DEV box and moved it to the LIVE server.

  1. Copied the files on the DEV server into a tarball
  2. Moved these file to the LIVE server (using scp).
  3. Uncompressed web files into it's destination directory (/var/www/html/newsite)
  4. Created the database, user and set permissions to match that on the DEV server
  5. Backed up the MySQL Server database into a .sql file with mysqldump ...
Score: 2
How does Postgres manages case-sensitive versus case-insensitive “IN” operations in Entity Queries?
br flag

I see that an equality is converted to a LIKE operation when the field is tagged as case-insensitive, which Postgres then translates to ILIKE in the driver. However, I don’t see how Postgres is able to do both case sensitive and case insensitive IN comparisons.

The same black magic occurs with the STARTS_WITH, and CONTAINS operators.

Score: 0
Delford Chaffin avatar
VBO custom actions - reset after action
gg flag

I have created two VBO custom action buttons. One prints orders, the other updates them. Clicking one disables it and the other until the page reloads (losing all checked orders).

How can I have the print button rebuild/refresh/reload the page or otherwise make the buttons available again and maintain the checked items, if possible.

Here is the unique code for the two buttons:

class PrintOrderAction exte ...
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 ...

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.