Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
6 views

How do you get Product Variation Type fields and display modes to show up when displaying Products in a View?

I've created a Product Variation Type for all my products, all of which have the following custom fields: Display Title, Subtitle, and Top Rated Product? (boolean checkbox): When setting up a View to ...
0
votes
0answers
16 views

Using Geocoder in a Functional Test

I am writing my first test in Drupal 8's API and for some reason, I am unable to geocode. When I run my code in a controller, it works fine, but when using a test, $addressCollection evaluates to ...
0
votes
0answers
20 views

Simple Oauth oauth/debug?_format=json Internal Server error

When i try to test the ooauth/debug?_format=json endpoint through Postman i get the internal server error and error code 403 forbidden. Even though i use a valid Authorization header with Bearer and ...
1
vote
0answers
11 views

Need to add SKU to order confirmation email - Commerce 2

I have been able to customize the order confirmation email twig file for a client to some degree, however when it comes to adding the SKU for each item ordered I cannot find a way to have it populate. ...
0
votes
0answers
16 views

How to alter rendered and aggregated views values?

I would like to do math on counts of two aggregated fields. In views post render the final results are located under $view->style_plugin->rendered_fields[0] and they are generated by views aggregator ...
0
votes
0answers
24 views

How can I be notified when a migration fails?

I execute migrations everyday with drush in a bash script but sometimes one migration or more fails. Other times the migration ends with 0 created, 0 updated, 0 failed and 0 ignored. I would also like ...
1
vote
0answers
17 views

Problem with text format and base64 inline images

I am using Drupal 8.6.13 text field with Full HTML text format for a field where we want to have content with inline base64 images (due to the synchronization with Gather Content). Synchronization ...
0
votes
0answers
21 views

Services: Updating file/image on server

I'm able do retrieve, delete an image from Drupal server using services https://example.com/entity/file/[fid] But I couldn't able to do the same for updating. I tried like follows to update the ...
0
votes
0answers
27 views

Rendering multiple field image in paragraph

I have field_image in my paragraph that has multiple values so img1.jpg, img2.jpg etc . I want to render it in twig but the first image needs to have different class then the rest of them . I've tried ...
0
votes
0answers
15 views

How to add a custom filter to a view?

I'm still fairly new to Drupal and I've set up a page based on a view. On this page I display Directory Listings from the FileBrowser module which all goes fine and the way I want. Now the tricky ...
0
votes
1answer
20 views

Covert link field as link field text format?

I have used the link field for the button. Here, I have to change one word as Italic. I am not able to change the word as Italic in the link field. I want to change the link field as link's title lik ...
0
votes
1answer
50 views

print data to twig file from custom form submit via controller

I have created a custom form, and I'm passing data to twig file from submitForm function as follows public function submitForm(array &$form, FormStateInterface $form_state) { $form_state->...
-1
votes
0answers
13 views

How to get exact matches on top of search results?

I'm using search api with solr for drupal 8. I've added title field to index and gave maximum boost. Problem is when I search a keyword, exact match is not at the top of the results. For example: ...
0
votes
0answers
39 views

Caching input filter results

I'm creating an input filter that is quite expensive, as it makes a call to a remote service as part of the processing of the output. In Drupal 7, I'm pretty sure that the filtered output of an input ...
0
votes
0answers
11 views

Populate a 2nd date field min date from a previous date field in webform

I have 2 date field on my webform. Both date fields have a min date set to today and a max date set to today + 2 years. When a user selects a date in the 1st date field, is it possible to set the 2nd ...
0
votes
2answers
32 views

How to get all values from a new node being created in hook_ENTITY_TYPE_presave()

