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
20 views

Media images link to their own image

I have inherited a site which had no image management. Instead each image field required you to upload an image instead of reuse an existing one. I enabled Media Browser and updated to 8.7. I am also ...
0
votes
2answers
41 views

After update 8.7.0 seven admin theme can't find icons

I updated my Drupal 8.6.15 > 8.7.0 After updated page not found error keep coming. (I attached photo below) It happens only in Admin theme, when I change admin theme to default theme, errors are gone....
1
vote
1answer
33 views

Create multiple basic pages with different fields

I have a question to create a site in Drupal 8. It is a website with about 60 basic pages, but each of them has different relationships, paragrphs, media. My question is, how can I assign different ...
1
vote
0answers
25 views

Menu item URL not updating using MenuLinkManagerInterface::updateDefinition()

When trying to update an existing menu link URL/ URI with updateDefinition() - https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Menu%21MenuLinkManagerInterface.php/function/...
1
vote
2answers
25 views

Populate a field in form alter with user name and one with user ID

can someone tell me why this works function justatest_form_alter(&$form, $form_state, $form_id) { global $user; if ( $form_id == 'node_test_form'){ $form['field_owner']['widget'][0]['...
-3
votes
0answers
29 views

How to print user tabs in all pages

Please help me to print user account tabs like ( view, edit ...) in all pages programmatically like menu.
0
votes
0answers
11 views

Setting default upload paths for media

I really want to have an organised files folder in my d8 project. I have two main media fields: field_banner AND field_image They appear in all my content types. I would like that all the the media ...
0
votes
1answer
67 views

Rewriting image output in views: how to provide replacement pattern inside twig tag?

In views I want to rewrite output of image field by using twig function drupal_image (see module Twig Tweak). When I provide the image path directly, this code works: {{ drupal_image('public://...
0
votes
1answer
64 views

The following SSH command responded with a non-zero exit status (drupal-vm)

My environment: Vagrant 2.2.4 VirtualBox 6.0.6r130049 ansible 2.7.10 config file = None Mac OS Mojave (10.14.4) I use drupal-vm to build my local development environment. I cloned this repo and ...
0
votes
2answers
28 views

How do I load a field of a product in a custom module?

A customer want to have the possibility to use different discounts on products. I'm working with the price resolver and I'll give the possibility to manage different discounts with taxonomy terms. I ...
-2
votes
0answers
74 views

Navigate back and forth through all media items of a node

I have added to Node content some media items from media type image (I have, also, added some other fields like body text, vote, tags,maps etc to media type image) and I show on the node content ...
0
votes
1answer
57 views

Programmatically get the results of a view

Using the group module in D8, I have the below view with machine name: group_members_per_group Machine Name of: (Member account) User: Full Name is: field_user_full_name (Member account) User: ...
-2
votes
2answers
66 views

How do I redirect a user to the front page after logging in? [closed]

Is there a way to redirect users to the front page after they log in, without using any additional modules other than the core modules. Right now they are redirected to their profiles.
0
votes
0answers
28 views

Custom module translations without interface translation

I'm trying to figure out if I can provide translations to my custom module that are considered part of the "content translation" rather than the "interface translation." I have a form in my module ...
0
votes
0answers
13 views

How to get the value of a date field in Drupal 8? [duplicate]

I know how to get the value of a field using the code below :- $entity->get('field_name')->getValue(); But how to get the value if the field type is "date"?
0
votes
0answers
11 views

Custom no results message in search api

I am trying to change the text that appears when no results are found with Search API, including to include links. I tried with views, without success (the same text appears). Do you know how to ...
0
votes
1answer
41 views

How can I get all fields and values of a node at once?

I know how to get a particular field (title field) of a node by following code: $publications = \Drupal::entityManager()->getStorage('node')->load($node_id); $title = $publications->getTitle(...
0
votes
1answer
77 views

Running drush entity:updates claimed successful but not changing anything

I am working on a project with custom entity type. My module works fine in my local environment. But when I deployed to my staging site, things are strange. For instance, I tried to change my entity ...
0
votes
0answers
25 views

hook_js_alter is getting cached

I recently come across a issue where my page was rendering two boostrap.js (Offcourse bad coding). An external Js from a module and another js from twitter bootstrap theme. Its causing some of the ...
0
votes
0answers
30 views

How to set value of autocomplete deluxe via AJAX?

I am using https://www.drupal.org/project/autocomplete_deluxe in Drupal 8. function custom_module_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) { $form['...
0
votes
1answer
40 views

How can I query a Drupal 7 database from Drupal 8?

I want to query users, nodes etc in my D7 database that I am currently migrating to D8 to compare with the migrated content. I want to use custom Drush commands to run some checks. Is this possible?
0
votes
1answer
48 views

Get node based target id from entity reference

We have an Article content type which has an Entity Reference field called field_document that is linked to the Media bundle type of Document. In mymodule we need to write a hook that will take the ...
3
votes
3answers
158 views

Error when viewing list of taxonomy terms

I'm getting an "unexpected error" when I try to view a list of taxonomy terms. I recently updated to 8.7, though I have a feeling the problem has been around since before the update. Here's the error ...
2
votes
1answer
42 views

Twig whitespace controls have no effect on fields

I am trying to iterate over a Paragraph field and apply a comma after each Paragraph item. In the field template that outputs the Paragraph, I am trying: {%- for item in items %} {{ item.content }}...
1
vote
1answer
36 views

Show certain elements based on URL query string

I am very new to drupal and also very willing to learn. I am trying to migrate old code from another tool to drupal 8. I am working on a form, using the webform module. Can I possibly show certain ...
0
votes
1answer
14 views

How do I apply an OR condition?

I've got the below code $query = \Drupal::database() ->select("excel", "e")->fields("e"); $group = $query->orConditionGroup() ->condition("grupindex", 1) ->condition("grupkodu", ...
0
votes
1answer
23 views

How do I apply or run an update?

For recent changes to 8.5.x, my paragraph entities broke and throws the following error. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_uid' in field list I uninstalled and ...
1
vote
0answers
23 views

Why do I get “Warning: Division by zero in __TwigTemplate”? [closed]

I created the connectedFilters.js file in /themes/custom/module/js/ with the following code. (function ($, Drupal) { Drupal.behaviors.connectedFiltersBehavior = { attach: function (...
0
votes
0answers
7 views

Cluster Search API results by content type

I'm using Search API to index and search my site. The site has several content types. I'd like the search results to be clustered by the content types. Specifically, I have a content type called "...
2
votes
1answer
72 views

Memory leak when looping through nodes

I've got code that loops through nodes in order to generate processed output. I've previously done an entity query that provided an array of node IDs. My main loop code looks like this: foreach ($...
0
votes
0answers
33 views

How to enable custom module by default?

How do I enable custom module by default?
1
vote
2answers
156 views

How do I inject UserInterface into Access Control?

I am trying to create a custom access control in my custom module in Drupal 8. But I am having issues in achieving it. I cant find a proper way to inject UserInterface class in access method. ...
0
votes
0answers
21 views

How do I get the default comment form in the content type template?

I have created the comment field in the content type. How can I render the comment form using a specific content type template in Drupal 8?
0
votes
0answers
14 views

Changing “From” in password recovery mails?

My site email is site@bla.com. When mails are sent, the header is: Return-Path: <site@bla.com> Sender: site@bla.com So mails reaching the user says from = "site@bla.com"... instead of from = "...
0
votes
1answer
28 views

How to get the list of blocks for the current page?

I'm trying to get the list of all blocks for a certain page, but I can't figure how to do that. How do I get the list of all the blocks that are rendered for a page, independently from the region ...
1
vote
0answers
14 views

How to alter SQL queries in theme layer in Drupal 8?

In Drupal 7, we could use hook_query_alter() in theme layer since drupal_alter() made modules and theme run the alter functions, but in Drupal 8, it seems this as been restricted to custom modules....
1
vote
1answer
35 views

Understanding page-title.html.twig and/vs field--node--title.html.twig

This question is based on the desire to have only one wrapping tag around the title value. (I am utilizing the block system to render the page/node title) Both of the templates utilize some sort of ...
0
votes
1answer
28 views

How to display a link field with its link text in a twig template

A content type includes a link field link that accepts Link text. A user inputs the URL /target with the Link text "Go to target". How do I get twig to generate `<a href="/target">Go to ...
0
votes
1answer
51 views

How to add a nolink menu item

I'm creating a menu item for my main navigation bar. It looks like this: module/module.links.menu.yml: top.link: title: 'Operations' description: 'Operations' parent: main menu_name: main ...
0
votes
0answers
16 views

Data storage for custom config-entity sequence type

Using Drupal 8 I've got a custom content type application and a ConfigEntityType application_type for bundles of it. I need each bundle to store a list of strings when newly created/edited. E.g. ...
0
votes
1answer
16 views

How to retrieve the link and description in a custom file field twig template

I have a field field_file. I've created a template field--field_file.html.twig. How can I access the link, description (and attributes and icon ) separately in this file? I have: {% for item in ...
0
votes
0answers
9 views

geofield map Custom Marker by Entity Reference

have a project node that has google map and also entity reference as fields, I want to know is there any way to customize the google map markers according to reference fields data? For example, I have ...
0
votes
0answers
14 views

Add a custom button to a views exposed filter form

I'd like to add a custom button near the "apply" button on a view exposed filter form. To do that I have created my own module and added a hook: function mymodule_form_views_exposed_form_alter(&$...
0
votes
0answers
23 views

How to integrate two modules

I'm currently working on modifying https://www.drupal.org/project/react_comments module to support https://www.drupal.org/project/comment_notify. I need advice. Comment Notify module marks comments ...
0
votes
1answer
25 views

Drupal 8 Alter views exposed form

I have a view that in that view I set up 3 exposed filter, all working fine. I need to set a condition to show the third filter option to a specific user, it can be checked according to the user role, ...
-1
votes
0answers
58 views

Performance issue while loop through all groups and create node for each

I wrote the below code in the .module file of my custom module which is scheduled to run once a day using cron. I have tested the code with only two groups available, and noticed a performance issue ...
0
votes
0answers
8 views

How to ignore (or clear) invalid views filter value?

We have a scenario where there are some dead links out in the world to our calendar. Because the page exists, it won't result in a 404. However, some of the URL parameters are old filter values which ...
0
votes
0answers
9 views

Migrate content to distribution

I have a D8 site that am looking to migrate to Open Social distribution. What method would you recommend to migrate the content? Tried the Migrate module but that seems to only be for D6 and 7 to ...
1
vote
1answer
24 views

Manually trigger AJAX from custom JavaScript

I'm in the process of developing a form where the user enters a UK postcode and the textfield is replaced by a select list. This all works quite nicely when using the blur event, but it is not always ...
1
vote
1answer
37 views

Output Paragraph values instead of the Paragraph IDs in a View REST export?

I have a View with a REST export display (image attached) that has some indexed field values from Search API. The highlighted portion, authors, is a Paragraph field. Instead of the entity ID pointing ...