All Questions

Filter by
Sorted by
Tagged with
3
votes
1answer
41 views

Is it possible to override/replace an event subscriber

I would like to replace an event subscriber. Is there any way that I can write my class implementing EventSubscriberInterface which would replace another existing event subscriber instead of being ...
2
votes
0answers
44 views

Why path prefix is always leading to en instead of User's preferred language?

I am working a multi-lingual website which has 9 languages enabled. But the issue I am facing is irrespective of user's preferred language, site will be always prefixed with en. The required behaviour ...
3
votes
3answers
89 views

How to determine if loading a form or submitting a form in hook_form_alter?

I am trying to put a simple message at the top of a node edit form when a user is creating a new node. I added a \Drupal::messenger()->addMessage() inside a my form_alter hook but this prints when ...
0
votes
1answer
26 views

Template preview not working properly

I've got a huge problem with my template preview. For all of my post (page, article and so on), I have not the good region in my page. My theme is extended Classy. If I go to see the page (not ...
0
votes
1answer
34 views

Double values (products) in Commerce cart form

I use Drupal Commerce version 8.x-2.15. I have a multilingual Drupal site with multiple languages based on domain. mystic.com -> EN language mystic.eu -> NL language etc I added relationships: (...
2
votes
1answer
52 views

How to delete all revisions of given content type except the current revision?

I am having a very large website which have around 400000 nodes of story content type. And these nodes have around 2000000 revisions. How can I delete all the revisions except the current revision so ...
1
vote
1answer
47 views

How to redirect the user to an external website with POST data?

I want to implement an offsite payment method and everything is going well except the fact that I can't find how to redirect the user to the offsite payment gateway after submitting the cart checkout ...
1
vote
2answers
47 views

How can I programmatically add a field to a field group?

I have tried this code but it is not working. $form['field_test'] = [ '#title' => t('test'), '#type' => 'radios', '#options' => [t('A'), t('B'), t('C')], ]; $form['#group_children']['...
0
votes
0answers
24 views

File migration with local path

I would like to create a file migration (example) that uses a local path to an image that I store inside a folder. If I try to enter the path to the image I get 'not a valid URL'.
0
votes
1answer
25 views

Print title in commerce-product.html.twig

I try to create a custom product template commerce-product.html.twig. The changes work well except except the title. https://docs.drupalcommerce.org/commerce2/developer-guide/products/displaying-...
0
votes
3answers
80 views

Database deadlock detected

On Drupal 8 we're getting a few deadlock conditions - most connected with the cache. There are quite a few answers to this issue but not so much for D8 (which has very different caching mechanism). Is ...
1
vote
1answer
26 views

How can I return a JSON response from an internal function ? (not the main callback)

I have a callback that is running for a specific post request. I am returning a certain JSON response at the end of it. What if I want to catch errors inside one of the functions that are ran in that ...
0
votes
1answer
27 views

How can I translate the field group description?

I have created two field groups on the manage form display tab for a content type. I have added some description also. On the interface translation, I can translate the field group labels but there I ...
-6
votes
0answers
20 views

PHP Unit testing [closed]

I have migrated from XAMPP to Bluehost and whilst the site is working the PHP Unit dependency is reported as missing though I know the files are on the server. I have changed the php version to match ...
-6
votes
0answers
34 views

Cannot create content with a title of author's name and the current date (eg. userA 25 Nov 19) [closed]

I have issues regarding Rules D8. When a user is created, cannot create a content with a title of the node author's name and the current date (eg. userA 25 Nov 19). Problems at data selector / token ...
-2
votes
0answers
45 views

Problem setting up simple content moderation

I am trying to set up a very simple moderation workflow in D8 and am completely stuck. Authenticated users should be able to see their own unpublished content but not other people's unpublished ...
-2
votes
0answers
19 views

Add Bearer token header on remote post webform [closed]

I am trying to send webform submission data from drupal website to the some spring microservice. But I don't know how to implement Bearer token on remote post of webform/Drupal/. I developed custom ...
-3
votes
0answers
18 views

Update computed field with Rules

i have a Computed field on Node1 and I need to update it after updating another field on Node2. I am looking a way to do this with Drupal 7 and Rules, but so far nothing. Can't find an action to this....
-3
votes
0answers
20 views

Drupal Commerce 2 / Restui

I use a module restui to get same data like order from drupal commerce 2 via code react js axios({ method: "post", url: `${root_domain}/user/login?_format=json`, data: { name: "...
0
votes
1answer
34 views

How do you get the url of an image in a view twig template?

I want to check the fields.field_image.content to see if it is empty or not. I want the view to display differently if there is no image in the page field_image field. I was thinking I could just ...
2
votes
1answer
26 views

How do I render a submit button so that it's disabled initially and enabled by JavaScript?

We have a form that includes a React JS frontend component. The component collects some required information, which the React component then supplies to the backend by populating a hidden form field. ...
1
vote
1answer
41 views

How to create a user with custom fields?

On my drupal site, using the User module, I have added extra fields to the user registration form such as 'Organization'. I notice that this has created a mysql database called '...
0
votes
1answer
15 views

Show metatags on node add/edit pages on custom theme

I have a user role which can add/edit metatags (Metatag module) and when I allow overlay and admin theme access for that user role - everything is OK. But if they are editing/adding node from my ...
0
votes
0answers
10 views

Set block content from panels / page manager?

I am configuring a panels page manager page which also should have a specific sidebar block (search filters related to the page content). I want to use the regular page.tpl.php where the sidebar is a ...
0
votes
1answer
40 views

How can I display the time passed since a comment was created instead of the creation date?

how to personalize my comments ? I want to display since when the comment was created instead of the date. I want to display the comment ID with the link "permalink". Can you help me ? Thank you ...
1
vote
1answer
29 views

Using group and rules modules to automatically create group for new user

I am using the Group (not OG ...) and rules modules for this task. I created group type, Applications Support. Then I created a rule, After saving a new user. Under the rule, I used the following ...
0
votes
1answer
21 views

Randomly display questions in Webform - to use as an exam

Is it possible to randomly select a fixed number of questions to display in a Webform? I have a request to set up over 500 questions in a webform but for each user who visits the webform, only a ...
-3
votes
1answer
30 views

Drupal queue item not being processed [closed]

I am creating queue items from a cronjob. But it seems they are not getting processed. Any ideas why? Do we need to process the items separately? I mean i have created the worker class and everything....
0
votes
0answers
32 views

There was a problem creating field: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value

I've recently downloaded a Drupal website to work on a local host (xampp). After importing the database, changing the base_url and running the update.php script, I managed to make it work. However, ...
0
votes
1answer
24 views

Display text in an empty field group tab using custom code

I have created a field group with an empty tab. I would like to use custom code in a module to display something in this empty tab - it will just be a render array. Can someone show me how this can ...
1
vote
0answers
26 views

Where do you set node revision permissions?

I’m using Drupal 7. I created a Content Type called ItemRequests. One of the fields is a Body field. As my authenticated users keep editing this Body field at different times, I want them to be able ...
0
votes
1answer
24 views

How to update cart after deleting line items?

I have an Application (app) node that when it gets created (hook_node_insert) I add line items (based on info in the app) to my cart. This works great. Step 2 now is that when I add a new app, I ...
0
votes
1answer
33 views

Create a draggable table and save weights

I'm struggling a bit with creating a draggable table. I want to have a table that lists node labels, where it's possible to rearrange the order of the nodes. The new weights shall be available when I ...
0
votes
0answers
24 views

Server to Local Admin Problem [closed]

I have just moved my site from Bluehost to local XAMPP, the database is connected with all content showing and theme working. However when I move to the Admin Panel(Configuration etc) all the styling ...
1
vote
1answer
33 views

Limit multiple fields node add form

How can I (either with a module or programmatically) limit the number of values for multiple fields? For example, the user can add only a single value for field A OR field B OR field C. The total ...
-2
votes
0answers
24 views

Show view as menu item [closed]

I want to build a list of links with Views. And then show this list of links as submenu in the Main Navigation. This used to be possible by using the Menu Views in Drupal 7. What method should I use ...
2
votes
1answer
39 views

How to Restrict views Date popup to only year/month

I want to have views exposed filter on node created field with popup. I've installed date_popup, the popup appears but I'm looking for a way to restrict it to only year and month. I tried the ...
0
votes
0answers
19 views

How do I add the View field to another View?

I'm trying to add a field for Revision Author to /admin/content following the instructions located here: How do I display the last person that edited content instead of the original author? When it ...
-1
votes
1answer
28 views

Multi-Vendor Marketplace functionality is not completed in Drupal 8 commerce

I was at the edge of launching a Multi-Vendor Marketplace with Opencart which is quiet as easy as installing an extension and I am ready to go ! However, I am better in Drupal Development and I like ...
-6
votes
1answer
40 views

Different front page for logged in users [closed]

I want to show different front pages for different roles: Anonymous users should see www.domain.com\front, logged-in users should see www.domain.com\dashboard. There are two options I found so far: ...
1
vote
1answer
33 views

I don't find something similar to drush field-create in Drush 9

I'm looking for a similar command drush field-create with Drush 9, I only find drush generate field but when I execut it I don't get nothing, also if I try drush generate field --help I get: Too ...
2
votes
2answers
60 views

Automatically creating an organic group for each new user

I would like to automatically create an organic group for each newly registered user. I checked all its settings, no such option with organic groups module, then I checked the rules module but no luck ...
0
votes
1answer
74 views

AJAX form submit error when sending form to twig in hook_preprocess_page

I have a simple AJAX form that I can't submit when the form is passed from module to the template in hook_preprocess_page. The same form works fine if sent from controller, it's just that the layout ...
0
votes
0answers
47 views

Handle nested Exceptions in delete hook & Ignore DrupalKernel Exception handler

I have functionality that checks if entities can be deleted or not. These entities are vast and most of them are linked together with EntityReference fields. Now in some cases I want to check if an ...
2
votes
2answers
85 views

Loading taxonomy terms in a tree in Drupal 8

I have multiple level of vocabulary, I want to display all level in the hierarchy same as taxonomy display. My taxonomy is like. All Drinks Alcohol Drinks Beer Vodka ...
2
votes
0answers
22 views

How to display billing information associated with with stored Auth.net payment information?

I am newish to Drupal and have been trying to print out the billing address data from the saved payment method information labels in drupal commerce checkout. The payment processor is Auth.net, using ...
1
vote
1answer
45 views

Preprocess a twig template file

I don't fully understand how preprocessing works I have a twig template /themes/custom/client/templates/content/node--myfile.html.twig that I want to alter I want to show/hide a part of that ...
-1
votes
0answers
50 views

How to figure out cache ID I want to use?

If I use: $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id()); $cid = 'return_products:' . $user->id(); $data_cached = $this->cacheBackend->get($cid); I get cache info ...
0
votes
0answers
34 views

How to test a custom filter on existing view?

I programmatically created a new (custom) filter for the user's view (admin/people). Code for the filter: hook_field_views_data_alter() Plugin > views > filter class The filter works ...
2
votes
1answer
47 views

How to create a select drop down that opens a URL?

I have a select drop down. When the user selects a value from the drop down, the user will then click on a button and based on what the user has selected it will open a url in a new tab. While this is ...

15 30 50 per page