All Questions

1
vote
1answer
688 views

How do I create product variants?

I have a product (for example, "Desk") which has two attributes (size and life). Size has the values small, medium, and large. Life has the values 7 years and 10 years. The price is different for ...
0
votes
0answers
4 views

settings.php.lock error

I've been working on a Drupal 8 site for a month or so now and development have been progressing nicely until a week ago. It looks like the issues started at just about the same time that the website ...
0
votes
1answer
7 views

Display Suite Token Fields in Custom Block Types

I want to add a Display Suite token field to my Custom Block Type. I have a custom block type. I created a token field with Display Suite Entities: Block Content Limit field *|* or link_card|* where ...
-3
votes
1answer
14 views

Getting PHP extension “gd” and Database support disabled error while installing Drupal 8

I am trying to install Drupal 8.7.3 on my windows machine through the Xampp (PHP 7.3.6). But I am getting following errors: Errors: Please see the screenshot: https://snag.gy/06sMEa.jpg Tried to ...
11
votes
4answers
2k views

How can I get a list of content types with drush?

How can I get the existing content type list with drush? This will allow me to quickly produce a list. I've tried with: $ drush @d6 @sites genc --types But I need the devel_generates module ...
1
vote
1answer
440 views

Change the default timezone variable_get from views

What I want is to change the way drupal views get the site's timezone setting. I want to set it manually in code. Searching through the files I noticed that the function "views_get_timezone()" in ...
0
votes
0answers
21 views

Remove the cache for a particular Twig file

I'm showing currently logged in username in header. But it's showing already cached page. I know, I can disable cache for particular page in module using \Drupal::service('page_cache_kill_switch')-&...
0
votes
1answer
348 views

Get a views results programatically

I have a page with a view on it and some exposed inputs. I need to get the results programatically. I can load a view programmatically no problem but setting the exposed input has not been working. $...
0
votes
1answer
557 views

Add a checkbox on registration page for subscription newsletter with Simplenews

I'd like to add a checkbox for subscription to a newsletter on the user registration page. I'm using Simplenews. How could I do that?
4
votes
1answer
57 views
+50

How to disable creation of node revisions on programmatic node update?

I added a field of type computed field to existing nodes. It's required to re-save the nodes to set/update computed field values. As I do not want to update the changed timestamp I decided to not use ...
0
votes
1answer
476 views

How can i add our own field in Ubercart billing address?

I have used Ubercart in my project. I would like to add my own one field in Ubercart Address field. How can I? Does any one had same experience?
0
votes
0answers
9 views

Invert facet setting for single option on search

What would be a good approach to invert a single facet option? Is this even possible by the system? This is what I have in mind: Let's say we have got a bunch of facet elements to select from on a ...
0
votes
0answers
12 views

How to load json File array and store in a field in drupal8?

I'm receiving my JSON data as: $someJSON = '[{"PhotoFid":"PhotoFid" : ["8444","8445"]}]'; How to pass this file ID into my node field? $node->set('field_photofid', $someJSON); -- ...
0
votes
2answers
1k views

How to tell Drupal to use tpl file from my module?

I have a custom module and placed comment.tpl.php here: /sites/all/modules/mymodule/comment.tpl.php But Drupal is not looking for that file in my custom module directory. How can i make it work?
1
vote
1answer
466 views

May I use Bootstrap-CDN on Subtheme for production site?

Follow up of my other question with less files ;-) As I don't need de less files on production site, could I then switch to BootstrapCDN for js files? Or would it overrule style.css too? Thx for ...
0
votes
0answers
11 views

How can i add text custom field on product detail page?

I want to add custom text field on product details page Where user enter some text . Which text will be shown on cart and checkout page. I have added the text field on product but it is not saving ....
0
votes
1answer
458 views

How to setup a rule to redirect to shopping cart?

