Latest Drupal related questions

Score: 0
Yuseferi avatar
Permission for publish field on a translation
cg flag

the website is a multilingual website, and the Publish field is checked as translateable. user one, can see the Publish checkbox on translation and can change it.

but in the other role (let's call it content admin), when editing the translation all fields are there and editable but only the "Publish" checkbox does not show for the user.

I almost gave all translation and edition permission to the "conten ...

Score: 0
What cache tags can be triggered by a change in state variables?
ca flag

If I want my render array to indicate to Drupal that it should be rebuilt when, say, node 1 changes, I can do something something like this:

$my_render_array = [
  ...
  '#cache' => [
    'tags' => [
      'node:1',
    ],
  ],
]; 

How can I tell Drupal that my render array should be rebuilt when the state variable foo changes?

I tried this but it does not work:

$my_render_array = [
  ...
  '# ...
Score: 0
Baud avatar
How to completly remove a field?
sa flag

I have removed a field from a bundle (it is not used somewhere else) by using the graphical UI.

But it is still listed when I run the following command (after cache clear)

$this->entityFieldManager->getFieldDefinitions('node', $bundle); 

What should I do to completely remove it (as I use the previous command to display some list)

edit to add:

Following the proposal of Clive, I ran the field_ ...

Score: 0
liquidcms avatar
How to cache View block by content language?
us flag

I have a very simple (block) view to list a node's title. This view has an id from url contextual filter and a single filter to filter on Content language set for the page (by URL prefix). This block is then placed using Layout Builder on the Full Content view mode for this node type. The view is set to use Tag based caching. When I switch the page back and forth between languages; the title language do ...

Score: 0
How to change user password with Services 3.x?
kr flag

I make a mobile app using Services 3.x module and Drupal 7. I would like to add a functionality for users to change their own password but I did not find a way to do it.

I read and tested this, but it did not work in my case : how can i change new password/confirm password by using services module in drupal

Can someone give me clues on how to do it?

Score: 2
Alireza Tabatabaeian avatar
Why do setter methods in an entity return $this?
cn flag

Writing a custom entity type I noticed that all setter methods in entity classes are returning $this after changes, as methods modify the object and so object will definitely being modified, then

what is the propose of returning the objects? is it a best practice?

Score: 0
Thony avatar
Render a commerce checkout pane programmaticaly
cm flag

I need to render the order review pane in a (ajax) controller.

What would be the simplest way to programmatically get the order review pane markup ?

Score: 0
Front menu not showing subitems
cn flag

I've generated my menu based on the menu template from the stable theme

{% macro menu_links(items, attributes, menu_level) %}
  {% import _self as menus %}
  {% if items %}
    {% if menu_level == 0 %}
<ul{{ attributes }}>
  {% else %}
  <ul>
    {% endif %}
    {% for item in items %}
      <li{{ item.attributes.addClass('sidebar-item') }}>
        {{ link(item.title, item.url) } ...
Score: 0
Nathaniel W. avatar
How to prevent drush migrate:import from updating existing content?
pe flag

Drush migrate:import (version 10.3.6) seems to be updating existing content regardless if the --update option is used or not. What could be the problem? I've tested it both with and without the --update option and it behaves the same way. However, when I ran it using the migration tools module, it is opposite - nothing gets updated in both cases.. It seems this problem has started after the site in ques ...

Score: 0
Scottie birdsey avatar
Disable Views exposed filter choices that would return an empty set when using multiple filters
jp flag

I am using Better Exposed Filters with Ajax to display multiple taxonomies that users can select to drill down into a list of results. Taxonomy A, Taxonomy B – if a user selects a choice from Taxonomy A, they can also select a choice from B. But, if a user makes a choice from set A, I would like options disabled in B that would result in an empty set.

I would even be fine with disabling Ajax t ...

Score: 0
tWoolsey avatar
Twig\Error\LoaderError: Template "@theme/footer.html.twig" is not defined
no flag

I know there are similar questions to this that have been asked but none of the solutions are working for me and I've been at this all day so I thought I'd give this a try.

I've created a sub-theme of Bartik for Drupal 9. I've copied the page.html.twig and I'm trying to include a templates/includes/footer.html.twig and nothing I have tried has worked.

  1. I installed the components module and updated DB

Score: 0
liquidcms avatar
Does Views block caching include language in cid?
us flag

I think this is likely a core bug (in which case I know it is not meant for Drupal Answers) but thought I would check here first to see if possibly I have just missed something in configuration?

I have a very simple (block) view to list a node's title. This view has an id from url contextual filter and a single filter to filter on Content language set for the page (by URL prefix). This block is t ...

Score: 0
Drupal Webform Email Notification not Rendered
za flag

in the email/handlers (email notification), if I select custom body. the output of the body message is below. It doesn't render any fields I put in the body. Has anybody seen this issue before? I'm using Drupal 8.

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'webform_email_message_html' -->
<!-- FILE NAME SUGGESTIONS:
   * webform-email-message-html--event-registration--email--email.html.tw ...
Score: 0
drupal 7: no hooks run on page load
cn flag

I have site on drupal 7. I'm creating a module to add a poll on-page instead of a template string. As I understand, I should do it in some hook-like hook_page_load, hook_init, hook_boot, etc I created some hooks in my autopolling.module:

<?php
error_log("in autopolling\n",3,'D:\\TEMP\\temp\\php.log');

function autopolling_block_info(){
    error_log("autopolling_block_info\n",3,'D:\\TEMP\\temp\\p ...
Score: 1
Migrating Wysiwyg/Ckeditor embedded images to embeded images
eg flag

I am migrating a Drupal 7 site that is using: drupal/wysiwyg:^2.9' (plus the ckeditor library) drupal/media:^2.27' drupal/media_ckeditor:^2.14'

In Drupal 7, when you insert an image into the wysiwyg body. The source code looks like this.

[[{"type":"media","view_mode":"media_large","fid":"532","field_deltas":{"1": 
{}},"link_text":null,"fields":{},"attributes":{"alt":"Image of a hand","height":"238","w ...
Score: 0
vrijdenker avatar
ElasticSearch Views integration not working with multiple words
in flag

In Drupal 9 I have setup ElasticSearch 7. I have added a Search API View in which I have added field to search through the "rendered HTML" field.

This seems all pretty basic if you ask me, however it doesn't work as expected.

For example my page contains text like "Lorem ipsum dolor sit amet".

  • If I search for "ipsum" I get the page as a result
  • If I search for "dolor" I get the same result
  • But if I  ...

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.