The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [8]

Version tags should be used only 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
30 views

How can we just apply the updates to a single module using composer without apply patches for other modules?

We have the following composer.json file. When we want to update a module such as Environment Indicator, we run the suggested composer command composer require drupal/environment_indicator:^3.7'. ...
2
votes
1answer
65 views

Migrate nodes with special characters in title

Given a source's title like This "cool" & "neat" article's title has HTML entities , is creating a title of This "cool" & "neat" article's ...
0
votes
0answers
45 views

Commerce add to cart throws fatal error related to order_items

On a Drupal 8.7.7 site with Commerce, adding an item to the cart results in whitescreen. The website encountered an unexpected error. Please try again later. Checking the logs, there's an error ...
0
votes
1answer
52 views

Custom remote video thumbnail

I'm using the media entity from Drupal core together with the media library, to handle media on my site. I have Remote Video and Image with crop media types. I'm using the crop and image_widget_crop ...
0
votes
1answer
30 views

Make my view the default for content type

I am probably doing this the wrong way, so please correct me if I am wrong! I have created a new content type, called "Entities". My content type has many fields, and the default view when you visit "...
0
votes
0answers
20 views

How can I provide module translations? [duplicate]

in Drupal 8 we have added some elements and created some new modules. These elements and modules were labeled in english. As on the picture, red marked elements are still in english, the others are in ...
0
votes
1answer
28 views

Add content screens from the front end

I am building a web application (for trusted users), so the logged in user will have the ability to add content. However currently, when the user wants to add a record, they move from the frontend ...
0
votes
0answers
33 views

Years missing in Views' exposed field

I have media content I want to add an option for viewers can view by year from select option. I have added Published on and then checked on exposed with year checkbox as you seen in snapshot but it ...
0
votes
1answer
28 views

How can I debug adding libraries via hooks?

I am trying to attach simple css via hooks in the themes and it does not work? The code looks correct to me. It doesn't attach. What am i doing wrong? global-styling: version: 8.x header: true ...
0
votes
0answers
21 views

How to use FormBase with form_alter hook?

I am trying to edit the node creation form in order to add multiple 'tableselect' fields in it. My module adds options in a select field and add an ajax callback triggered by the 'change' event of ...
0
votes
0answers
18 views

Can't edit media Image from within node edit

I'm using Media and the Media Library (yes I know this is experimental). And all of the sudden I'm not able to edit my added image when I'm editing a node. In an earlier stage of the website I was ...
1
vote
1answer
26 views

Call to undefined function Drupal\Component\Utility\imagecreate()

