Latest Drupal related questions

Score: 1
Matoeil avatar
ConfigNameException: Missing namespace in Config object name xxx
za flag

Drupal\Core\Config\ConfigNameException: Missing namespace in Config object name media_entity_file_replace. in Drupal\Core\Config\ConfigBase::validateName() (line 97 of core/lib/Drupal/Core/Config/ConfigBase.php).

i don't quite get what i have done wrong in my config form

media_entity_file_replace/src/Form/MediaEntityFileReplaceSettingsForm.php

namespace Drupal\media_entity_file_replace\Form;

use Drupal\ ...
Score: 0
Which attributes are used for product variations on the PDP (product display page)?
au flag

Let's assume we have one product with 2 product variations. Both the variations have 10 product attributes each; they are all filled with their option values, for example color = Blue, size = 10L, or height = 5.

How does the Commerce module decide which attributes are used for product variations on the product display page?

Score: 0
grant access to reorder in admin
ru flag

I have a Drupal with some kind of users (admin, gestion etc.) only admin can reorder field with multiple values when I editing nodes. Other user can't, the draggable picture not showed. Have you any idea? I thinks it's one permission but I don't find the good one (and with all modules, there is a LOT)

admin view

admin view

other users view

other view.

Score: 1
Stephan de Bruin avatar
Custom REST resource throws 404
np flag

I have created a custom REST resource to create a specific node entry. (I need some additional checks, so I can't use the available node resource.) The endpoint has been enabled in the UI. However, when I make a POST call to the endpoint at /rest/ticketmatic, it returns a 404. The following is the code in the modules/custom/ticketmatic/src/Plugin/rest/resource/Ticketmatic.php file.

namespace Drupal\t ...
Score: 1
Show 2 results for each of 3 different content types
bs flag

I am using Drupal 8. I have 3 content types: videos, images, and podcasts.

I want to have a single view that shows two of the most recent posts of each content type. For example, out of 4 videos and 2 podcasts, it should show 2 videos, 2 images, and 2 podcasts.

Is this possible? I have been trying to use hook_views_query_alter(), but I haven't been able to find a good documentation.

I am currently t ...

Score: 0
Vitaliy K avatar
How do I use {{file_url()}} to get image field URLs in views-view-fields.html.twig?
tr flag

I tried to use the following code in views-view-fields.

{{ file_url(fields.field_featured_image.content.0['#item'].entity.uri.value) }}

When I use that code, I get this error.

TypeError: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::generateString() must be of the type string, null given, called in /home/vito/Desktop/D9-fabco-v2/fabco-v2/vendor/twig/twig/src/Environment.php(418): eval()'d co ...

Score: 1
Sharique Husain avatar
Unable to use SameSite=none with secure attribute, using Symfony\Component\HttpFoundation\Cookie to create the cookie
sl flag

I am trying to create a cookie in Drupal 8.9 with SameSite=none with secure attribute, using the Symfony\Component\HttpFoundation\Cookie class but I am unable to do so as the class doesn't allow the secure attribute along with none.

Also, I tried setting the Cookie's secure parameter to TRUE but it results in infinite redirects in my site. I don't want to implement the solution on site level as i ...

Score: 1
baikho avatar
Entity autocomplete form API field with ViewsSelection handler
us flag

I'm trying to get an implementation of the Entity Autocomplete Form API field with a view selection handler working in Drupal 9.

I have seen some examples in New 'entity_autocomplete' form element added, but it shows how to use a default selection handler and they only appear to work in Drupal 8. Specifically it was possible to pass the view_name and display_name via the #selection_settings:

$form['u ...
Score: 1
user14409370 avatar
Theming a EntityListBuilder.php table using drupal/examples/content_entity_example as base
nr flag

Any idea how I could to use my own custom module twig file to theme my table?

I'm using drupal/examples -> content_entity_example as a starting point:

in content_entity_example.module implementing hook_theme I would like to return all fields like:


/**
 * @file
 * Contains Drupal\content_entity_example\content_entity_example.module.
 */

/**
 * @defgroup content_entity_example Example: Content ...
Score: 0
Mike avatar
How do I add a product variance title to the order information page?
jp flag

I am looking to have the Product Title appear in the Order Information page. However, the data is pulling the price versus the product title. I attempted to change the views. No luck. I am not a developer, so, if development is needed, okay. Just looking for an easy way to make this work.

Shopping Cart

enter image description here enter image description here

Score: 0
Geat avatar
Image fields that vary by theme
de flag

We are building a website that has multiple themes that can be applied to it, based on user selection.

The page content type is made up of Paragraphs (from the paragraph module), each of which can have a background image via an Image field.

Sometimes it is necessary to have these background images vary by theme. Is there an existing way to allow a different image to be added to a node per theme? Obv ...

Score: 0
jfc avatar
Search and Replace URL in database?
us flag
jfc

I need to move a Drupal 9 website to a different server and a lot of links have the old server URL. Normally for Word Press I use this tool - https://github.com/interconnectit/Search-Replace-DB https://interconnectit.com/search-and-replace-for-wordpress-databases/

You upload that to the server and it runs a script to search for your string and replace it with the new string.

I tried to do a regular searc ...

Score: 0
Marc Prince avatar
Page Manager fails when accessing structure pages
gh flag

When I go to Admin/Structure/Pages, the following error occurs:

InvalidArgumentException: The internal path component 'https://dssm.vegas/civicrm/contribute/transact' is external. You are not allowed to specify an external URL together with internal:/. in Drupal\Core\Url::fromInternalUri() (line 420 of core/lib/Drupal/Core/Url.php).

I either need assistance in removing the error or instruction as to wh ...

Score: 1
Add a custom Access callback to the profile module to hide the menu tab for certain users
ru flag

We are using the Profile module and I'm trying to hide the menu tab on the user's account for certain users based on a value of a field on the user.

I have the alterRoute set.

namespace Drupal\mymodule\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberB ...
Score: 0
user888 avatar
Can't import sql dump file from the live site (trying to create a development site)
ph flag

I am trying to create a development site which I can work on. So far, I have done:

  1. creating a backup.sql using drush sql-dump > backup.sql
  2. coping and pasting the live site folder for the development site folder
  3. in the new project folder (dev site one) I copied, I changed the db name,username, and password, then tried to import the database dump file by drush sql-query --file=backup.sql

From  ...

Score: 5
Michael Chen avatar
Extending contrib module filelog service class displays PSR implementation error
nl flag

I wanted to override the logger.filelog service from filelog module to make use of my own parser.

An error occurred through drush cim and drush cr when the new custom module that overrides the service is enabled.

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\LogicException: Service 'logger.filelog' for consumer 'logger.factory' doe ...

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.