Stack Exchange Network

Stack Exchange network consists of 174 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
34 views

Custom content entity route or url alias

I'm not certain if I'm over-complicating something or just missing something or other. Essentially, and in addition to a separate admin view of my custom entities, I want to assign a URL to them at ...
0
votes
1answer
42 views

How do I render the main navigation menu?

In Drupal 7, we were able to render the main navigation menu onto a page outside the main Drupal folders by including bootstrap.inc and displaying it with this code. $menuData = menu_tree_output(...
0
votes
0answers
22 views

How to get all users with a specific permission

Is there a way to retrieve all users with a specific permission (eg "Post comments"). I only found the possibility to get them by their role: Drupal::entityQuery('user') ->condition('status', 1) -&...
-1
votes
0answers
83 views

Custom module route not being recognized [closed]

I tried to create a custom module with a custom block to learn module development in Drupal 8. This is supposed to be easy, but I keep getting the Page not found error message when visiting site/hello....
1
vote
2answers
43 views

Node Edit Form and twig template - confusion on where some values come from

I'm still pretty new to Drupal and had a question about the node-edit-form twig template. In them template, you can render {{form}}, {{form.advanced}}, and {{form.actions}} but when using xdebug, the ...
1
vote
0answers
41 views

Custom feeds plugin not discovered [on hold]

I am trying to create/work on an Address target plugin for the Feeds module. I have tried applying this Address target patch (shown below) from this related issue. However, the Address field on the ...
0
votes
0answers
42 views

Long running Migration tasks?

I have a use case where we need to seed Drupal content with content from another database. The only access to this database I have is via a Rest API. The official Drupal.org docs have a link to this ...
0
votes
0answers
24 views

How to set up an approval workflow using the Webform module

I've set up a form that a user submits to their supervisor for approval. I'm using a token to allow the supervisor to act on the form, but I don't want the supervisor to be able to edit the form. I ...
0
votes
0answers
26 views

Implementing document.ready() [duplicate]

I have some javascript code (as listed below) that I once used on a different non-drupal site. I would like to implement the same code on my custom theme. my research says i need to use drupal....
0
votes
1answer
24 views

Different Status Message templates for different pages

I have been trying to use different status message templates. But I do not know if we can use different status message templates for different pages. Is it possible? Right now, I am using status-...
0
votes
0answers
15 views

Get Arguments from URL for a view in which AJAx is enabled and filter are exposed

Below is my requirement I am facing an issue i want my exposed filter options to be dependent on the URL argument( i am using contextual filters), View is ajax Enabled, so i can not get the url ...
0
votes
0answers
19 views

Parameters or keys in $attachments['#attached']['html_head'][] in page_attachments

While debugging extra markup in head section I came across one attachment in adsense module. It is $attachments['#attached']['html_head'][] = [ [ '#tag' => '', '#theme' => '...
0
votes
1answer
23 views

Display database query results in custom module

I have a custom block and I'm able to update its content using #pre_render if I'm using basic text. However I'm unable to print database query results using the same way. Below is my code. function ...
0
votes
0answers
11 views

Key module: Real AES encryption how to make key file?

I'm on Windows 10. Trying to set up Encrypt with the Key module in Drupal. I'm using Real AES as the encryption method. How do I create the key file? It seems like I need to do that separately ...
1
vote
3answers
44 views

How to display node title using computed field? [on hold]

I have a computed field (text) where I would like to display the node title. I tried the following thing but nothing worked. $value = $entity->title; $entity->title; I referred 1. https://...
0
votes
0answers
12 views

Empty Body & Image fields after migration to D8

I was trying to migrate my websites from Drupal 7 to Drupal 8.... through the migration modules provided & web interface... It returned all Body & Image fields empty... It also gave many ...
0
votes
1answer
42 views

Why am I getting Your system schema version is -1

I'm trying to make database updates to my Drupal 8 website, but I keep getting the error Your system schema version is -1. Updating directly from a schema version prior to 8000 is not supported., ...
-6
votes
0answers
32 views

Custom Popup for product Details when click on Add to cart [closed]

I am using commerce module and bootstrap theme in drupal 8. When i am clicking on add to cart button it shows only message that "PRODUCT_NAME added to your cart" at the bottom of the pade. I want ...
-1
votes
0answers
31 views

Why is programmatically saving file object trying to delete the file?

I'm working on a module which consumes a web service and creates responding products. Products' image files are already on the file system and according to this answer, I need to first create a file ...
0
votes
0answers
20 views

How to specify the text format for comments? [duplicate]

I have created a custom text format for my comment type, where the user can have just few formatting tools when adding a comment. But in fact the user still can switch to Basic HTML under Text Format ...
0
votes
1answer
25 views

Search API autocomplete group suggestions

I am using Search API, Search API autocomplete and Solr search. I'we made a view with an exposed filer that has a funcionality of search api autocomplete. For now, autocomplete suggestions are just ...
0
votes
1answer
16 views

Groups and Private File Visibiility

I have created a content type Agenda - the body is paragraphs - there are two types: (1) Text and public files and (2) Private Files. The fields work properly - Anonymous cannot see Private Files. ...
-1
votes
2answers
46 views

hook_preprocess_field() $variables crashing while printing

I am trying to modify a file field value and add a download svg icon and then add it to a twig file by using a preprocess field. function myfi_preprocess_field(&$variables) { if ($variables['...
1
vote
1answer
24 views

Create a link using the render API

Back in Drupal 7, I was able to create a link (Ajax enabled) like this: $page['profile']['links']['videos'] = array( '#type' => 'link', '#title' => t('Videos'), '#href' ...
0
votes
1answer
19 views

Product category pages

I've had experience creating product catalogues in Drupal 7, but this is my first time using Drupal 8. I have some categories defined as a taxonomy, and I simply want to create category pages that ...
0
votes
0answers
23 views

sending a daily digest of content (add, edit, delete) actions by email

I am trying to send a daily digest of all the content entities that have been added, edited or deleted. I am working on Drupal 8 so most of the good modules that achieve that are unstable and ...
0
votes
1answer
53 views

Clean way to programmatically add attributes to a view field entity label link

I have a View that lists entities. One of the fields is the entity label field, which is set to output a link to the entity itself. I would like to add attributes to the <a> tag to grab later ...
0
votes
0answers
14 views

How to get field values into Twig of content type that's default view is Panels

I am having some fields attached to a content type. I used Panels and panelizer for default view. I am able to theme the whole page with panelizer-view-node--node--panels.html.twig (Panels is my ...
1
vote
0answers
21 views

Modify content before sending to browser

I want to modify all the <a href src of the Drupal content before it's sent to the browser. So far I have tried the following. public function onKernelResponse(FilterResponseEvent $event) : void ...
1
vote
1answer
43 views

Left join query between two custom tables

Hi I'm trying to create a join query between two custom tables. One is publish_options with a pubid as the primary key. The other is publish_options_bundles with a referring field pubid to the first ...
1
vote
0answers
10 views

'default_value' plugin does not run if 'get' returns null or empty value

I’ve got a D7 to D8 migration where I’m trying to migrate a field with a null value in D7 to a default value in D8. Process pipeline is similar to this: field_privacy: - plugin: get ...
1
vote
0answers
23 views

Alternative methods to creating Image Derivatives

I am importing many many images (300,000+). This number includes adding different crops for each image. I might be wrong, but it seems that to get Drupal to know that a crop style has been set, I ...
0
votes
0answers
31 views

Unable to determine class for field type during upgrade

I'm getting the following error when I am updating my site's core and contrib modules. I'm at a loss as to how I would go about finding the issue. I've gone to views.views.inc line 181 and looked ...
2
votes
1answer
37 views

Have Database Update ignore prefix for multisite with shared database

I currently have a multisite with a single database. Each instance has a different prefix for their tables, except for one with no prefix which is considered to be the main instance. Now there is a ...
0
votes
0answers
22 views

Alter form in form_alter with method

I have a form that I want to override title of textfield. I managed to do that with this snippet in _form_alter function $form['some_wrapper']['email'] = [ '#type' => 'textfield', '#title' =&...
0
votes
1answer
20 views

How can I redirect users to the order information after adding product

This is the goal: Once user click on a link, product needs to be added to the basket, and order information page needs to appear, so user can fill it. I've created a controller, and everything works, ...
0
votes
0answers
21 views

Field permission seems not working with multiple registration

Can I use these two modules together to create a registration form and limit access to certain fields? Module installed : field permissions multiple registration Wat is working ? The creation of ...
0
votes
0answers
43 views

Seach issue with Chinese words

I am using these modules: https://www.drupal.org/project/search_api_solr https://www.drupal.org/project/search_api_solr_multilingual Solr is version 4.5.1. It has issue with Chinese words and ...
2
votes
2answers
72 views

Embed a View into a render array

In Drupal 7, I used the following code implementing views_embed_view in a render array. $view_output = views_embed_view($view_name, $display_id, $uid); $page['profile']['bio_mobile'] = array( ...
1
vote
1answer
88 views

How can I apply logic in user registration welcome emails?

I am trying to put some logic into user registration welcome emails. Simple "if-then" logic, based on tokens. The tokens I use show up as expected, but both twig and php code gets sent as plain text....
0
votes
0answers
29 views

Debugging strange memory overflows on Pantheon

We have a Drupal Commerce site on D8.6.7 running on Pantheon Performance Small servers. We do a bit of side processing besides normal e-commerce stuff like syncing up data, collecting emails, etc. ...
1
vote
0answers
46 views

How to make use of the render placeholder system for cacheablejsonresponse?

I have custom controllers which provide CacheableJsonResponse responses. Those responses are quite heavy to build (couple of seconds), so I want to build them better. I build those responses by ...
5
votes
1answer
43 views

How to discard unsaved changes to a view when editing it leads to a WSOD?

This is one of those times when I tried to add something and realized that I've got it applied to all displays. This time it was a vocabulary filter, so I clicked cancel and it didn't register so I ...
0
votes
1answer
23 views

Rename a taxonomy vocabulary during migration

I'm working on a custom migration for taxonomy vocabulary and I was wondering if there is a way to rename a vocabulary during migration? my d7 vocabulary name is staff and I wanted to be migrated to ...
1
vote
1answer
23 views

How can I theme the Captcha/ReCaptcha error message?

I'd like to change how the error message is when a user fails the recpatcha. Currently it is just plain text on top of my form but I would rather have it be a modal or at least be in red. I looked ...
-2
votes
1answer
40 views

How to submit form selecting an option in a <select> defined in inline_template?

I have this custom form in which there is this: The corresponding code: $form['actions'] = array( '#type' => 'details', '#title' => 'Tâches associées', '#open' => TRUE, ); $...
0
votes
1answer
47 views

How can I upload an image for a specific image style?

I'm trying to support retina on my site, so I set up a 2x image style and a 2x responsive image style. Now the generated HTML for images looks something like: <img srcset="/sites/default/files/...
1
vote
0answers
34 views

How do i skip a row from a CSV based on the value of 2 fields within the CSV file?

I have a CSV file that contains about 200 records/rows. ID, OrgID, EstabID, OrgName, Address 1, AB234, AB234, ABC corp, 123 Main Street 2, AB234, 8989, ABC Corp-West, 456 Better Street 3, 4858, ...
1
vote
0answers
28 views

Make EntityQuery Block Table sortable

I made a custom EntityQuery Block Plugin with a table output and managed to make the headers sortable using this $header definition: $header = [ 'title' => [ ...
0
votes
0answers
18 views

Make Views table header with multiple values field sortable

Following this answer I was able to create a sortable Views table using Paragraphs relationships. I need to do so to make the related values sortable. So I try to make a reference to the second value ...