Drupal Answers Community Digest

Top new questions this week:

Is it ok for a plugin to extend a class in some other module without declaring the other module as a dependency?

I have a module with a few helpful services and field formatters. I have one field formatter that applies only to entity_reference_revisions fields and, as a result, "uses" and "extends&...

coding-standards  
user avatar asked by sonfd Score of 6
user avatar answered by Patrick Kenny Score of 5

Are database connections automatically closed?

Our servers that run Drupal 10 site on Azure is experiencing too many active database connections and they are mostly in SLEEP state. Do Drupal 10 modules automatically close database connections ...

database 10  
user avatar asked by unixmiah Score of 1
user avatar answered by mona lisa Score of 0

Greatest hits from previous weeks:

How do I add an image to a block in Drupal 7?

I want to add an image to a block located in the First Sidebar in Drupal 7. Does anyone know how to do this? Thank you.

7 blocks media  
user avatar asked by fuu Score of 7
user avatar answered by Letharion Score of 8

How can I change the page title?

In Drupal 7, I could change the page title with drupal_set_title(t('New page title')). When I try it in Drupal 8, I get a There is no such function error. How can I change the page title?

8  
user avatar asked by Jeff Madison Score of 38
user avatar answered by Yuseferi Score of 47

How do I get the path for public://

I need to get the path for public:// at runtime. Is there a function I can use to get it?

7 files  
user avatar asked by vintorg Score of 47
user avatar answered by avpaderno Score of 38

Verify a field is not empty

What is the best method to check if a field is empty in a node template. In node--example.html.twig we can use "content" variable. I can't use check like checking a block {% if content....

theming 8  
user avatar asked by sainf Score of 23

How do I remove duplicates when using the random sort?

I have created a view where I am displaying the the node title and a logo (a cck field). In the arguments I have passed the taxonomy term name. In the result a node is displaying 2 or 3 times; I ...

7 views  
user avatar asked by Ahmad Score of 30
user avatar answered by Sithu Score of 19

How to programmatically trigger a click on an AJAX enabled form submit button?

I'm trying to programmatically (with jQuery) trigger a click on button with AJAX behavior in a Drupal form, but so far jQuery('#edit-submit').click() doesn't do anything. A real mouse click on that ...

7 ajax javascript  
user avatar asked by Daniel Score of 29
user avatar answered by Daniel Score of 48

How do I get the raw field value in a twig template?

myfield is a plain text field. {{ content.field_myfield }} renders the field with HTML markup and the field label. How do I render the raw value of the field? {{ content.field_myfield.value }} doesn'...

8 theming  
user avatar asked by Pim Score of 45
user avatar answered by No Sssweat Score of 78
You're receiving this message because you subscribed to the Drupal Answers community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 14 Wall Street, 20th Floor, New York, NY 10005

<3