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
0answers
5 views

How can I filter based on unique taxonomy term values?

I have a content type "book". One of its field "field_language" referencing to "language" taxonomy term. field_language can have only one value. Consider this is the ...
0
votes
1answer
10 views

Node reference field autocomplete and allow multiple selections in views

I recently pdated my Drupal core to 8.9 and suddenly a functionality stops working. I have a "Recipe" content type, it has a field of "Category" (field_category) which is Entity ...
0
votes
0answers
6 views

Using group module, get SUM from the groups content in a view

I am using the group module and each group can create "tournaments" content. Within that content is a multivalue paragraph that contains a user id and a number field. Using views, I would ...
-1
votes
0answers
18 views

Views "freezes" SQL: strange bug since D7 and till D9

Sometimes I face with the following problem: views "freezes" SQL query. So I change filters, add/remove fields, but I see the output as well as SQL query is the same. The output can become ...
0
votes
0answers
29 views

Is there Drupal Twig built-in ability to get content of page

Is there built in Drupal Twig ability (tag) to get content of another website's page like file_get_contents() or cURL do in PHP? Under "built in" I mean without adding a PHP code to a ...
0
votes
1answer
30 views

Why do some Drush commands only run from docroot?

Wondering if anyone knows why some Drush commands (with file parameters) only run from the docroot and won't run from the project/composer root? Commands such as drush sql-query and drush locale-...
1
vote
1answer
24 views

Loading a field value within a twig template

I'm building a multi-country website using Drupal 8. The company would like to have each region manage their website independently but still have a "global" site. I'm building a theme which ...
0
votes
1answer
52 views

Middle part of a page disappears and appears again after flushing all caches

Sometimes middle part of some page at our website may disappear and only header and footer are still displayed. The problem is always solved after flushing all caches. Our html.html.twig loads ...
-2
votes
1answer
33 views

Pass multiple value in an session

How we can pass multiple value in an session variable $session = \Drupal::request()->getSession(); $session->set('session_anme', $variable_name ++); if I add value 1 and 2 and 3 The value ...
1
vote
1answer
9 views

Disable certain rows of a Entity Reference Source view

I have a field that is an entity reference on a piece of content. I created a view that is an Entity Reference Source and set the reference type on the field to that view. When editing the content, I ...
0
votes
0answers
8 views

Creating tabbed config settings

I'm trying to create a tabbed configuration page for my custom module, although I can't see a lot of information on exactly what is supposed to be done. I've seen this page but it's not exactly in ...
0
votes
0answers
23 views

How to access data in Twig in module extended template

