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

Twig: Generate classname from variable in views template

In the twig template file of a view with grouped rows I would like to add the title of the group as a classname. But the rendered classname from title variable is just "_" on every group. This is the ...
0
votes
0answers
13 views

Filter out refunded orders / payments in Views with Drupal Comerce 2

I'm running Drupal Commerce 8.x-2.13 with Commerce Stripe 8.x-1.0-rc2 as payment gateway on Drupal 8.6.15. I have several views where I list all the order items for each product with some fields from ...
2
votes
0answers
19 views

Updating File uploads via REST

What would be the best way to update file uploads (updating the content of the file, not the target_id) using REST in Drupal 8? We have a bunch of files in GIT that we will create entities for (...
0
votes
2answers
48 views

Convert current time from Unix timestamp to date format (d/m/y)

In my custom module (.module) file, I am using: $current_time = \Drupal::time()->getCurrentTime(); date_default_timezone_set('GMT'); to get the current date... However, the date value is returned ...
1
vote
0answers
9 views

Form submits before File Upload completes

I have a form. It works... but the user must wait for the large file to upload first or they won't be processed by the form. The upload form will change from the Upload button to the name of the file ...
1
vote
0answers
29 views

Views: exposed filters for entity reference, do an AND?

I have a View that has exposed filters that searches and returns results for one content type. I have a few entity reference fields (some content, some taxonomy) that when a user selects multiple ...
0
votes
1answer
45 views

How to build render array with node title linked to node for a list of nodes

I have a paragraph type to output a list of content. The editor can set different options, one of them is to show the list as teasers or just node titles linked to node. The corresponding part in code ...
0
votes
0answers
23 views

Modal does not handle errors on login

I have used 'use-ajax' class to render login form in a modal. I want to handle validation errors on same modal without closing it. On successful login it is redirecting correctly, but when an error ...
0
votes
2answers
33 views

Drush error when attempting Drupal update: unable to copy/move [closed]

I have a Drupal site running on localhost (Windows) that I'm trying to update from 8.6.7 to 8.6.15. When using Drush to perform the update (drush up drupal -y), I encounter the following error: ...
0
votes
1answer
34 views

Send email after content update

I have create a new content type with a field of email. In this field I put the email address of the person I want. The case is: I want every time the node of this content type updated, to send an ...
-1
votes
0answers
20 views

How to display the picture of the user in the template page.html.twig?

I use the default field user_picture for the picture of the current user. How to display the picture of the current user in the template page.html.twig ? I try with {{ user.user_picture }} but it ...
1
vote
0answers
32 views

Change module from manual to composer installed

Note: This is not a duplicate of The site has a mix of modules installed manually and via Composer: Can I move all to Composer? As this question below involves different folder locations. I currently ...
0
votes
1answer
25 views

Can't submit data when rendering a webform programmatically

I'm working on a Drupal 8 project, when trying to load a webform programmatically in a controller, the webform is rendered correctly but when data has been submitted no values founded on webform ...
0
votes
0answers
24 views

Twig and CSS for custom Block not working

I'm working on a custom module that has a block. This block has a form in configuration where user input the relative data, so far it works its saving the data and it display it but without a template ...
0
votes
0answers
22 views

Modules inside a profile are not listed in the “Extend” page

After updating Drupal core from 8.5.15 to 8.6.15, the modules inside a profile are not listed in the Extend page. When I run drush updb I get error messages about missing modules.
0
votes
0answers
18 views

Get the list of child pages for a book given the book node id

In a theme preprocess hook, I have the node id for a book. How do I get the list of child pages for the book? I checked the Book module API but see didn't a way to do it.
0
votes
1answer
88 views

Programmatically and automatically delete every node after 2 years from its creation time [closed]

My question has a half answer here but not completed for my case. This is the piece of code I am talking about: <?php function mymodule_cron() { $storage_handler = \Drupal::entityTypeManager() ...
0
votes
0answers
35 views

How to theme webform's Custom Composite element?

Is there any chance I can move specifics sub-element to Custom Composite? Either, I couldn't find any way how to use flexbox inside in a custom composite. For example, I wish to have; [First name] ...
-1
votes
0answers
55 views

Exporting comments from Drupal to Disqus not working for Hindi links

There are 3 kinds of links for the nodes in my drupal site. The default node/[nid]. Ex: example.com/node/24 The links with URL alias in English. Ex: example.com/lorem-ipsum The links with URL alias ...
1
vote
1answer
20 views

How to render image uploaded from a configuration form

I'm working on a custom module, that contains a block and I'm currently having an issue to render an image that is being uploaded through a form at the configuration of the block. I'm getting this ...
0
votes
1answer
33 views

Output data of different content types in same page

I have two content types : Content type 1 named book with two fields author and language Content type 2 named movie with two fields date and resolution In my-theme/templates/page.html.twig I want to ...
0
votes
0answers
20 views

View presents fewer items per page after using Unset

I'm deleting items by means of an unset in hook_views_post_execute, as far as the view I have it configured by 10 items per page. The problem is that it shows me sometimes 6 or 8, I have searched for ...
0
votes
0answers
38 views

How to access specific checkboxes in a widget_type form alter?

I have a Paragraph with two List (text) fields. One is using the Select widget and the other using Check boxes. There are 14 checkbox options—I'm trying to show/hide certain checkboxes based on the ...
-2
votes
1answer
21 views

modify my php version with lando drupal site [closed]

i put this into my .lando.yml file config: php: 5.6 but when i rebuild my lando site it still says php 7.1 when i run php -v How can i make it have the correct php version in my lando site?
0
votes
1answer
32 views

How do I know what setSetting is suppose to be?

I am creating a custom content entity and in the BaseFieldDefinitions, I am trying to create a field for assigning a user as the designated assigner and will follow up with a assignee. So far, the ...
-3
votes
0answers
19 views

Class 'Drupal\Tests\Core\Menu\MenuTreeParametersTest' not found in “My Block”?

how to fix this ? drupal version 8.6.15 and php 7.2 . error : Class 'Drupal\Tests\Core\Menu\MenuTreeParametersTest' not found in "My Block" ? my code : function menuAccount() { $tree = \...
-2
votes
1answer
25 views

Sell a unique product with

I would like to sell a single product (a CD) on a Drupal 8 site and I'm looking for a simple way to pay. I guess in this case, it's not worth using the Commerce or Ubercart module. In fact, I intend ...
1
vote
1answer
47 views

Using parameters in routes

I am using the pathauto module to create url aliases for all user account url, so: /user/[uid] will become /u/[user:account-name]-[user:uid] which means: /user/36 will become /u/john-smith-36 In ...
0
votes
0answers
19 views

How can I get field definition values in a hook_views_query_alter?

This is a little related to my earlier question, I'm using a hook_views_query_alter to only show results for the latest (last) value in a list field, and then also in that set only show the results ...
0
votes
0answers
28 views

How can I limit views results based on the value of two fields?

I may have to do this programmatically, but I was wondering if there's another way in the UI. Basically, I have a list of articles with Volume and Issue fields. I want the view to only show articles ...
3
votes
2answers
75 views

I broke a view and i'm not sure how to fix it

I broke a view by adding the "flagged" relationship to the view, then filtering by the flag_id, then deciding against it and removing the relationship. The filter for flag_id was not removed when the ...
0
votes
1answer
26 views

How do you populate existing entities with the default value for a newly added field?

Let's say I have a content type, Article, with several fields. I already have hundreds of Article nodes created, but now I want to add a new field. After I set a default value for this field, how can ...
0
votes
1answer
30 views

Print image URL with image style

I would like to print an image URL with an image-style. This doesn't work, since I don't have a ".value"-value for the image: How to find image style URL from within twig template? Is there anything ...
0
votes
0answers
27 views

Update Symfony before Drupal core?

Right now there are some security updates for Symfony: curl -sS https://get.symfony.com/cli/installer | bash echo y | ~/.symfony/bin/symfony self:update ~/.symfony/bin/symfony security:check Symfony ...
-2
votes
1answer
36 views

How to get netflix like login functionality restrict user login based on session?

Allow administrators to limit the number of simultaneous sessions per user role. Assuming the session limit is 1, if a user is logged in to a Drupal site from their work computer and they log in from ...
1
vote
0answers
21 views

Views alter query, add condition doesn't work

I have a taxonomy with 2 level of depth and I have a view that get some documents. In this view I can filter by the type of document (get from the taxonomy) but only by the first level. The problem ...
0
votes
0answers
14 views

change Comments per page

I need to change the comments per page value, I set it 50 from the field setting but in some pages, I need showing only 10 comments, not 50. I tried to use this method setSettings([ 'per_page' =...
-3
votes
0answers
24 views

How to use dependency injection for \Drupal::service('page_cache_kill_switch')->trigger();?

How to use dependency injection for \Drupal::service('page_cache_kill_switch')->trigger();
0
votes
0answers
30 views

Have alias URL remain alias instead of resolving to target URL

I have a Drupal site with an Event content type. This content type has an Event Categories taxonomy field on it, which, as you can guess, categorizes events. When you navigate to the URL of a ...
0
votes
0answers
13 views

How to include book traversal links on a custom twig template page

I use the Book module to create books with chapters. When I use the default twig template node.html.twig to display a book chapter, a section titled "Book traversal links" is included, with links to ...
0
votes
3answers
54 views

How can I have a nested slideshow with paragraphs and views?

Initial situation I have a node type with a paragraph field. Each paragraph of the paragraph field is rendered among themselves. What I want to achieve The paragraph field inside the node should ...
0
votes
0answers
34 views

Return an Ajax Response from EventSubscriber?

I am trying to return an ajax response when a user logs in while the page is loading post-login. /#1 approach was attaching an ajax callback to the user login form submit with form_alter. However ...
0
votes
0answers
41 views

How to setCookie in samlredirect function

I am trying to logout users when they hit a particular path in the website and log them back in to renew the session(because it has its own login session and its expiry is not in sync with the actual ...
1
vote
1answer
24 views

How to display articles based on group combinations of various group types?

I looked at the group module. Defining permissions based on user and entity memberships would suit my needs very well, but sometimes I would need a combination of various group memberships to define ...
0
votes
0answers
35 views

A field only visible when a node is being edited

I have a custom field which should be only visible when a node (an article) is being edited (and not shown when a new content is created). I'd like to avoid installing a module for this, so my ...
0
votes
0answers
15 views

How to order datetime items chronologicaly on save

Is there a module or a simple way to order a multipe datetime/datetime_range field chronologicaly on every save? I want to be sure that the last item is always the last one.
0
votes
1answer
21 views

How can I use a content type field on the body of the e-mail message template on the Webform module?

For usability matters, I would like to let the editor create his own confirmation message on my Event content type. So I create a field for that. I also have another field to select which webform is ...
1
vote
1answer
24 views

How to add a condition for an array on an entity query for a config entity?

I want to execute an entity query on a config entity type. However when I want to add an IN condition on a property which is an array I am getting an error. For example, I want to retrieve all user ...
0
votes
1answer
31 views

How do I convert "entity:node/9 in a link?

I need to get some values from a custom block I've created, and I am using the following code. // Get the block $block = \Drupal\block\Entity\Block::load('hightlight'); // Get the block content $...
-4
votes
0answers
24 views

Login credentials verify then logged out when using reverse proxy

I have Drupal 8 installed on Nginx server for a company. The company is using a reverse proxy. When I try to login, the credentials are verified and further page redirects to the site dashboard but ...