I am trying to create a rule that after a user creates an account they are sent to a Checkout page that will eventually have them pay via PayPal ( I am using the Commerce Module ). My steps so far ...
1
vote
3answers
1k views

Field collection translation

My site has a number of content types that have Field Collection fields. All of these field collection fields allow more than one value. I've marked the content types as translatable, and the field ...
0
votes
1answer
27 views

Performance for file serving and storage [on hold]

I intend to allow users to upload images to my website, but I'm concerned that Drupal's default handling of files might not be cut out for storing and serving potentially thousands of files without ...
3
votes
1answer
1k views

Is there any documentation for the UUID module?

I think I need to utilize the UUID module to make universal ID's for some taxonomy terms. However, after installing the module it doesn't seem to do anything and the configuration interface has only ...
0
votes
0answers
6 views

How do I email the file?

I am trying to send files 'purchased' with commerce file as HTML mail. I've created a rule that loops over the line items (commerce-order:commerce-line-items). I would like to get access to the ...
0
votes
2answers
17 views

Customize the title field

I want to display updated content's field with views block on the front page. 2019/06/20 newly posted content1-title 2019/06/19 updated content2-title The words updated and newly posted before the ...
0
votes
1answer
9 views

Using pathauto for taxonomy pages

I'm using pathauto on a D8 site successfully for pattern type Content using a pattern like this: [node:content-type]/[node:title] But I'm not having any luck at all when trying to use it for pattern ...
1
vote
1answer
349 views

How can I disable image resizing in CKEditor?

Our site is responsive and when editors use the resizing handles after uploading an image into the editor, it puts in fixed width and height on the image. We don't want them resizing images at all, ...
0
votes
0answers
14 views

Which files do I need to edit to alter webform #states with hook_form_alter?

I need to create #states conditions between either the fields in any one element in a webform or across other elements in the same form. I'd hoped I could do it via the WF yaml editor but it seems I ...
0
votes
0answers
30 views

Is it possible to make a site aware of entity schema changes that are managed externally using SQL-based storage?

Consider the following situation: A Drupal 8 site using native SQL-storage (MySQL) custom_table is added to the same MySQL host as Drupal, either as a table in the Drupal system DB or as a table in a ...
2
votes
1answer
455 views

Changing group visibility needs group content to be resaved when group content visibility field is set to “Use group defaults”

Drupal Commons 7.x-3.2 Organic Groups 7.x-2.1 Content type: Mygroup Field: Group visibility - value: Public Content type: Mypost Field: Group - default value: Mygroup Field: Group content visibility ...
0
votes
0answers
11 views

Update the actual file associated with a file entity while keeping the fid?

Media module provides a generic.png file that it copies into /sites/default/media-icons/generic. That file is used on my site ~300 times, but I'd like to replace it with another PNG. Is it possible to ...
0
votes
0answers
6 views

Cannot get form values set in a ajax callback

