All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How to prevent numbering (_0, _1) of file uploads? [duplicate]

Is there a way in Drupal 7 to prevent numbering (_0, _1) of file uploads with the same name? How to tell Drupal to replace the previous file? Maybe there is already a ready-made module? Or does anyone ...
-2 votes
1 answer
52 views

drush puts my website in a subdirectory named 'web' [closed]

I use shared web hosting with Cpanel, LAMP and Composer. I have installed Drupal with Drush on a registered web domain (example.com). My website is accessible via example.com/web/ but I would expect ...
  • 11
0 votes
1 answer
65 views

Changing the weight of my custom module does not affect the order of execution of my hook implementation

I use the goalgorilla/open_social profile which brings in open social with its various modules. Inside its social_user.module there is a standard hook_form_FORM_ID_alter implementation which I ...
  • 1,907
3 votes
1 answer
376 views

How do I properly cache a menu item that varies by user?

We are attempting to show a users first name on a profile menu for authenticated users. We added a lazy builder to the hook_preprocess_page hook in our theme given this is highly dynamic content on ...
-2 votes
0 answers
14 views

There is no filtering for states in the view

I am using Webform Workflows Element module i created a process and i need to filter these states but they are not in filter criteria I connected the necessary module for integration with views and ...
0 votes
0 answers
12 views

Call a service at the end purchasing process in shipping method

I'm doing a logistics module. This module has a service that sends the order data to the delivery company. I'm trying to create a shipping method, but I can't find a way to call this service when the ...
  • 1
0 votes
1 answer
18 views

Rewrite url facet by taxonomy term machine name

I have a multi-facet search page, with those 2 facets : poste and type_de_contrat (= internship, open-ended contract...) It's working fine, but I'd like to rewrite the url, because it looks like this :...
  • 57
1 vote
0 answers
22 views

Which hook is invoked after an endpoint creates a node?

I am using Services 7.3x with Drupal 7. I have setup an endpoint that creates nodes. After a node is created by the endpoint, I would like to retrieve some data from the new node and update a third-...
0 votes
1 answer
40 views

Extracting content from a broken site database

I am working on a broken Drupal site which doesn't load. Is it possible to extract the node data from the database and import them into a fresh Drupal installation?
0 votes
0 answers
15 views

When using only drush for a migration - how is 'source files' / legacy-root defined?

I am using Drush 10.4 with the migrate and the migrate drupal modules to do an upgrade from Drupal 7 to 9. But how do I define the source files? With the migrate upgrade module this can be defined ...
  • 31
0 votes
0 answers
14 views

Adding a custom value for Webform email

Using Drupal 9 and webforms module. I have a webform with a hidden field. The hidden field has an array of NIDs being set through cookies. On form submit, the form email has to include all the ...
  • 35
-1 votes
1 answer
47 views

How do I implement an AJAX callback?