Drupal 8.7.2 function mymodule_node_presave(Drupal\Core\Entity\EntityInterface $entity) { data_dump($entity->original); //is empty because its a new node, not a node being updated. // How to ...
0
votes
1answer
59 views

Get Current Applied Image Style Name

How do you get the currently chosen image style name from the field format display option? I can load an image with a given style with the code below, however, the style name (e.g. thumbnail) is hard-...
1
vote
1answer
31 views

How do I use Bootstrap theme's modal.jquery.ui.bridge's mapped events?

I am using a Bootstrap subtheme, and would like to trigger an event when a modal is closed. Reviewing the main theme's modal.jquery.ui.bridge.js file, I see that the bridge is intending to map jQuery ...
1
vote
1answer
92 views

<form> and <input> tags in a text field of format Full HTML are not rendered in a field based view

In latest Drupal 8, I've got a text field of format Full HTML that contains <form> and <input> tags (It's a MailChimp subscribe snippet). As long as I am editing the text in CKEditor in ...
0
votes
0answers
31 views

Programmatically get View Field rendered HTML

I need to programmatically read a field output from a View in Drupal 8. The field output has been rewritten with extra text and twig. My code: foreach($view->result as $row){ foreach ($view-&...
0
votes
0answers
17 views

Front page per language (paragraphs) [duplicate]

I have a multilingual site in Drupal 8 that needs to have a different node for front page on each language. The node alias is homepage and it needs to look clean. Ex. site.com/us/ site.com/ca-fr/ ...
0
votes
0answers
19 views

Can't select image in CKEditor in order to apply style

Not sure this is connected to Drupal, but since I'm using CKEditor within Drupal, I'm asking here first because sometimes, using a feature in Drupal seems to change behavior. In the empty body field ...
0
votes
0answers
21 views

“Warning: include_once(/var/www/website/web/core/modules/file/templates/file.field.inc): failed to open stream”

I am getting the following PHP warnings. Warning: include_once(): Failed opening '/var/www/website/web/core/modules/file/templates/file.field.inc' for inclusion (include_path='/var/www/...
0
votes
1answer
24 views

How to check if a password reset token is still valid?

Is there a way to hook into the user_pass_reset form to detect if the provided hash is valid? Currently it seems to just throw a 403 error when submitting the form if the hash has already been used to ...
-3
votes
1answer
23 views

How to use the Message Template?

I have Drupal 8 with the Message module. I created message templates using drupal 8 but I prefer to use TWIG. In Drupal 8 my code works, but when I put it in TWIG, the tokens do not work. How to ...
0
votes
0answers
27 views

JSON:API How to retrieve multiple values in a CONTAINS condition?

I'm using JSON:API module (in core since v8.7), and works well for a simple query like: Retrieve all articles with title that contains "MyKeyValue" or subtitle that contains "MyKeyValue" That, ...
-2
votes
2answers
31 views

How to get all the entity details which are using specific media?

I have a image "sample.jpg" (In media library). and I used this image in multiple custom blocks of different block types. Now I need the information of all the custom blocks which are using "sample....
0
votes
0answers
29 views

User not logged in

I have a Drupal 8 installation and it is not logging in the users. Tried Google search and applied all solutions like setting cookie_domain, trusted_host_patterns and clearing cache. Note that, if ...
-2
votes
1answer
23 views

How to restrict/provide access to particular entities of some ENTITY_TYPE to users which has email listed as field value?

I have a entity type Products with multiple entities in it. I want to give View, Edit, Delete Access of each entity to users only whose Emails are listed under field_user_email. I want to restrict ...
0
votes
0answers
25 views

Issue with Views Contextual Filter using Taxonomy Term Name

I've run into an issue with views using contextual filters that feels like a bug but usually when I encounter what appears to be a bug it's because I'm doing something wrong so I wanted to see what ...
0
votes
0answers
14 views

Modify token used in path URL alias generation

We would like to have the URL pattern for Article content type to use article/[node:field_short_description]. In the scenario where field_short_description is not populated, we would like for the URL ...
0
votes
0answers
44 views

Custom LanguageNegotiator not working on interface translations

In a custom module I created a custom admin route /admin/config/mymodule/rebuild whose controller renders a node into a variable. The purpose of the module is to send the rendered content to an ...
0
votes
1answer
39 views

Get node data from entity reference field

I have an entity reference field to a content type blog. I referenced a specific blog, but when I render that field in twig using {{ content.field_blog }}. I want to get the autor name and time when ...
-2
votes
0answers
28 views

How to check page url on each page load in drupal 8?

I want to check page URL when each page load. In Drupal 7hook_init or hook_page_alter hooks called in each page load.In drupal 8 which hook function used to call on each page load?
0
votes
1answer
43 views

How to apply a patch file in composer to a submodule of a module?

I've added the patch to composer.json like this: "drupal/admin_toolbar_tools": { "Bring back media to dropdown menu": "https://www.drupal.org/files/issues/2019-01-16/admin_toolbar-media_link-...
0
votes
2answers
81 views

Layout builder “edit layout” form missing revision log message field

When I edit the layout for a given node it is missing a log message field in the revision area. Is anybody else seeing this or am I alone? In trying to diagnose: Where that particular revision log ...
2
votes
0answers
31 views

What is the underlying logic for generating an icon map for a custom registered layout (in Layout Builder)?

There seems to be a dearth of information on the internet about how to generate an icon_map for newly registered layouts in Layout Builder. I've gotten as far as finding a patch file from the project ...
0
votes
0answers
31 views

Ajax implementation in exposed forms

We use to add property '#ajax' to a form element in our form array, to trigger an Ajax response and it works fine except in case of views exposed forms. This doesn't work in case of views exposed ...
1
vote
0answers
27 views

Have Value Selected but Label Showing in Views Display Plugin

I am working on a custom Display plugin for Views. In my buildOptionsForm() method, I have the following: $form['inherit_yaxis'] = [ '#title' => $this->t('The title'), '#type' => 'radios'...
-1
votes
0answers
19 views

Create a template file just for the first level

I need to create a template file just for the parents of taxonomy terms. First of all I don't know if the same as drupal 7 in 8 I should write this code in template.php file or not. In the second ...
0
votes
1answer
24 views

Raw Field Value in Views

We have a content type that has a Video Embed Field. In this field, we simply enter youtube or Vimeo url. In a custom view we are trying to display the raw value of the field. Since this is a Video ...
0
votes
1answer
40 views

How to create Dynamic Routes

I have been trying to create dynamic routes by using RouteSubscriberBase class. I know we can create dynamic routes by using slug parameter in the URL. Similar to this method ( https://befused.com/...
0
votes
1answer
41 views

What to do in a case of plugin ID not found?

I'm fairly new to Drupal, the inside settings are quite easily to understand for me but when it gets to error fixing I'm kind getting stuck sometimes. For a project I've installed the Open Social ...
1
vote
2answers
106 views

Custom module javascript Drupal.behaviours doesn't seems to load

I have a custom module which has a javascript file. Here's the content of the javascript file: (function ($, Drupal) { Drupal.behaviors.promotionalOverlayBlock = { attach: function(...
0
votes
1answer
17 views

Unable to access translated node content

After performing a Drupal core update on my site today I've found that I can no longer access translated content. When I try to view or edit the translation, I only see the default language content. ...
0
votes
0answers
31 views

Migrate node with paragraph

I'm trying to figure out how migrating content from a Drupal 7 site to a Drupal 8 site works. I managed to understand how to create a custom module to migrate nodes with regular fields to my new D8 ...
0
votes
1answer
26 views

Get Username from UID with Preprocess for Template

I'm a bit lost at finding the username based on the uid. I get the uid from the address using: $current_path = \Drupal::service('path.current')->getPath(); $urluid = (explode("/",$...
0
votes
0answers
8 views

Webform attached to group content node shows no results

I am able to attach a webform to a group content node, but then a strange thing happens. My form follows the event registration example. After registering, no results show in the group content "...
0
votes
0answers
21 views

How does the register form in the user module load ImageWidget?

I want to use the user picture widget on the user register form to capture an image. So for my custom entity form I'm using the managed_file as such modules/custom_module/src/CustomEntityForm.php ...
0
votes
0answers
28 views

Loop through all posted articles and print specific section

I am trying to create my first Drupal 8 theme. On the frontpage, I want to list all articles with the title, summary, date posted, etc. I more or less achieved this using views. Basically {{ page....