All Questions

0
votes
0answers
8 views

How to remove payment gateway for users with a specific role?

We have a Drupal 8 Commerce 2 site that needs to dynamically remove the payment gateway for users with a specific role that will be 'billed later'. The conditions for the payment gateways all showing ...
0
votes
1answer
23 views

Custom Entity Type and Bundle Creation

I've been building custom entities for a while now, but have been using the entity construction kit (eck) to build them. This has limitations as it requires you to #1 depend on the package for new ...
0
votes
0answers
38 views

Programmatically set a $form_state value for user reference

I'm trying to programmatically create nodes through form submit in Drupal 8 (because I need to validate the submitted values) in this way. try { $node = \Drupal::entityTypeManager() ->...
0
votes
0answers
36 views

Pass parameter to node twig template via url

The url to display node 100 is <site>/node/100. I want to pass a parameter to this node via the url. For example: <site>/node/100/3. Question: What must I do to get Drupal 8 to see /node/...
0
votes
1answer
8 views

VotingApi / Fivestar rating Player per Game

Can not figure how this works, and hope is doable. I'd like to add a feature using the fivestar module but I could not figure it out myself. The work may simply require configuring the module ...
0
votes
2answers
45 views

$form_state->setRedirect not working after a $form_state->setResponse

In the submitForm of a custom form, I have this: $sFileName = 'sites/default/files/_private/bulletins/' . $form_state->getValue('adherent')[1] . ".pdf"; $response = new BinaryFileResponse($...
0
votes
0answers
15 views

How do I add a CAPTCHA inside a pop-up contact form?

Inside a pop-up form, I want add Recaptcha, I install Recaptcha module Drupal 8, $form['captcha'] = ['#type' => 'captcha', '#captcha_type' => 'recaptcha/reCAPTCHA',]; and in my twig ==> {{ ...
0
votes
1answer
28 views

How do I trigger a modal from a template that points to a controller returning an AJAX response

I am trying to trigger a modal from a twig. The path of the modal is a controller that returns an AJAX response as below: Routing code usgbc_myaccount.get_badges_evidence_controller: path: '/account/...
0
votes
1answer
14 views

How to download file from URL manually?

I need to upload on Drupal 8 a file from an URL programmatically without using a form and a field type 'managed_file'. I'm not sure how to do this, I found different web pages on it but it's often ...
-1
votes
0answers
15 views

API Changes to Paragraph Module Stop Appending Paragraphs to Existing Nodes

I know there are posts out there talking about adding a paragraph to a node programmatically but it also appears the API changed and I cannot reconcile the two. I am using the following code. //...
0
votes
1answer
14 views

Twig conditions for node/page/view in page-title.html

I am trying to set different classes in the page-title.html.twig based on what drupal is actually showing. The first condition works in a node template, but not in the page-title.html. This is a ...
-2
votes
0answers
18 views

hook_form_FORM_ID_alter() is not working [closed]

hook_form_alter() works fine but hook_form_FORM_ID_alter() doesn't. I created a hook to alter the action after the submission of a form. The hook gets called when hook_form_alter() is implemented, ...
0
votes
0answers
37 views

Add script to a view [duplicate]

I've downloaded this to my theme folder and added scripts[] = easytree/jquery.easytree.min.js to my theme.info, how do I call it to be invoked on a particular views path? I would like to use the path ...
0
votes
1answer
17 views

Can webform conditionals require filling one of two fields?

The snippet below is one of the ways I attempted to require that the user fill out at least one of phone no. and/or email using webform conditionals. This one came closest to working. The logic is ...
0
votes
0answers
12 views

From within a price resolver, how to get to the selected attributes of the current product?

I am writing a price resolver for drupal commerce 2 (on drupal 8). To get the price i want, i will need to fetch some information from a field that has been placed on the attribute(s) that have been ...
-1
votes
0answers
22 views

Displaying drupal_set_tittle and drupal_set_messages

I have implemented this code on my .module file in netbeans for my drupal website and its not displaying the tittle and the message on my drupal website ,what could be the problem? ?php function ...
0
votes
0answers
30 views

How to customize view exposed filter

I am working with drupal 8.6.10. I am using group module. I have a view that shows Public's Content, and Group's Content for users with group. This view Shows only Public content for user without ...
0
votes
0answers
57 views

Resolve composer update drupal/core 8.6

When i try to run composer update it results to the following problem: Your requirements could not be resolved to an installable set of packages. Problem 1 - don't install drupal/core 8.6.0|...
0
votes
1answer
12 views

How to print author's email address in in node template

I have a content of type summary only visible by the author and administrators. I need to print in my node--summary.tpl.php the author's email address that was set at the account creation. Any idea ...
-2
votes
2answers
34 views

How to get value of array in custom email

I have custom form for emails. In the putput email, I always get the index of the choosen option, not the option string. Given this form element definition, how do I get, for example, Soins Duo ...
0
votes
0answers
9 views

Themes' screenshots not visible after 8.6.1 update

Once I have updated the multisite (using composer), all the screenshots images just stopped showing. If I try to access the image directly (using browser) the message is like that: Forbidden You don'...
-2
votes
0answers
16 views

How do I install Behat on Drupal [closed]

where should I install behat inside drupal folder?
0
votes
0answers
30 views

about view entity reference

I am new to Drupal 8 and I am trying to figure out making a dropdown list with using webform submission. I have two webform contents which are Class and Student. Class stores class and description. ...
0
votes
1answer
17 views

for anonymous user, webform not submitted because of private file

I have one webform which contain the private file field. As admin user: i can upload the file and submit the form. As anonymous user: i can upload the file but while saving the form, i am getting '...
0
votes
1answer
15 views

Views arguments as part of path

Is it possible to create views pages with urls like "prefix-%-postfix" instead of "prefix/%/postfix"?
0
votes
0answers
13 views

Server/client permissions/role

I've installed and configured the Oauth2 server module. I have a client and I'm using the grant type 'client_credentials' to obtain an access token from /oauth2/token endpoint How do I grant roles/...
0
votes
0answers
12 views

How to add a check box in views exposed filter

I need to add a checkbox in an exposed filter to strip left and right space of a value entered by user, i.e: I have email field on the basis of email filtering the user some time user add left or ...
0
votes
0answers
8 views

Use machine name of blocks from parent theme

I have created a drupal 8 subtheme. I have some blocks that have twig template overrides in the parent theme based on custom block machine names. For example mywackynavbar. In the subtheme, I ...
0
votes
0answers
12 views

PDOException: in drupal_lookup_path() (line 176 of [closed]

I have drupal core module installed on my local this url shows 404 fine xxx.com/forum/active/%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%...
0
votes
0answers
22 views

Being able to use subdirectories D8

So I used composer to make a Drupal 8 build, and it starts the site in the web directory under the directory you put for composer. This is no big deal, I thought if I just put phpmyadmin in the /web ...
-1
votes
2answers
35 views

How do I programmatically get the URL of an entity referenced media image field using on a custom_preprocess_html() hook on THEME.theme?

Reason: I need to create an Open graph meta tag og:image and pass the URL as content. On THEME_preprocess_html(), I loaded the node using $node = \Drupal::routeMatch()->getParameter('node'); if (...
0
votes
0answers
11 views

tableselect default checked specific values

foreach ($courses as $user) { $options[$user['uid']] = array( 'coursecode' => $user['coursecode'], 'coursename' => $user['coursename'], ...
0
votes
0answers
5 views

Webform field unknown

I am using a clean install of Drupal 8 with REST API enabled and the webform module install. I have created a basic webform with all the correct permissions and enabled /entity/webform_submission in ...
0
votes
1answer
12 views

Recursion when reading field in hook_entity_load

Is there a preferred approach modifying values? I need to modify a value when a node loads, but must use other values from the node. The code below causes recursion errors. function ...
0
votes
0answers
15 views

hook_form_alter : Not authorized value in a view exposed filter

I am using Drupal 8. I have a view that shows some public content and some group content. I try to add a filter on group name as select list. I would like to have in the select list an option to get ...
0
votes
1answer
13 views

Custom form template

So I am recently started working on front-end development, and have started messing around with making my own custom templates for modules. I have been able to get page related templates to work, but ...
0
votes
1answer
25 views

Module to create a custom field in all the content types

I am building a module to insert a custom field in all bundles of the node. I have encountered many difficulties, any help they can give me, I would appreciate it very much. The custom field I am ...
0
votes
1answer
32 views

Why isn't this Config API Code saving options?

I can see the form, using the Config API, and submit it. However, it doesn't save the changes. Here is my code: <?php namespace Drupal\my_config\Form; use Drupal\Core\Form\ConfigFormBase;...
1
vote
1answer
58 views

What's wrong with a new installation of Drupal 8.6.10? [duplicate]

A fresh install of Drupal results in a WSOD including a very helpful error message which says "The website encountered an unexpected error. Please try again later." I normally install Drupal with the ...
0
votes
0answers
6 views

How to give users access by vocabulary and show the links in admin_toolbar according to the permission?

I have tried to give the user access to vocabulary granularly, currently it is only possible to give access to use vocabularies and terms and I only want certain roles to only manipulate certain ...
1
vote
1answer
53 views

Set a date field equal to “current time” + “5 minutes” using tokens

I am using the Field Timer module to display countdown timer on my article node. Say my article node has the date/time field named (field_article_datetime) This module will take the value of the ...
2
votes
1answer
23 views

How do I clear a specific cache entry?

I saved a cache entry using cache_set(). How can I clear this entry using Drush?
0
votes
0answers
13 views

Creating a drop-down list with checkbox button [closed]

I want to create a drop-down list with checkboxes. I installed the Dropdown Checkboxes and its dependencies, but I am unable to get it. I have a list of users in my drop-down menu and I have to select ...
0
votes
0answers
21 views

How to use cookies in Twig?

I'm trying to create a conditional twig function in a template I created for my website's home page (page--front.html.twig). Twig can supposedly do this out of the box, but I can't get this approach ...
2
votes
1answer
39 views

Does “composer remove drupal/module” actually uninstall the module first?

Does composer remove drupal/module actually uninstall the module first, especially in multi-site environments? On the other hand, does composer require "enable" the given module for all sites?
1
vote
0answers
19 views

Taxonomy term limit | how to bypass [on hold]

Migrating to Drupal 8 - I find a new restriction - in Views filter - Taxonomy term field cannot be more than 128 characters..... In Drupal 7 I never had seen such a restriction, or it was more longer....
0
votes
1answer
12 views

Migrate: Create term(s) if they do not yet exist

Question similar to this question here, but this time, I am not doing a separate migration later. I want to create taxonomy terms if they do not exist while processing a record. Does entity_lookup do ...
2
votes
0answers
27 views

How to create a password field on an entity of which the value can be obtained?

I would like to store a password in Drupal using a BaseFieldDefinition (since that's what the other fields on this entity are using) for use with authenticating via a third-party service, using OAuth ...
0
votes
0answers
37 views

Understand how files in Drupal module are connected? [closed]

I am aware that this is a question that has no direct answer but I am still very new to Drupal development and I really do hope that someone will take some time and give me and idea on how are Drupal ...
1
vote
1answer
26 views

How to show the following n events with respect to the current date or the past events to always ensure n elements in the view?

I have an agenda on my homepage, and I want to always ensure 5 events. If there are 5 or more following events (including the current one), show the nearest 5 from the start date. If there is less, ...

15 30 50 per page