Given is a Drupal 9 project. How can I make use of Drupal functionality through an AJAX call? web/modules/custom/mymodule/src/Appointment.php namespace Drupal\mymodule; class Appointment { public ...
-2 votes
1 answer
54 views

How to pass and receive an http request body in GET?

I have two Drupal sites within one project. I want to send a GET request but I need to pass a lot of parameters. So instead of passing them in the query (which will lead to an extremely long URL), I ...
  • 41
0 votes
1 answer
22 views

TFA Module not providing place to enter code, email is sent

I am having trouble getting TFA working on a new site -- Drupal 9.4. My key's in place, I have email enabled, as well as trusted browser, etc. But when I go to login, after I enter the username and ...
  • 169
0 votes
0 answers
15 views

Custom Composite formatTextItemValue

I created a Custom Composite, but I have some display difficulties. <?php namespace Drupal\dvc_composite\Element; use Drupal\Core\Form\FormStateInterface; use Drupal\webform\Element\...
0 votes
0 answers
16 views

Migrate filter_format with embedded_data plugin

I'm trying to migrate filter_format from d6 to d9, I'm using embedded_data 'cause migrate_drupal doesn't work with D6; so I'm trying to do it in another way. This is my yml file. id: ...
0 votes
0 answers
37 views

Captcha point doesn't work

Captcha works on the login form and webform, but I have a JavaScript error on the registration and the password reset forms. The registration form doesn't work. The resource from https://www.google....
0 votes
0 answers
13 views

Why did twig suggestions disappear when i reference bootstrap layouts

All twig suggestions disappeared when I added the "bs-2col-bricked--node-pbr-home.html.twig" file to my custom templates directory and the template is not benig referenced. What have I done ...
1 vote
1 answer
44 views

Theming embeded entities

I'm using the entity_embed contrib module (8.x-1.2) in drupal 9.4. I embedding entities inside a node body in ckeditor. The function mytheme_theme_suggestions_block_alter() is not called for block ...
  • 154
-1 votes
1 answer
33 views

How can I avoid fields being disabled on AJAX requests (attribute disabled) in Drupal?

I want to make an input not be disabled when I submit an ajax request. I tried reversed variants in these answers, i.e. hanging an "AjaxStart" on the document. $(document).ajaxStart(function(...
  • 267
1 vote
2 answers
70 views

Can't load form from my Install Profile

I have a WelcomeForm inside my src folder in my install profile. My install profile is located inside web/profiles folder and is correctly selected by default during install. However, I added an ...
  • 105
1 vote
0 answers
27 views

What causes commerce order numbers to skip a number?

On a Drupal 9 / Commerce 2 site, order numbers (not ID's) are incremental for completed orders. I've got a site though where - very rarely - an order number is skipped: 55, 56, 57, 59, 60, 61, ... Is ...
0 votes
1 answer
52 views

Custom display_extender not able to use custom ajax callbacks inside options form

i´m working on a custom display extender for Views. The display extender itself works as expected, i´ve taken the code mostly from Studiogd The display extender plugin now i needed in the options form ...
1 vote
1 answer
42 views

How to set up news page view so that news/topic shows news pieces with topic (which is an entity reference field)?

I have a news page set up as a page display, showing nodes of a specific Content Type. /news works as expected. I now want to improve the view: When someone goes to /news/pancreas or /news/heart, for ...
0 votes
0 answers
25 views

How can I programmatically access the multistep form IDs?

I have created a multistep form which has 2 forms: company_details and contact_details. function webform_form_alter(&$form, FormStateInterface &$form_state, $form_id) { if ($form_id == '...
-3 votes
1 answer
33 views

multisite not working: one site correctly redirected, the other one throwing 500 error

Using Ubuntu 16.04.7 LTS and Drupal 7. Installed Drupal on /var/www/html/drupal Created folders /var/www/html/drupal/sites/siteone.org.es /var/www/html/drupal/sites/sitetwo.com Added settings.php ...
  • 1
0 votes
0 answers
16 views

How can I make a theme region expand height to fit content of several blocks, pushing all following region content down?

After a long hiatus from Drupal work, I now need to meet a request to modify a Drupal 7 site. In the existing theme I need one more full-width theme region than what's available. (At one point I had ...
  • 225
0 votes
1 answer
15 views

How do I import local po files?

There is no /admin/config/regional/translate/import page in Drupal 9 now, which exists in Drupal 7. So I don't know how to import manually translated PO files.
0 votes
0 answers
47 views

How to alter form after doBuildForm call during AJAX response

I'm altering a form defined by a contrib module. Recently, that module switched to AJAX and my form alter isn't applied during the AJAX response. I believe the problem is in the following code used by ...
0 votes
1 answer
24 views

Provide condtional 403 response when a user tries to view a node

Use case: I have two roles: "Teacher" and "Student". Each Teacher has been assigned a set of Students. This relationship is tracked by a custom entity: "Students by teacher&...
  • 14.9k
0 votes
1 answer
26 views

Custom HTML for a form widget

How can I change a node edit form so that boolean fields use a toggle switch instead of a checkbox? Currently they look like this and I would like to update them to be more intuitive like this (https:...
  • 31
-3 votes
1 answer
62 views

Access denied in Drush but granted in GUI [closed]

I am trying to install Drupal on a CentOS based shared server environment (namecheap.com) with mysql, ssh and Composer. I have created a database username and a database with the same name and a ...
  • 11
0 votes
1 answer
74 views

How do I divide two numbers?

I seem to be doing something wrong. I am trying to divide the price by 1.2 in commerce-invoice.html.twig. With {{ invoice_item.getTotalPrice|commerce_price_format / 1.2}}, when invoice_item....
-4 votes
1 answer
38 views

How to create settings.php?

I have installed Drupal with Drush this way cd WEB_APPLICATION_ROOT composer create-project drupal/recommended-project WEB_APPLICATION_DIR_NAME cd WEB_APPLICATION_DIR_NAME composer require drush/drush ...
  • 11
0 votes
1 answer
17 views

How to use the user profile photo as the default image in a content type image field?

I would like to pull the current user profile photo in a content type image field but the default image option only allows the admin to choose an image file. Is there a module that allows the admin to ...
  • 847
0 votes
1 answer
47 views

How to access a property in twig that begins with a hash

I'm trying to get to the name of a media file in twig. The name is located at: mediaitem[0]->#values[name][x-default] in the rendered entity passed into the template with field_media_item|...
0 votes
0 answers
14 views

Adding markup to field during programmatic creation of node [duplicate]

I'm programmatically creating nodes but I've noticed when I add formatted text to its body field it's escaping all the html. I'm supplying the field with a markup object but it still just treats it ...
  • 5,180
0 votes
0 answers
25 views

How to get S3 file path from URI?

So inside my hook function I have URI of some file and I need to find it's S3 path (using s3fs module). How can I do that, to avoid manual string manipulation? Is there some helper function? I found ...
  • 405
-2 votes
0 answers
15 views

Phone number validation after a change in the dialing plan

What should I change to allow the international phone number field to accept more digits? As an example, the Côte d'Ivoire dialing plan has changed in 2021 from 8 digits to 10. But yet, Webform still ...
0 votes
0 answers
20 views

Remove N/A option in radio button

I made a field in text list format with radio button widget and I want to remove the N/A option, but my field must be not required. I tried this code without success. function ...
  • 1
0 votes
1 answer
49 views

How can I fix the "Predis\Client not found" error?

I have a project based on Drupal 7. I installed PHP 7.4, Redis, and php-redis on Ubuntu. I get a Class 'Predis\Client' not found error. The values in the setting.php file for the module are the ...
0 votes
1 answer
30 views

How to theme a pager with twig?

I've added a pager to a custom page rendered programmatically from a controller. I want to customize the pager. How can I do it without overriding the standard pager twig? This is the hook_theme: ...
0 votes
1 answer
26 views

How do I include a taxonomy term in exposed combine fields filter?

I am building a view with an exposed combine fields filter that needs to include a taxonomy vocabulary. I have completed the below steps but the filter does not return any results when a taxonomy term ...
0 votes
0 answers
18 views

Is there a way to nest links with the link field?

Working on a project where a sub menu uses the link field. Now they want a dropdown, but my drupal experience is extremely limited and google doesn't give me anything. I know you can with actual menus,...
  • 1
0 votes
1 answer
13 views

Distinct selection of a field in views

I created a view in the views module which displays the blogs posted on my site having ONE tag. (Each blog has only 1 tag) Is it possible to do a 'distinct' argument to only display every tag in this ...
1 vote
0 answers
26 views

How do I setup a distribution that contains additional install profiles?

Sorry for the fairly long explanation - but its the only way to explain my requirements fully. I have a Drupal distribution called "Business" and I packaged it as an installation profile and ...
  • 105
0 votes
1 answer
55 views

How do I get a node by its ID?

The only way I found yet is to use {{ drupal_entity('node', '123', 'body') }} in a template file. That always gives me the node body and title (even when I pass 'title' as last parameter). Is there a ...
  • 193
2 votes
1 answer
28 views

Show webform textfield conditionally based on "radio other"

I have a webform "radio other", with options like "1, 2, 3, more". For "more", "radio other" is configured to add a textfield for custom values. Now the problem ...
  • 27.5k
1 vote
0 answers
30 views

Create a link to a cart to be used in emails

I would like to be able to create a link to an anonymous users cart, and send this to the user in an email. When the user clicks this link, he should be taken to his cart. (As part of an "...
0 votes
1 answer
48 views

Error migrating files from CSV

I'm trying to migrate a csv file that I build from a drupal 6 site. I have create a view to export those fields: "fid","filemime","filename","image_path","...

15 30 50 per page