Questions tagged [8]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

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

Commerce custom taxtype wrong calculation

I want to add spanish recharge tax to drupal commerce. It is calculated like VAT but only for some customer in a B2B bussines, and It is a second tax, that is, you have to calculate VAT and "...
4
votes
1answer
58 views

How to add an autocomplete field with pure javascript

I'm implementing the javascript library Annotorious which allow to add annotations on an image. My goal is to be able to link content with part of the image select with Annotorious. When we select a ...
0
votes
0answers
28 views

Clean pagination URLs

I'm currently upgrading my site from Drupal 7 to 8 and I'm having trouble with the pagination URLs. On the Drupal 7 site we use the Clean Pagination module which changes views pagination to be /news/...
0
votes
0answers
18 views

Views agenda page not updating (still cached)

I have a Views page to create an agenda of events. The views has a filter to show only agenda items that are in the future. I created a similar setup for multiple site but on this one the agenda is ...
0
votes
0answers
15 views

Configure Facets to drill down one level at a time

I have vocabulary ("Subtype") hierarchy like this... CP LP ML U BL FL AD MA PD OPD SG I have a field on my entity type field_subtype. What I'd like is to configure my search api ...
0
votes
0answers
66 views

Antibot Failing when Webform Embeded in Gutenberg

When enabling Antibot on a Webform rendered through Guntenberg, I can not submit the form. Create a "Custom Webform" block type with a single entity reference field for Webforms. Create a ...
0
votes
0answers
13 views

Filter view by entity sub-queue?

