Latest Drupal related questions

Score: 0
Roi1001 avatar
How to export view's translation?
cn flag

I used view translate(/admin/structure/views/view/my_view/translate) to translate a filter's label and saved. When I refreshed the view, it worked. Then I went to /admin/config/regional/translate/export page to export the same language's translation, including customized and non-customized, as .po file. But I couldn't find the translation I made in the file.
So how should I export the view's transla ...

Score: 1
jbreslow avatar
How to display 'Welcome [first_name] [last_name]' in a custom views block? D8
ae flag

I would like to create a custom block / view to display a welcome message to the currently logged in user in Drupal 8. I followed this answer but it isn't working for me. Maybe things changed in D8. Is there a way to do it in D8 and / or am I doing something wrong?

I've added a bunch of Fields and Contextual Filters trying to get it to work but nothing shows up.

enter image description here

Score: 1
mathieu avatar
How do I avoid overwriting the .htaccess file when I use the Compose command?
mw flag

On my new Drupal 9 website, I customized the .htaccess file and the robots.txt file

I don't want its files to be overwritten when updating with Composer.

I added the lines below in my composer.json file but the .htassess file is overwritten every time. What's wrong with my code ? Thank you

"extra": {
    "drupal-scaffold": {
        "locations": {
            "web-root": "./"
        },
        "file-mapp ...
Score: 0
Sharing articles on Social media loses the images after posting
pg flag

This seems to have only happened recently. Has anyone found a fix? I'm using D7 with Metatag, Metatag:Facebook & Metatag:Opengraph.

However, I'm not convinced the issue is with any of these modules, and here is why:

When I share an article on facebook (other platforms are doing the same), the image shows correctly in the preview but when it is displayed on a user's profile, either no image or a  ...

Score: 0
mike avatar
Updated versions aren't shown in the back-end
cn flag

I have problem while updating drupal from 9.1.4 to 9.1.9. in my composer.json path i have seperate installer path for a folder name example2.com which contain core, modules,etc... on the first time drupal core updated got into the folder web root directory. after i changed the installer path in composer.json and tried to update composer ouput "Nothing to update" message. Also deleted composer.lock file  ...

Score: 0
miststudent2011 avatar
How do I install Drupal with multiple custom languages using drush?
fr flag

I know I can install a new Drupal web site with single custom language using:

$ drush si standard \
    --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]' \
    --account-name=admin --account-pass=secret\
    --site-name=Example \
    [email protected] \
    --locale=it

Similarly how can I pass multiple languages to locale key ?

--locale='it','uk','de' 

doesn't work neither doe ...

Score: 0
bigboy avatar
Display title, based on exposed filter of view
gu flag

I've read these questions:

But it did not help.

My Drupal version is 9.1.9. I have views displaying Taxonomy terms. Each taxonomy term has fields, for example "Genre". I have 16 different genres with "key|value" type.

I have exposed filter, based on genre field. I've added this field to Contextual filters ...

Score: 2
Problem removing field collection module
cn flag

We recently migrated successfully in our drupal 8 instance from field collection module (latest alpha) to paragraphs. Now I am trying to remove the field collection module from our drupal instance, but it cant be removed as it is "used in the field field_collection_item.field_sprechzeiten_zeitraum" (see screenshot from uninstall view).

uninstalling field_collection is prevented

When I try to delete this field field_sprechzeiten_zeitraum, t ...

Score: 0
Content Translation installation breaks the website (statistics module error + aliases not taken into account)
in flag
Dna

First, I would like to say I am a total noob in Drupal and PHP but possess some knowledge on other web frameworks/languages).

Here is my path to the errors:

I used the UI to install Content Translation and Configuration Translation modules from the multilingual core (other 2 modules were already installed).

This did not work properly as it totally broke the website:

  • aliases not respected (from "/co ...
Score: 0
mts11 avatar
ckeditor not loading rich text editor by default
cn flag

I'm running CKEditor 7.x-1.19 with Drupal 7.80.

With "Default editor state" set to Enabled, and "Show the disable/enable rich text editor toggle" set to Show, my system is still loading the plain text window. I can then manually toggle to the rich text editor. I see this when creating new nodes or blocks, and also editing existing nodes and blocks - I think anywhere I'd expect the editor to load. ...

Score: 0
Usman Manzoor avatar
Translating Menu Item Programmatically?
pk flag

I have been trying to translate menu items programmatically but upon saving it just adds the english field value to all my translations. Below is the code I am trying to execute:

 if ($entity->hasTranslation($language->getId())) {
      //For update
      $entity->removeTranslation($language->getId());
    }
    try {
      $entity->addTranslation($language->getId(), ['title' =&gt ...
Score: 1
Making an HTTP subrequest causes CurrentRouteMatch to have the wrong route
by flag

For complicated and unpleasant reasons[*], I want to embed entity data from the JSONAPI module inside JSON returned from a REST module resource.

I am trying to do this by making an HTTP subrequest to the JSONAPI module route within the REST module resource class.

Like this:

    $kernel = \Drupal::service('http_kernel');

    $current_request = \Drupal::request();

    $request = Request::create('/jsonapi ...
Score: 0
How to allow   (and other HTML entities) in ckeditor?
ru flag

Our customer want to be able to add thin spaces in addition of non breaking spaces. But when we try to add the character   in source of ckeditor, ckeditor doesn't keep it and convert it as a basic space.

After research, it seems ckeditor allow the entity  . I don't know if I have a configuration which prohibit this (I tested with full html profile with non html correction, that' ...

Score: 0
sonfd avatar
How can I get a route's name if I have the route object?
in flag

I have a route object (which may not be the current route's object) and I need to get the route's name, e.g. entity.node.canonical. I don't see any method to get the name directly from the object, nor do I see it anywhere when I inspect the object via Xdebug.

I know that I can easily get the name of the current route with $current_route_name = \Drupal::routeMatch()->getRouteName(), but how can I g ...

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.