I got this error on a server I setup and was confused: Error: Call to undefined function Drupal\Component\Utility\imagecreate() in Drupal\Component\Utility\Random->image() (line 282 of /var/lib/...
0
votes
0answers
16 views

search_api_solr adding boost/weight/importance to a taxonomy value

I have a Taxonomy referenced from entity reference fields on multiple Content Types. It's "version". So what version of the software relates to the content being read. Often, this content is nearly ...
0
votes
1answer
36 views

How can I have a view to load more rows on clicking a “Load more” button?

We have created a view, myview, where we want to display 3 nodes (content type = basic) and add a View All button on page load. The purpose of the 'View All' button will be to show 6 more (the view is ...
2
votes
1answer
44 views

How to get fields from taxonomy terms?

I am able to retrieve taxonomy terms programmatically, (as long as I only want to reference the default fields, 'tid' and 'name'). But how do I access custom taxonomy fields? $vid = 'MACHINE_NAME'; $...
0
votes
0answers
30 views

Default Paragraph Config Per Content Type

We're using a paragraph for the hero/header of our site. Within the paragraph are a number of different toggles to define various options for the hero. I'd like to have it so that if the user is ...
0
votes
0answers
27 views

Redirect from a path

I have a routing.yml file with a path which triggers a controller method. When the controller method finishes the operation I want to return user to the page he came from originally. I don't want to ...
0
votes
1answer
49 views

Setting a Twig to a specific Form Container

As the title says, There is a specific Form Container that I would like to add a twig to that is on a page having its own twig. No theme hook name suggestion is provided when I inspect its element. ...
0
votes
0answers
50 views

How can I trigger the EntityTypeEvents::UPDATE event?

I tried to trigger event on each entity update. This is my src/EventSubscriber/MySub.php use Drupal\Core\Entity\EntityTypeEvents; use Symfony\Component\EventDispatcher\...
0
votes
2answers
69 views

Perform math calculation in views

On Drupal 8 site, I have a exact copy of the below excel example table made with views but without the yellow cell yet. The view is displaying one content type: Client where all the below fields are ...
0
votes
0answers
46 views

How can I display a webform on a node?

I am trying to display my webform using MYTHEME.theme file but I did not get any result. I am using code below: function THEMENAME_preprocess_webform(&$vars) { $wfid = $vars["element"]["#...
0
votes
1answer
33 views

How to grant create and update permissions to a custom role?

I have a new role as "Publisher". I want to grant Publisher 'create' and 'update' permission using code. My .permissions.yml file looks like this : 'delete contact entity': title: Delete entity ...
0
votes
1answer
42 views

views_pre_render add class item to a row

When pre-rendering a view row is there a way to add an HTML class into a single row of the markup, allowing me to add a new background colour to the event item highlighting its importance? This is for ...
0
votes
0answers
12 views

Create Taxanomy Menu with specified starting term

D8 Taxonomy Menu module is perfect to create a dynamic menu for a given vocabulary. I would like to create a menu starting with a term or subterm. For example, Vocabulary VocabA 1 Term1 1.1 ...
0
votes
0answers
19 views

Search API boosting results how to

I followed the guide via this article: https://www.easternstandard.com/blog/2018/05/drupal-8-search-how-get-better-more-intuitive-search-results-using-search-api Search API is searching both content ...
2
votes
1answer
84 views

How to add a theme preprocess function for published state?

I want to create a body class for the published state of a node. I found some suggestions below for Drupal 7, but this code is not working for my Drupal 8 theme. Add class based on published state ...
0
votes
1answer
29 views

How do I need to configure my site on AWS with Elastic Load Balancing to force HTTPS everywhere? [closed]

my site is up and running, but all my form submits get redirected to an http:// link. The redirect from http to https on my Server (Apache on EC2) is configured and you don't see any effect as a user. ...
0
votes
2answers
40 views

How can I create two blocks at once from the same custom module?

I have figured out how to create a block from a custom module, by creating a ./src/Plugin/Block folder, then creating a PHP script inside it, with the following code: <?php namespace Drupal\...
0
votes
0answers
34 views

No AJAX when user is logged in?

I am developing an e-commerce site for one of our customers for the first time with drupal. It is going pretty good so far but there is a weird misbehavior where I have no idea on how to handle it in ...
0
votes
0answers
31 views

How can I override image attributes for each row in a view?

I am currently trying to write a preprocess to change the img tag on 2 views but with no success using the below code: use Drupal\node\Entity\Node; function mytheme_preprocess_image(&$variables) ...
0
votes
0answers
27 views

How can I set default key values and limit the number of options?

I have created a custom webform element for radios, however I'm not clear how to set the number of options to minimum of 4 and maximum of 4, so always 4 options. I also want to set the value of each ...
0
votes
0answers
22 views

Tabs not visible after creating view tabs

I am trying to create view tabs and follow below video https://www.youtube.com/watch?v=hpuRdzyK3jI but couldn't get any tabs displayed, only the results are displayed. I am using Bootstrap Barrio ...
0
votes
1answer
37 views

Where is the configuration actually saved in the system?

I am new to Drupal 8. I installed the Drupal webform module. I am able to export the configuration file but unable to figure out where the configuration is actually is saved in the Drupal system.
0
votes
1answer
66 views

How can I programmatically get the image style of an image in a paragraph template?

I have an Twig extension that applies image style to an image and provides a URL for the processed image. The extension looks like this: protected function setImageStyleUrl($url_field_value, $...
0
votes
1answer
16 views

How can I customize the header and footer from a custom page controller?

I have a module named some_module. This is my some_module.routing.yml: some_module.index: path: '/this/is/the/path' defaults: _title: 'Some Title' _controller: '\Drupal\some_module\...
2
votes
1answer
22 views

Markup being stripped from form element title

I need to add links to checkbox titles, I can see the link in the render array but when it renders the markup is stripped. How can I get the links to not be stripped? I am doing this in a form alter, ...
1
vote
1answer
27 views

Webform page wizard and submission data - no reference to which page the element was on

I am creating a multi-page webform questionaire using the Page wizard. I have also created a custom handler so I can manipulate the data from the form when completed. My issue is that when using $...
0
votes
2answers
36 views

Rendering plain HTML in a form

I have HTML markup which is externally generated but I need to display in a form. I've got the following code in a form controller: public function buildForm(array $form, FormStateInterface $...
0
votes
0answers
16 views

When rendering a custom form, how do I use <button> instead of <input type=“submit”> for the button #type? [duplicate]

I have a render array for my custom form, which acts as a "Like" button for articles (but with custom functionality for our client). The button is defined like so: ... $form['like_btn'] = [ ...
0
votes
0answers
78 views

How can I solve this Uncaught TypeError: $elements.tooltip is not a function?

Problem The tooltips don't work. I have the following error message in Chrome's JS console. jquery.min.js?v=3.2.1:2 Uncaught TypeError: $elements.tooltip is not a function at Object....
0
votes
1answer
29 views

How can I set up a “blog” area?

I am very new to Drupal and Twig. I've a custom Drupal theme I've built, but my client now wants a "blog" system as well. This includes the following features: Show most recent article in a blurb on ...
0
votes
2answers
47 views

How can I add paragraphs to a translated node?

I have a problem with the Paragraphs module and translation. I'm using Drupal 8.7.7 and Paragraphs 8.x-1.9. When I add a translation to a node with a paragraphs field (unlimited), I can only ...
0
votes
0answers
13 views

How to know what is changing views sql query?

I would like to know what modules are altering the select sql of a view. Is there any way I could know it?. Due to this question I put some days ago, I would like to find why that sql is altered. I ...
0
votes
0answers
21 views

Expose custom db table to views to join with any entity data

We have a db table from custom module which has fields entity_id and entity_type. I need to exposed this table to views using hook_views_data() and it should be possible to join with this table within ...
0
votes
2answers
49 views

Display the day of the week

I have a content type with various fields. One of these is a date field. After typing in the date I would like to display the day of the week to the right of the date.
1
vote
2answers
272 views

How can I make a response cachable by browsers?

I am working on a Drupal Controller implementation that would return a generated image as response. I used Symfony's Response and I was trying to add ETag header to it: use Drupal\Core\Controller\...
0
votes
1answer
29 views

Why is my view for Solr indexing is not showing any results?

I have installed solr 8.2.0 for drupal 8.7.6. My Solr server and index are enabled and indexed. But when try to search via views, the results are not showing up. Please help me in solving this. My ...
0
votes
0answers
64 views

Manual Update from Drupal 8.7.6 to 8.7.7 Acts Like New Install

I have been manually updating Drupal 8 core successfully until now. When I try to update from 8.7.6 to 8.7.7 it goes to a new install. Here is what I did Back up database, and back up entire site ...
1
vote
0answers
15 views

8 - How can I update the entity reference fields of the form when I close the modal?

How can I update the entity reference fields of the form based on selection in the modal dialog when I close the modal ? I have a form and users starts fill the form. Then click on choose address ...
0
votes
1answer
19 views

How can I filter which entities are available in the admin form for an Entity Reference Field? [duplicate]

I've got a Field which is called "Primary Article" which is an Entity Reference Field. I've configured this field setting the "Reference Type" to be "article", so that only articles show up in the ...