In the hook_form_alter, I add 3 textfield form elements and 1 button with ajax callback: function zwznertags_form_alter(&$form, &$form_state, $form_id) { if($form_id == 'book_node_form') { ...
0
votes
2answers
447 views

How to add destination parameter in hook url_inbound_alter

Hi I have used hook_url_inbound_alter to alter the URL. When I access user/%/order anonymously it should redirect ti user/login. I have used below code function module_url_inbound_alter(&$path, ...
0
votes
3answers
521 views

D8 HTML tags from field converted to special characters when printing variables

I have WYSWYG editor enabled on my fields when there is html in these fields. When I print out the variables in my template, the html gets converted to special characters. for example my print ...
3
votes
1answer
437 views

Why does a header set via drupal_set_header() revert to text/html?

I'm using the views_rss module in Drupal 6. Whenever I build out a View using this plugin, the following header is sent in a template_preprocess function: drupal_set_header('Content-Type: application/...
-2
votes
0answers
15 views

I am not able to edit a panel [on hold]

I have a Drupal 7 panel node. I have few regions in the panel content, but I am not able to edit any of those regions. In Chrome console, I see the following errors. Refused to apply style from '...
0
votes
0answers
4 views

Drupal 7 Views: How to sort views table fields programmatically using hook_views_default_views()

I have created all of the view configurations and exported the views_default.inc. After I re-imported my custom module the sorting table fields isn't working and needed to be configured manually again....
1
vote
1answer
538 views

How to properly compare values of two identical entities?

I have a custom entity that is not revisionable and I need to store any differences made by the user - and only differences, so if nothing has changed there should be no entry. I am doing this in ...
0
votes
0answers
8 views

Rules Once per day - Can't figure out the Component Selector in a very simple rule!

I have created a component with action set and test it with execution and it works fine. Then i created a very simple rule: 1- event: one per day 2- no conditions 3- trying to fire the component , but ...
0
votes
0answers
6 views

Calculate values in or from custom composite field in Webform 8

Is it possible to use computed token or twig to calculate custom composite fields? I have a custom composite field that asks for length, width and height. I would like to be able to add a 4th field ...
0
votes
0answers
27 views

Delete records from database pressing a button in twig

Drupal version: 8.7.x I created a module that retrieves meals based on the given ingredients. I display the ingredients with a delete button and the meals underneath them. However I don't know where ...
0
votes
0answers
16 views

Format Json Responses as Camel Case

Currently our json responses are not formatted at all, we are using the JsonResponse class to return a status code with content: public function getMarkets() { $response = $this->...
0
votes
0answers
20 views

How do I tell logging to ignore messages that I have seen?

I've got a couple of log messages that are coming out every few minutes. I can't fix them as they are just part of the system. How do I tell watchdog to ignore them?
0
votes
1answer
24 views

Drupal GraphQL query not returning data

I have 5 different content types and I've added content / nodes. I'm using graphQL to fetch the data, however in 1 of the content types the data is not being returned. This is the latest content type ...
0
votes
2answers
453 views

How to get selected Value in the listbox by using form api

I have created a form with fields titled State and City. After selecting the state's appropriate city records, they will be loaded into city listbox. Until now they were working fine, but after ...
0
votes
2answers
16 views

How can I programmatically add webform elements to an existing webform?

I have a webform that is very simple, it's a questionnaire. It is attached to a content type called "event". e.g. discussion_1: '#type': likert '#title': 'Discussion 1' '#questions': '...
0
votes
0answers
7 views

How to override confirmation messages when saving or updating/deleting content in Drupal 8?

I wanted to override status message after taxonomy term updated/deleted. I m trying to do with hook form alter as function atlas_common_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $...
0
votes
1answer
515 views

Update theme table using callback function in Ajax

I have two elements in my form: a select and a table element. Everytime onchange event is triggered on select element, I want to update the values in my table. I want to do query and change the values ...
0
votes
1answer
11 views

how to remove duplicate in view search API?

I get some duplicate article for the site. How can i remove the duplicate? There is no distinct setting. Here is the setting of view
2
votes
2answers
7k views

Twig get value of field in entity reference

i have a content type "actuality" with a reference to an other content type "event". In "event" i have a "field_date" which i want to print into my "actuality" node. What is the best way to do that ? ...
1
vote
1answer
479 views

How to import a Google calendar so that it can be styled?

I am wondering if anyone has any ideas regarding solutions for a custom/styled Google Calendar embed on a Drupal Website. I have a client that would like their events updated via Google calendar but ...
1
vote
1answer
47 views
+150

How can I conditionally alter search API relevance score?

I must be missing some core concept of search API somehow, but I am stuck. The goal is to alter search API results depending on a flag, like Give flagged products in search API a higher search score? ...
1
vote
1answer
502 views

Sending email notifications to Webform submissions using Rules, Views and Webform

I am trying to create a rule that will send an email to a list of webform submissions, notifying them when new content is created. So far, here's what I have: Event: after saving new content of type [...

15 30 50 per page