Latest Drupal related questions

Score: 0
Views query plugin Undefined Index error
ua flag
mfv

I have been trying to build a custom views query plugin but Im getting an undefined index error for each field that i'm mapping. The filters im using for the endpoint do work when i check them. This plugin pulls data from an another drupal site through a json endpoint. I am mapping the fields to views with hook_views_data():

<?php
/**
 * Implements hook_views_data().
 */
function letter_query_vi ...
Score: 1
hga77 avatar
Somehow subscribe/react to addMessage
cn flag

I'm trying to find an event that I can subscribe to for the method addMessage.

I need to trigger some code everytime a status message is added. On reacting to this event, I need to send a variable from php to JS. I could not find an event to subscribe to so instead I used a preprocess, below.

<?php
function mymodule_preprocess_status_messages(&$variables) {
  $variables['#attached']['drupalSettin ...
Score: 1
Jed_BH avatar
How to load a file entity by uuid?
us flag

So I am trying to use the default image for users in a menu block if a custom one does not exist. And for it I am getting the image file uuid:

$default_image = $user->get('user_picture')->getSetting('default_image');

Then loading the file entity:

$file = Drupal::service('entity.repository')->loadEntityByUuid('file', $default_image['uuid']);

This is returning null. What am I doing wrong? And ...

Score: 3
Vivank Sharma avatar
How to get Automation testing results of Drupal contributed module through Drupal.org rest API?
lb flag

I am trying to get automated testing results of contributed modules through https://www.drupal.org/drupalorg/docs/apis/rest-and-other-apis.

I am able to get nid and vid of any contributed module through the node info API.

And I want to access DrupalCI jobs: pift_ci_job.json or pift_ci_job.xml

Which returns a specific job: https://www.drupal.org/api-d7/pift_ci_job/[jobid].json

But, there is nowhere men ...

Score: 0
Shawn avatar
Javascript, saving a event state?
cn flag

So I have a table that has about 10 items listed. When I click on a 'TR', in my javascript code, I have it set where it highlights that particular table row green. This is basically a generated grocery list and as you browse through the store, you basically "check off" your items that you have picked up.

However, me and my wife both use this since I put it on a live site and I was wondering, how  ...

Score: 0
How can we build a view of nodes with their redirect source URLs shown in it?
id flag

I want to build a view of nodes with their redirect source URLs along with node titles. However a direct relationship cannot be established as they do not have a common reference.

Score: -1
Amr.Mohammad87 avatar
undefined drupal_add_js function inside themename_preprocess_page
cn flag

I wanted to use javascript to delete an option from the list of options in case the user is not an administrator and I searched and found this code inside a post and I used it inside the project's themes->mythemename->mythemename.theme file, but that didn't work and I have several problems I want to know how to solve, as I searched a lot I did not find a solution

function mythemename_preproce ...
Score: 2
Bradley avatar
How can I get IntelliSense/Intelephense to look inside a Drupal Docker Container?
kr flag

I am developing a Drupal site using the latest official Drupal/PHP/Apache Docker image.

I have some local directories mapped to inside the Drupal container as expected (modules, profiles, sites, themes).

When I create a module and try to, for example, extend a Drupal class such as BlockBase, I get an error saying BlockBase is undefined. This is because the Drupal core code is inside of the container ...

Score: -1
How can I make Barrio SASS gulpfile coninue watching for changes
eg flag

When running gulp. It runs and compiles SASS one time. How can I adjust the watch so that it continues watching for changes. Do I need to add usePolling: true or usegulp.series. I am following the directions exactly from the Bootstrap 4 SASS - Barrio Starter Kit

My setup: drupal core 9.1.10 bootstrap_barrio 8.x-4.33 bootstrap_sass 8.x-1.13 node v12.22.1 npm 6.14.12 gulp CLI version: 2.3.0 gulp Local vers ...

Score: 0
invalid token: [node:title] when Token module installed
om flag

I'm on Drupal 7.80 and a Drupal newb so help with how to debug as well as things to try appreciated.

Taking over a Drupal install that might have some outstanding issues.

Problem: It looks like 'core' tokens are not available. E.g. [node:title], [current-page:pager], and [site:name] are all unavailable

Detail: When trying to save/preview a custom content type called 'Event' I get a lot of token e ...

Score: 1
Ability to show source url in Content view for nodes who have redirects associated with them
id flag

I have a content view which displays all nodes on the site in a table with fields. Some of the nodes have redirects associated with them, which means that they have a source url associated with them. I need to display the source url along with the other data in the original view table if it exists.

I planned to use view_hook_query_alter to join to the redirect table but it seems that there are n ...

Score: 0
Alexey Uvarov avatar
Drupal 7 taxonomy term fields not handling content filters
au flag

Image Resize Filter doesn't work with taxonomy term description. Resizing works fine in nodes and blocks, but not in views for taxonomy term.

I'm loading term in my view template. And render its description(also tried custom) field.

$term = taxonomy_term_load($term_id);
print render($term->description);

I've tried to render with field_get_items and field_view_field.

Then i've figured out that html ...

Score: 2
How do I know which services.yml is active?
cn flag

If I have multiple services.yml in the sites/default/ directory, how can I determine which one Drupal is actually loading?

Is there a drush command to check this? Or is there some other way to verify which services file is being used by a site?

Score: 0
Automatically have an email sent to page author 11 months after its published date
cn flag

Hello I was wondering if anybody could help.

I'm using Drupal 8 and for every page that exists I need a custom email to automatically get sent to the page author 11 months after that page was published. It's just to act as a reminder to the author that their page is still published incase they have forgot.

I can't find any info online that outlines exactly what i'm trying to achieve however anything ...

Score: 0
manoj kumar Srivastaw avatar
How can I add a dynamic redirect on a 404 hit?
cn flag

I Created a site and URL that returns a 404 Not Found status on www.xyz.com This creates a loss of link equity to the domain and negatively impacts the ability to compete in organic search results.

I wanted to Redirect the URLs returning a 404 status to the defined closest alternative, or parent category, to reclaim link equity from external domains.

Example: Suppose I am using URL http://www.mysite.c ...

Score: -2
Ruzanna Hovasapyan avatar
Diff module shows 'No visible changes' for 'Geolocation' and 'International phone' fields
cn flag

I have "No visible changes" message for 'Geolocation' and 'International phone' fields change and have only one option "Don't compare" in Diff field configuration page /admin/config/content/diff/fields.

Can you help me fix this issue?

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.