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
18 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
49 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
54 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
44 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
13 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
34 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
38 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
21 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
48 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
74 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
91 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
34 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
49 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
47 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
24 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
35 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
29 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
19 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 ...
0
votes
0answers
27 views

Username is generated after update user informations

in a drupal 8 project I've a problem with users usernames, when updating a user from BO and save change the username changed to be email_registration_{a generated key} this happen even with admin user ...
0
votes
1answer
19 views

Dropbutton in Twig

I'm adding a few links to a views twig template file and I would like to render them as a dropbutton. For example ... Is this at all possible ... to render this in twig? If this were a form, I ...
-1
votes
0answers
10 views

Add a [non field] value to an entity before being saved

In hook_entity_update i have a function that logs changes of certain nodes. Now I want to change a field value and than save an entity of type node programmatically. $project->set('field_foo',$bar); ...
0
votes
1answer
57 views

Return data from WebformHandler to Controller

I created WebformHandler where I need to get data entered in the form on submit. It's something like this: <?php namespace Drupal\xxx\Plugin\WebformHandler; use Drupal\Core\Form\...
0
votes
2answers
47 views

Add external CSS file with custom backend setting

I'm trying to add a external CSS file. The client wants to be able to change the url from the backend. Creating a backend settings form is not an issue, but I can't seem to get the file loaded in the ...
1
vote
1answer
23 views

Admin block listing showing unwanted debug info [closed]

Suddenly my Drupal 8 admin panel is displaying some unwanted objects/arrays in different places. Below is a screenshot of the block layout page. This is a localhost site that is not available to ...
0
votes
2answers
36 views

How do I programmatically get the link for a webform submission?

I have managed to create a table of webform submissions of a particular type, thanks to the answer from a question posted here. What I would like to do now is add a link for each webform submission, ...
0
votes
0answers
23 views

How can I preprocess entity references?

I have a module with a custom entity (sample) and a hook_preprocess_sample(). I have another custom entity (retain) that has an entity reference to sample. The preprocess hook looks in the database ...
0
votes
0answers
15 views

E-mail notifications to specific user roles based on events in calendar

I'm looking for a way/module to send an e-mail notification to users if an event is added to a calendar. Also a weekly reminder of the upcoming events that will take place next week. I'm not sure if ...
1
vote
1answer
31 views

How do I download a dynamically-created file in a form submission?

I've got a form that builds an array of data. On submission, it updates a table displayed in the browser, using AJAX; that works fine. I want a second submit button that downloads the same data as a ...
-1
votes
0answers
14 views

How to process OffsitePayment without commerce_checkout module?

I use Drupal Commerce as backend for decoupled site and application. Basically I don't need commerce_cart and commerce_checkout module because end users interact with decoupled Single Page Application....
0
votes
0answers
20 views

Limit validation errors on ajax change and autocompleteclose

I have modified the node add and edit form for one of my custom types, adding a few ajax callbacks: a couple are on the onchange values of text fields, one on the autocompleteclose of an autocomplete ...
2
votes
1answer
37 views

How to have the autocomplete option with ajax in a text field?

I am struggeling with creation of tetxfield with autocomplete option for my Drupal 8. My Drupal website is multilingual, and on one view page we present some content in Default language, by typing in ...
0
votes
2answers
87 views

Override a node template suggestion with template in custom module

We have a content type that is added to the drupal system Programmatically when we install one of our custom modules. Essentially the module handle incoming property data from a 3rd party and creates ...
0
votes
1answer
51 views

Why does PhpSpreadsheet fail to identify my Xlsx file in public://?

I'm working on a module that imports a Xlsx file and inserts the rows to database. Everything works fine, except PhpSpreadsheet throws the error Unable to identify a reader for this file when my ...
-2
votes
0answers
19 views

Libray thumbnails not showing

I'm setting up a site in Drupal 8.6.4 using the Media and Media Library, but I'm having issues with the thumbnails not showing when browsing or adding new images. It's a clean installation of both ...
1
vote
1answer
41 views

Changing the label of Change Password Form

How to change the form label from Password to New Password and Confirm password to New Confirm password on THEME_form_user_form_alter(without changing any twig files)? I had tried kint($form['account']...
0
votes
1answer
26 views

Add class to Previous / Next Button

In Webform 7 I was able to add classes to the Previous / Next Page button but can't seem to be able to do this with Webform 8. Is there a way to do this?
0
votes
1answer
19 views

Webform Address Element and Canada provinces

In the webform (drupal 8) module I am using the address element and notice that the state/province field does not contain any Canadian provinces - only US States and Territories. Where can I add the ...
0
votes
1answer
21 views

How to make custom blocks print unsanitized markup

Goal: I like to create a block to display phone no and a link as shown below: Structure > Block layout > custom block > Add custom block, added this: When I go to my site, I see this: How can I ...
0
votes
0answers
17 views

Custom views filter for custom view field

I want to created a custom views field, following this tutorial: https://www.webomelette.com/creating-custom-views-field-drupal-8. This custom field counts and returns the number of referencing ...