All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
764 views

REST call using curl taking to much time. Show as progress bar

I'm getting information from a source using REST. Bellow is part of my code. Basically, there's a part where I have a for loop that can take 30 to 60 seconds to complete. It works but the user doesn't ...
2
votes
0answers
29 views

Non-blocking HTTP request with Guzzle

Is there a Drupal 8 way to do non-blocking HTTP client request using Guzzle? I don't need to wait for the answer of The HTTP post, as that is slowing down the site. I already seen Non-blocking ...
2
votes
1answer
876 views

Non-blocking asynchronous HTTP requests

I need to send asynchronous and non-blocking POST HTTP requests from a Drupal service. Using Drupal 7, I used HTTP Parallel Request which worked fine. But this module is not available on Drupal 8. ...
2
votes
1answer
680 views

Theme template.php functions after bootstrap

I'm trying to print a drupal menu outside drupal. In order to achieve this I ran the bootstrap as follows: drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); And I render my menu as follows: public static ...
2
votes
1answer
592 views

How do I programmatically set the preferred language for a user?

I would like to update the preferred_langcode of a user as soon as he changes the language in a language switcher block. I'm already aware of the getPreferredLangcode method mentioned in https://api....
4
votes
1answer
1k views

How to make a calendar tab for every user showing user's events?

I followed the tutorial Calendars for Organic Groups - A simple tutorial for D6, and successfully created a calendar for every group in my site showing its events. I also managed to show the calendar ...
1
vote
2answers
26 views

Is it possible to combine two filter criteria exposed filter into one dropdown

Is it possible to combine two filter criteria exposed filter into one dropdown. In drupal 8 I am creating a view to search certain content type. One of the content type has three select list field, I ...
2
votes
1answer
340 views

Create an Action on 'node_insert' or 'node_presave'

I created a new action on a new node being created, it shows up in my triggers and the action gets triggered. Works so far. Problem is trying to add additional functionality using some submitted field ...
0
votes
0answers
13 views

Jsonapi cross bundles module usage

I'm setting up a Drupal API, using jsonapi. In the frontend application, we would like to get all content, regardless of content type, with one request. I came across this issue that adresses exactly ...
-1
votes
0answers
19 views

Creating a content type/reference entity to store product feature comparison data

I want to be able to manage the data in the table above using Drupal 8 content types/reference entities. I am not sure how to explain this in words. Please have a look at the image attached. At first ...
2
votes
2answers
833 views

How to group and merge results together in Views?

I have Views setup to list only nodes of a certain type and group them by a field. It looks somewhat like this: Group 1: Title A Title B Group 2: Title C Now I want to merge the Titles togehter so ...
1
vote
1answer
12 views

What is hook_field_default_fields()?

I'm looking through a Drupal 7 module code in an attempt to understand what it does. It implements hook_field_default_fields(), but I can't find any documentation on this. What does this hook do? I ...
2
votes
1answer
1k views

How to resolve Catchable fatal error in entity.inc?

Locally (WAMP) I have created a new GIT branch to install Drupal Commerce on my site. Everything went well and I have begun configuring my new shop. But when I decided to pull this branch into my ...
0
votes
1answer
527 views

Error Passing Extra Parameter to Custom Form

I have a simple custom form that works until I try to add a custom parameter for my module called "forms_admin". These are the contents of my forms_admin.routing.yml forms_admin.settings: path: '...
0
votes
0answers
18 views

How to retrieve anonymous session data after user login [closed]

Having issues retrieving anonymous session data after user login. I've tried using Tempstore and native $_Session[] but no success. Anonymous data get stored okay, but they're emptied after user login....
0
votes
1answer
34 views

How do I translate Field Group labels?

I have two field sets In the admin/config/regional/translate I have translated the "Account settings" label But in the Form display I still have the english label: What can I do to ...
0
votes
2answers
824 views

Pre-populate an Entity Reference when Adding a Node : Based on URL Alias