Is it possible to filter a view by a sub-queue within an entity queue? My current setup is: Entity queue with multiple sub-queues created (I've only created 2 sub-queues at this point.) Setup a view ...
0
votes
0answers
43 views

How to disable an alias path (for an unpublished page)?

As path aliases now seem revisionable (from 8.8.x, see Convert path aliases to full featured entities) what is the best way to set an unpublished page (that was unpublished by a content moderation—as ...
0
votes
0answers
11 views

Does the login-link users receive upon registration actually expire?

I'm trying to expand the duration for the expiration of the one-time-login for the initial registration process: user clicks on "create new account" after filling name and email and sending ...
0
votes
1answer
124 views

How to get parent paragraph from a child block preprocess

Searched all over the place but cannot find anything similar. Here's the issue... The setup: 'Page' content type 'Block Content' paragraph type The 'Page' content type has a field for referencing ...
0
votes
0answers
20 views

Can't get distinct rows from taxonomy view

Drupal 8 has a problem with creating distinct views, and the distinct views module hasn't been ported yet. I've been researching this today, and haven't found a good solution. I wrote a custom hook in ...
0
votes
1answer
9 views

Get all available promotions for specific commerce product

How to get all available promotions, which apply to specific product?
0
votes
0answers
15 views

I can't alter the 'entity.media.route'

I want my drupal user to see the media edit form using the frontend-theme, not the admin-theme. In my RouteSubscriber I use if ($route = $collection->get('entity.media.edit_form')) { $route->...
0
votes
0answers
37 views

Create multiple Menu blocks from the same menu

In Drupal 7, the Blocks page contained a link for 'Add menu block', from where you could create multiple menu blocks of the same menu. In Drupal 8, menu blocks seem to be generated automatically, ...
0
votes
1answer
52 views

What is the correct order of disabling the default contact form on Drupal?

Drupal comes with a default contact form on each site we install. And while we already have the webforms and recaptcha module installed, some of our site owners still use the default contact form ...
0
votes
1answer
25 views

Hide/mask link URL in the web browser

I'm new to Drupal and here is the requirement - There is a page that has a field (Doc link) of type Link. I give the URL of the Doc link field as /sites/default/files/docs/file1.html. Now when I click ...
0
votes
0answers
25 views

Change View Slideshow slide dimensions

I have the Views Slideshow module running a slideshow of 4 items in it and the background image is set to an image style that scales to 695px height (and no width setting). This also happens when I ...
0
votes
0answers
30 views

Add status field to existing entity

I wanted to add the "status" field to an entity that already exists but is not mine, i.e. I cannot edit the php class where this entity is defined. With the following code I add the field in ...
0
votes
0answers
33 views

How to use one of the 2 context filters in a view (with an OR)? [duplicate]

I have a view with 2 relations with the store for 2 different entities. I want to filter the view with the store id for the 2 relationships. I created 2 context filters in the views. You must use the ...
-1
votes
1answer
57 views

Site broken with multiple errors

I am trying to install a Drupal site locally on a new laptop that was working fine on the old one. I get the following errors. Notice: Undefined offset: 2 in Drupal\Core\Database\Database::...
0
votes
1answer
48 views

Import configuration in CI/CD script does not work

I have a Drupal 8.9.13. I wanted to install a new module, for example the google_tag. But in my case I do that in my CI/CD process. So to do that I did the following actions: edit the composer.json ...
3
votes
1answer
43 views

How to determine if {{user_picture}} is not empty in the comment.html.twig template

Trying to determine if {{user_picture}} is not empty in the comment.html.twig template. {{user_picture}} refers to the Compact display mode for a User Entity. The below code doesn't work. {% if ...
3
votes
1answer
110 views

How can i add a property(uuid) to existing custom entity base_table?

I want to add uuid property to existing custom entity extending ContentEntityBase. I've tried to a add the uuid entity key and installed field storage definition by: function ...
0
votes
0answers
17 views

Use patch for .htaccess only on remote site

Following this post I'm working on a way to patch my .htaccess file so my changes don't get overwritten by a drupal update. But my .htaccess files most of the times are in my .gitignore because the ...
1
vote
0answers
40 views

How to render a view in an ajax callback

I am trying to develop a custom module to ajaxify the commerce form block. I tried using dc_ajax_add_cart and ajax_add_to_cart but they were not addapted to my project. I have the following callback ...
0
votes
1answer
47 views

How to get a custom block form in another custom block?

I have a custom block /** * Provides block A. * * @Block( * id = "block A", * admin_label = @Translation("Block A"), * ) */ class Block A extends BlockBase implements ...
0
votes
1answer
16 views

I can't filter the child view based on a value from the parent view

I have read many of the questions asked on this site, but none of them suited my problem. What is the need to make a Users view that shows below its created contents. I have a website with 3 roles. ...
0
votes
0answers
18 views

Determining unauthenticated user when session cookie exists

We've been experiencing some strange behavior in regards to user sessions that I need help understanding how Drupal determines if a user is authenticated or not. We have a custom endpoint to log in ...
0
votes
0answers
4 views

Custom Form using Geofield and linked to a View

I have created a custom form & block which takes a postcode or suburb value and enters it into a return url (https://my-d8-site.ddev.site/store-locator?field_geofield_distance[distance]=20&...
0
votes
0answers
70 views

How can I programmatically create an user account and trigger an activation email?

I developed custom module to create users. And I setup config account setting "Require email verification" to "Require a verification email, but let users set their password directly on ...
1
vote
2answers
129 views

How to alter the parameters in the core.services.yml file programatically?

I need to modify the filter_protocols parameter inside the core.services.yml file programmatically to add a new protocol. I know how to alter a service but I don't find any information about how to ...
1
vote
0answers
18 views

User ID 0 with many roles

I was doing a custom code for a custom page that I have created through my controller where I set a user field named MyChoice and I add a role "freeaccess" for the user who opens this page. ...
0
votes
0answers
31 views

translatable content: how to set default original language

I've a D9 site, configured with two languages: Italian (default) and English. Some content types of the site are translable, the configuration under admin/config/regional/content-language for them is ...
0
votes
0answers
32 views

Generate a new password when a user account is activated and send an email with password

I am working on a web application using Headless Drupal 8 and Nuxt.js on the front. The app is to manage team members. Member can register (via REST API) without setting his password and wait for the (...
0
votes
1answer
57 views

Newly created field not being added to entity

I have created a form that adds a subset of field types to an entity (does not support bundles). (the reason for the custom form is that end users find the Drupal standard 'Manage fields' workflow ...
1
vote
2answers
28 views

Conditional Show/Hide Child Terms on Edit Page

I have a content type with a term reference. The terms have child terms. On the admin editing side, I want to show only top level terms until selected, then show only the child terms for that parent. ...
1
vote
2answers
34 views

Use theme template with specific Views

I have a D8 subtheme of Bootstrap and on the homepage I have 2 Views (2 carousel views). I turned on twig debugging so I could see which template file(s) is (are) being used, and where it starts and ...
0
votes
0answers
11 views

How to add “clone” button to WebformMultiple field

I created a custom composite field with a dozen or so fields, in a custom module extending Drupal\webform\Element\WebformCompositeBase. I need to add a "clone" button to the webform multiple ...
0
votes
0answers
26 views

Views field override and use it in Global: Custom Text

In Drupal8, I have created a view of content and add a relationship of the user account field which is referenced entity of the content. So, Basically I have one content type and in the account fields ...
1
vote
1answer
44 views

Ajax enabled form stopped working - Ajax callback never called

I have the weird problem that an Ajax enabled form that just worked stopped working - and I have not a clue what is causing this and when it stopped to work. The form itself has no changes for months ...
2
votes
1answer
99 views

Pathauto pattern for a content type depending on a reference field?

This question is already asked here, but the answer selected does not work for Drupal8. Description: There is a content-type, which has field, referencing taxonomy term. The term is in "Content ...
0
votes
0answers
20 views

Views custom relationship joined by plain text field

Let's say I have a node type named 'Book'. 'Book' nodes have 'publisher' field. I want to create a node view which displays these two columns: book title title of a book published by the same ...
1
vote
0answers
43 views

When old field revisions should be deleted from the database?

I have a question about old fields revisions in Drupal 8. For example I have "Full Title" field in different paragraphs. I have deleted this field from one of the paragraphs, for example ...
0
votes
0answers
24 views

Single webform submission creates multiple submission entries

I've got a number of webform forms on a website and when a user submits a form, it creates 2-3 duplicate entries in the database. Everything in the entry is the same, timestamps et al. I'm sure it is ...
0
votes
0answers
10 views

How to display content tagged with child terms in views?

I have a taxonomy vocabulary general in which I have a reference field to user roles allowed_roles. I have two taxonomy terms. A and B where A is the parent of B. Now I selected test_role in the A ...
0
votes
0answers
16 views

How to get the file destination from a content type's field_image to upload programatically

I have a cron job that goes and grabs content from another resource and uploads it into my drupal site, and this includes a link an image that I retrieve and upload into my S3 file system. My site's ...
0
votes
0answers
22 views

2 content types and reference

I am using Drupal 8.9. I have 2 content types Teacher and Subject. Teacher has 2 reference fields of content type Subject (first one is the subject which the teacher is teaching and second one is the ...
0
votes
0answers
25 views

Token replacement in webform custom element (webform_score module)

I use the module webform_score for my project but the webform element RadiosQuiz doesn't handle the tokens replacement. I'd like to use tokens in title and options text. I look on the RadioQuiz.php ...
0
votes
1answer
33 views

Webform Custom element option values validate

Can anyone please suggest how to validate the custom element option values ( select). This validate should work, once we add new element to the form and fill the option value and then click save / ...
0
votes
0answers
22 views

Replace Block on click of form element

I have a block which contains a form (I used the build() method) . One of the form elements has a suffix as follows: $form['test'] = array( '#type' => 'number', '#placeholder' => t(...

1
3 4
5
6 7
315