I'm new at developing Drupal. I'm using Drupal 8 and I want to display datetime fields in a special way. Here is how my module_name.module and template file looks like: function module_name_theme($...
0
votes
0answers
14 views

How to use views query alter to show filtered content according to tags

I am new to Drupal and started learning hooks. I am trying to use hook_views_query_alter to show related content to user according to it's preferred tags. function related_content_views_query_alter(...
1
vote
0answers
17 views

Restrict a Media field to allow selecting only a certain file extension in an existing Media Type

Is there a way to restrict a Media field using an existing Media Type (File) in a Content Type to permit only a certain file extension in that instance? In particular, I need a subset of the permitted ...
1
vote
1answer
20 views

Error when trying to view revisions

Using Drupal 8/9. When trying to view previous revisions I am getting the following error: Error: Call to a member function getType() on string in clc_d8_theme_theme_suggestions_page_alter() (line 13 ...
0
votes
2answers
41 views

How to cache View block by content language?

I have a very simple (block) view to list a node's title. This view has an id from url contextual filter and a single filter to filter on Content language set for the page (by URL prefix). This block ...
0
votes
0answers
9 views

Render a commerce checkout pane programmaticaly

I need to render the order review pane in a (ajax) controller. What would be the simplest way to programmatically get the order review pane markup ?
-1
votes
0answers
7 views

Add to Calendar Feature

I'm trying to create a button where site visitors are able to add events to their own calendar through the use of an .ics file. I know there's the "AddEvent" service, but are there any ...
0
votes
0answers
14 views

Does Views block caching include language in cid?

I think this is likely a core bug (in which case I know it is not meant for Drupal Answers) but thought I would check here first to see if possibly I have just missed something in configuration? I ...
0
votes
0answers
16 views

How to set an encrypted file field's value programmatically

I'm trying to set an encrypted file field's value programmatically. I'm using Encrypted Files module. I have successfully configured a file field, and it works for the contents created using the node ...
0
votes
0answers
18 views

Can't find "starts with" for Filter criteria In Views (indexed field for taxonomy)

I created a view using indexed fields (search api) to list a taxonomy. I used the rest export checkbox so I have an api endpoint for my view. I am not able to find a filter criteria "starts with&...
2
votes
1answer
40 views

Safely save data to the order in onNotify()

I'm new to Drupal and have to make an off-site payment gateway (with Drupal Commerce 2). It all works, but sometimes it doesn't. The remote payment provider's server sends notification requests to the ...
0
votes
0answers
29 views

Managed file in theme config not saving

In my theme settings under 'admin/appearance/settings/mytheme' I am trying to add an image field. I have added the following to mytheme.theme function mytheme_form_system_theme_settings_alter(&$...
0
votes
1answer
27 views

Get the value of Entity reference revisions field in order email twig file

I want to get the entity reference field value in order email. Name of the entity reference is field_price_value and called paragraph field is field_price now I want to get the field price value I ...
0
votes
0answers
27 views

How can I make a white screen of death less ugly

A project I'm working on requires custom modules, and I'll be the last person to claim that I am perfect. I've gone through and removed as many possible php errors and causes for WSODs that I can ...
2
votes
1answer
33 views

Custom AJAX Response not firing on Flag action

I'm trying to run custom javascript functions at the same time as people interact with certain flags on my site, I have followed this tutorial on how to respond to both Flag/Unflag actions, and this ...
1
vote
0answers
15 views

Disable the "Add Link" button in entity.menu.edit_form for certain roles

I'd like to hide the "Add Link" button in menu.edit_form for certain roles. Running dpm($form) for this form I can't find that button in there. In core there is menu_ui.links.action.yml with ...
-2
votes
0answers
19 views

Date format for date type fields

I am using a date type fields in a custom form after click on the date pop up I want the date format in mm-dd-yyyy or yyyy-mm-dd but currently its showing dd-mm-yyyy. $form['start_date'] = [ '#type' ...
-1
votes
1answer
26 views

Add a date pop in a field in custom module

I want to add a date pop in a custom field in custom form in custom module This is the library file: custom_lib: css: theme: css/datebasesorting.css: {} css/datatables.min.css: {} ...
0
votes
1answer
24 views

Is it possible to render a region in a menu template?

In my Drupal 8 theme I have a template called __menu.html.twig which gets called in my page.html.twig I am trying to render a region within the __menu.html.twig where I can place blocks. I have ...
0
votes
1answer
29 views

How can I print view/edit/comment links?

UPDATE: For whatever reason, the fields started printing using {{ fields.view/edit/delete_node.content }}. I'm not sure why it wasn't printing initially. ORIGINAL: I have a view that uses the "...
0
votes
1answer
9 views

Add a second RulesAction to a custom module

I created a custom module containing one Rules Action that works perfectly. I tried adding a second by creating a second php file in the MODULE/src/Plugin/RulesAction folder, with the names and class ...
0
votes
0answers
10 views

How to word-wrap field label from a view

I'm still new to Drupal views, how do I word-wrap a field label from a Drupal view? I know there are style settings within the field and there's one called, "Customize label HTML". Do I just ...
0
votes
1answer
37 views

Send email to author when content is published through scheduler

I have used Scheduler module with content moderation integration to publish a content automatically. It is perfectly working using the module. Now I want to add a functionality that once the content ...
1
vote
1answer
53 views

how to convert date into timestamp using timezone

I am using strtotime to convert date into time stamp but its does not work correctly. I know its relatively to time zone. My drupal store time zone is denver. I am not sure why its not showing correct ...
0
votes
0answers
23 views

Better exposed filter for block view doesn't appear

I created a new content type and a display page to show a listing of all my new content type pages. I'm trying to create a better exposed filter block on my page for the sidebar, but when I try to add ...
0
votes
0answers
11 views

Display Default and filter data of a form on a same page including form

I want to show the date without filter a form that is default data and if user apply for filter and filter should be shown rather to default data including form at the top Basically I have created a ...
1
vote
2answers
208 views

How can I force user logout from a JavaScript library in a custom module?

I've written a custom module for Drupal 8 to monitor user device location frequently. If a user goes out of an allowed zone boundary, I need to force logging the user out of the website. I created ...
0
votes
0answers
32 views

Apply an AND condition in WHERE clause

I want to sort view results basing on the selected start and end dates using exposed filters. So I want to AND the conditions in the WHERE clause. How can I do this? I tried the following code, but it ...
0
votes
0answers
35 views

Custom breadcrumb navigation, but url link shows page node

I'm pretty new to Drupal and I'm creating a new content type. The site uses custom breadcrumbs built using BreadcrumbBuilderInterface for certain content types which was built before my time. I'm not ...
1
vote
1answer
62 views

How to exclude taxes from total prices but still show the tax during checkout

So I create a tax type Custom and set the rate 18%. The checkbox Display taxes of this type inclusive in product prices. comes in checked by default. If I leave it like that, cart shows product price ...
1
vote
1answer
30 views

Unable to use SameSite=none with secure attribute, using Symfony\Component\HttpFoundation\Cookie to create the cookie

I am trying to create a cookie in Drupal 8.9 with SameSite=none with secure attribute, using the Symfony\Component\HttpFoundation\Cookie class but I am unable to do so as the class doesn't allow the ...
0
votes
0answers
33 views

How can I conditionally display fields based on the same paragraph radio field value?

I have added a paragraph where I want to use a radio button to conditionally display text fields from that same paragraph. My radio values are: Select discount in amount -> if checked, then ...
1
vote
0answers
49 views

Why are the images referenced using a relative path instead of an absolute path?

I have installed my Drupal site on my localhost under a path like /websites/mysite/drupal. Most files get loaded correctly, such as those at /websites/mysite/drupal/sites/default/files. For some ...
2
votes
1answer
25 views

Number field type for specific format

I have to store number data into database in format xx-xxxxxx-xx for example I have xml data in format: ISBN="10-000000-701" ISBN="11-000000-002" ISBN="11-000000-004" and ...
1
vote
0answers
73 views

Injecting service into another service does not work

I have to override pagecache service in order to have some custom validation logic to be executed for anonymous users. The issue is that I have the domain module's service domain.negotiator to be ...
0
votes
0answers
17 views

What is langcode in config export used for?

When exporting configuration into .yml files with drush csex, some files have a langcode property set. After some weeks or months of working with the system, they sometimes disappear in some files ...
0
votes
1answer
38 views

How to remove addtoany js for a particular node page?

I need to unset addtoany module js for a particular node. For that I have implemented function theme_name_js_alter(&$javascript) { if(\Drupal::service('path.matcher')->isFrontPage()) { ...
0
votes
1answer
26 views

Content type field to include both media entities and links

I'm new to Drupal and I'm creating a new content type. I know there's two separate fields for media and links, but is there a field that include both? For example, the field is called "News ...
2
votes
0answers
33 views

What methods are available to resolve "The node.field_name field needs to be updated."?

When Drupal status report says field “field_name” needs to be updated I found out that it sometime hard to resolve. In the past we used to have entup but that was removed. The following works in many ...

1
2 3 4 5
318