I am trying to pre-populate an entity reference with a specific game node, when a profile node is added; based on URL of the game the add button is on. The game node I want to reference in profile ...
1
vote
2answers
2k views

How do I update a user profile with entity_metadata_wrapper()?

I got an error while updating user profile data such as name,password and email. I am using entity_metadata_wrapper() for processing update. exception 'EntityMetadataWrapperException' with message '...
0
votes
1answer
735 views

How does decode_entities() work?

Let's say $node->field_description[LANGUAGE_NONE][0]['value'] contains 'We're in this together'. This code doesn't output what I expect. $node = menu_get_object(); if (isset($node->...
3
votes
2answers
857 views

How to use the gallery formatter settings in a display suite code field?

I am using the gallery formatter module to format photo galleries. To satisfy a requirement I need to create a Display Suite code field that displays the list of pictures attached to a related node (...
0
votes
1answer
25 views

Recurring Framework crashes with Datarans

I'm using Commerce Recurring Framework latest version (8.x-1.0-beta5) with Commerce Datatrans (also latest version, 8.x-1.0-beta1). When first payment happens (customer gets redirected to Datatrans, ...
0
votes
3answers
3k views

How to modify the search index?

There's a search index for the Apache Solr module. However, I don't see any way to change this index. It seems that various fields and items are added to the index without rhyme or reason. If I ...
0
votes
1answer
25 views

How do I limit access to a custom field type I have created so that it can only be attached to certain bundles of content?

I have a custom field class. I would like to limit it to specific content types and bundles that I will choose when my custom module is installed and as other content types meet certain criteria. I ...
-1
votes
0answers
62 views

No charts (or graphics of any kind) on Commerce reports dashboard page? [closed]

I'm currently on Drupal 8.9.1 and using Drupal commerce 8.x-2.20 I've installed Commerce reports module latest version 8.x-1.0-beta1: https://www.drupal.org/project/commerce_reports and with it Charts ...
0
votes
1answer
782 views

Views webform filter based on the current node field value

I have a Webform where it's used to get product comments. This webform is exposed in a node page and has a field that is populated automatically with a value from the current node, lets say "...
1
vote
1answer
20 views

Using hook_preprocess_views_view_unformatted properly

I have the following hook in mymodule.module function mymodule_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; $rows = $variables['rows']; if (in_array($view-&...
3
votes
2answers
619 views

Problem with image width in views/ block

I have a problem to set image dimension on various position. I want a 300x100px in top, 100x75px for thumbnail and other dimensions on other place. In WordPress I can just add "width" attribute to set ...
0
votes
1answer
797 views

can I generate a user login form twig file

So I want to create a separate user login page for my website. I create a twig file called page--user--login.html.twig which is great for the outer container. I still want to edit the form divand or ...
0
votes
1answer
626 views

Need to center images in wyswyg block

I am trying to center 3 images in a block I have created in my footer but the images just won't center. I tried the wysiwyg editor's center button, but that did not work. I then tried to put in manual ...
0
votes
2answers
274 views

AJAX SettingsCommand Usage

Class Documentation: SettingsCommand I'm trying to figure out how to use this Ajax Command correctly. I must be confused from the documentation, so I'm hoping someone can shed some light where I'm ...
0
votes
1answer
339 views

How to show number of a views return results without submitting the view?

I have a view with some exposed filters.When selecting first exposed filter,I want to appear the Number of the view results without having submitting the view.Same thing for second exposed filter etc. ...
0
votes
0answers
17 views

Override fieldset.html.twig

I am having some trouble understanding the concept of overriding twig templates. I have turned on debugging mode and most of the time I see overriding suggested file names like this: <!-- FILE NAME ...
0
votes
0answers
18 views

Center concatenated fields in theme table

In the attached image I have two similar tables. The first one was created using views, the second one is the table I'm creating with my own module. My question is: How can I center the information in ...
0
votes
1answer
339 views

Drupal multisite and alias suffix

I am actualy working on drupal multisite environment and I am stuck within a alias suffix problem. I made a setup like this in my sites.php file for the multisite alias names. $sites['example....
1
vote
1answer
884 views

Rate module and rule integration

I don't fully understand how the rate module integrates with rules. Here's my situation: 1) I created a widget of the type: Number up / down widget which allow users to vote in nodes of the Answer ...
0
votes
1answer
338 views

Keep file download list of each authenticated users

I have a content type "Application" and each "Application" content has a downloadable file. I'd like to keep the downloaded file list, actually node list, & count for each authenticated users. ...
0
votes
1answer
25 views

It doesn't work without public_html symlink

I have just updated to Ubuntu 20.04 so have a fresh install of everything. I have a working Drupal 7 site I'll call mysite. I have Drush-launcher installed globally at /usr/local/bin/drush The file ...
0
votes
2answers
865 views

How to alter image style based on product custom attribute?

I'm building a webshop based on Ubercart, and products have a custom attribute "sold out". When this attribute is checked, all product images should be displayed with a semitransparent overlay textbox:...
23
votes
5answers
28k views

How do I add a meta tag in inside the <head> tag?

How can I add the following meta tag inside the <head> tag? <meta http-equiv="X-UA-Compatible" content="IE=edge" /> I am trying to add it to a Drupal 8 site.
0
votes
1answer
23 views

Custom autocomplete widget for custom field [closed]

I have a custom field type and I'd like to create an autocomplete widget for it. My custom field has two data definitions - target_id and target_bundle, both strings. I've created a custom widget ...
-1
votes
0answers
22 views

Create a custom field type with a checkbox and a taxonomy term [closed]

I need to create a custom field type consisting of a taxonomy terms, a checkbox and lastly an optional text input. Now the optional text input part is not a problem. I have been experimenting with ...
2
votes
1answer
349 views

Why is the --uri option needed to return absolute URLs?

I want to execute a View and export the JSON file to the files directory. I am using Views Data Export and VDE drush add-on modules. My view has a file/PDF field and I want to provide a direct link to ...
1
vote
1answer
674 views

Content type disappears in content list

I created a taxonomy with the same name as a content type. Now the list shows with no content type on the nodes with that type. I have since renamed the taxonomy, but there is still an issue. When ...
1
vote
1answer
322 views

`Drupal\DrupalExtension` extension file or class could not be located

I got this error upon launching behat tests: [Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException] Drupal\DrupalExtension extension file or class could not be located. ...
-3
votes
2answers
107 views

How can I style the Gutenberg module editor? [closed]

I'm trying to modify the CSS in the Gutenberg module to change the editor layout. Gutenberg uses SASS files to generate the CSS. I tried editing the CSS files directly, which I recognize I shouldn't ...
1
vote
1answer
1k views

How to access an entity loaded out of the cache

I am working on a Drupal 8 modules which should push a http response header based on a value stored in an entity or a list of entities. The module was originally done for D7 and now is in porting up ...
0
votes
1answer
349 views

How to disable browser autocomplete for the login form

I would like to remove auto fill user name and password while login or forgot password. I have tried this but its not working: if ($form_id == 'user-login-form') { $form['name']['#attributes']['...
1
vote
1answer
2k views

How to create dependent exposed filters in a view

I have three drop-down boxes just like ex: 1. class list (ClassI, ClassII...) 2. subject list (Hindi, English...) 3. chapter list (H-ChapterI, H-ChapterII, E-ChapterI, E-ChapterII...) When a user ...
9
votes
6answers
9k views

Prevent Multiple Form Submissions (Server side)

I'm running into a problem where a user can submit any form built by the Form API multiple times (fast clicking resulting in multiple requests). I've put in the basic client side (javascript) ...
-2
votes
1answer
10 views

Get exposed filter value in views with block as display handler and add it in the footer [closed]

How could I get the value from the exposed filter and add it in the footer markup text?

15 30 50 per page
1
3 4
5
6 7
1667