All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Commerce 2 order receipt email – how to hide and then output later the shipping method in the twig email template?

We have a custom TWIG email receipt template that is outputting the shipping method from the shipping_information variable. The TWIG template is using the default code to output the shipping ...
0
votes
1answer
18 views

Can we display region label from Layouts?

We have a MYTHEME.layouts.yml file which defines regions... layout label: 'Layout Name' path: templates/panels template: layout-template default_region: theregion regions: theregion: ...
0
votes
1answer
26 views

Where do I put configuration files for testing?

Hopefully, this will be a simple question. I am writing a kernel test for a class, called FooConfig, that reads from a configuration file. For the purpose of facilitating this test, I need a ...
0
votes
1answer
19 views

How to display content for a Taxonomy Vocabulary?

I am using Drupal 8. I have a Vocabulary called Fruit which contains terms: Apple Banana Orange I can go to page for term Apple and I can find all the content which was tagged with apple there. I ...
0
votes
1answer
26 views

Can PHP class extends multiple interface? [closed]

I thought PHP doesn't support multiple inheritance, that why we use Traits. But I found this on Drupal.org. I don't understand how this multiple inheritance works. interface VariantInterface ...
0
votes
0answers
25 views

How can I update an user field via JSON:API?

How do I update user field via JSON API with D8? EndPoint:https://domainname.com/jsonapi/user/user/ Method:PATCH Request Header; Accept:application/vnd.api+json Content-Type:application/vnd.api+...
0
votes
0answers
19 views

Revisions Tab is not visible

I updated Drupal to 8.6.16 version and after that Revisions Tab is disappeared. Actually, all revisions are saved fine and I can see them because I have access to the page "xxx/revisions", but I don't ...
0
votes
0answers
19 views

How can I login via REST?

I am trying to login via REST API in Drupal8. Many people in the web are suggesting to post in the below format: POST: http://example.com/user/login?_format=json Content-type: application/json Data:...
0
votes
0answers
16 views

How to display a set of custom contents in Taxonomy URL?

I am working with Drupal Commerce using core Drupal 8 and the type of data I am using is Product. When I tag a product with a taxonomy term and visit page for that taxonomy term, I don't see anything. ...
0
votes
0answers
30 views

Error “The value you selected is not a valid choice.” in drop down list

I want to list node titles in drop-down list programmatically. I have done below code in form_alter hook. function product_custom_form_alter(&$form, FormStateInterface $form_state, $form_id) { ...
0
votes
0answers
18 views

I want to override page.tpl.php to work for all pages or custom urls

If i override page.tpl.php to page--front.tpl.php which is working for only front page of site. But i want that overrided .tpl file should work for other urls as well. how can i create ? is there any ...
1
vote
1answer
38 views

How do I add default header and footer regions to my site?

i have added regions in my theme.info file. now i want to add default header and footer with logo in all the pages of my site.This is my page.html.twig <div class="layout-container"> <...
0
votes
1answer
42 views

DrupalSettings are not passing the values from block to js?

I have been trying to pass the variables from block to jquery. In Block.php, return [ '#theme' => 'block--exampleblock', '#value' => 'test', '#attached' => [ '...
0
votes
0answers
36 views

Display block when boolean field is checked

I currently have a custom block (created programmatically) thats displays on my news content type (via Layout builder). The code I used for block is below. class NewsButton extends BlockBase { /**...
0
votes
1answer
13 views

Changing the html and order of system fields(pass/email/locale/etc) of user edit form

I have changed a number of forms accessible by users to fit a certain style. To do this I used an #after_build function that adds prefixes and suffixes to fields, as well as a bit of javascript. This ...
0
votes
0answers
17 views

Getting a book tree/menu programatically

Given a node ID, how do I display the outline of the book it belongs to? I'm dispatching the pages of the book from a custom, variable, route (and not the alias of the node) so the default book ...
0
votes
0answers
13 views

Views deleted after changing the content field

It happened three times so far. After deleting some field and replacing them with other in a content type some pages are missing or restarting. Of course deleted field were used on that deleted pages....
0
votes
0answers
23 views

'Drupal\user\EntityOwnerTrait' not found

I upgraded from 8.6.15 to 8.7.0 and now my page will not load. I've searched for the error I'm getting (see below) but the results do not seem to apply to my situation. I'm using installatron from ...
0
votes
0answers
18 views

How can I stop a feeds import process?

I created a csv Feed that would create new content. I uploaded the csv file and started an import job. Unfortunately, the csv file had some headers that did not quite match those defined in the Feed....
0
votes
0answers
19 views

How do I prevent NaN from appearing in the drupal form field?

For this field, if a user enters a space and leaves the field, the field fills with NaN, any idea how I can prevent that from happening? if (variable_get('variable', DEFAULT) === 1) { $basics_form['...
1
vote
0answers
28 views

Delete user in transaction

I'm having trouble figuring out why the following code isn't working in Drupal 7. _queue_processor is a cron queue processor function: function _queue_processor($uid) { $transaction = ...
1
vote
0answers
12 views

How to mark related entities as dirty in search api module when edited?

I am using Drupal 7 with the search api. I understand that one of the 'common pitfalls' of the search api is 'Changes in related entities don't lead to re-indexing'. I am bringing in a field called '...
0
votes
1answer
35 views

In Views, display additional fields from an entity reference

I have a content type with a field that is an entity reference to another content type called "URLs", and the "Allowed number of values" is set to "Unlimited", meaning that one record can have ...
0
votes
0answers
10 views

Entity Translate won't show translations on template overrides

I have set up entity translate and it lets me add the translations so they are stored in the DB. But when I click on the translated page, all I see is the orginal language which is English. So I these ...
0
votes
0answers
22 views

How to retrieve information from the parent store of a product?

I have a site with Drupal 8.7 and Drupal Commerce 2.14 I created a template for my stores : commerce-store--professionnel--full.html.twig And I added this code : <div class="col-xs-12 col-sm-12 ...
0
votes
0answers
9 views

Default contextual filter to current user but prevent altering the value in the URL

So I have the following content types: User: The default drupal user Document: Title Body ... Linked User: Entity reference (User) Please note that the Linked User does not reference the Author of ...
0
votes
0answers
27 views

When changing values in the database why does this not affect the view?

edit: How could i use Views bulk operations for the change of a field's value? Instead of directly editing mysql? I have a content type, f.e mycontentype, which has titles, like: Title - library1 ...
-1
votes
0answers
6 views

Copy billing to shipping fields error when auto insert

When on the shipping page on checkout, and both billing and shipping fields is empty. If i do this: Making full name billing field active, My browser (chrome or firefox), opens a box with my ...
0
votes
0answers
21 views

How to add layout or panels to my custom page?

I'm creating custom layout to use for my custom page that has 4 horizontal regions. But i'm not sure how to fetch the layout in my custom page.i added below code in my mycustomtheme.layouts.yml ...
0
votes
1answer
18 views

Is there a way to create hierarchical taxonomies checkboxes?

I have an issue where I want to keep sub category inside a parent category. Say, for preferred vehicle I want a checkbox like this in node creation form []Car []Volkswagen []Toyota []Bike []...
0
votes
0answers
16 views

TWIG Template file passing variables

Basically I'm creating a bridge status monitor. I've built this within views. There are 3 main options, Open, Closed, Restrictions (with conditional logic showing these in the form). I managed to ...
0
votes
1answer
36 views

paragraphs_update_8018 takes very long time to finish

The paragraphs_update_8018 update takes very long to complete (we have over 1 mio. paragraphs), as of now it's already been over 1h40m and it's still running. EDIT: it finished after 1h47m My ...
0
votes
1answer
27 views

How to install and enable a default and admin theme in a Drupal 8 install profile with just YML (without using hook_install() or a .profile file)?

I want to avoid using hook_install() so I can install from configuration. I'd like my install profile to use seven for the admin theme, and my custom theme rutherford for the default/main frontend ...
-1
votes
0answers
20 views

Can't send response to client after ajax call, because of cURL call on server

Please bare with me if this question is stupid... I have spent days googling for a solution without finding one. The background is that I am trying to implement an onsite payment method in my Drupal ...
0
votes
0answers
21 views

Get field value in viewer.js file (from pdf.js)

I created PDF files protected with password. They are uploaded to Drupal and the password is saved in a field pdf_password in Drupal. I would like the PDF to open them with pdf.js without having to ...
0
votes
0answers
13 views

Delete a content type's allowed values, and all parent nodes should not show info regarding these values

I have a content type f.e. parts, with the following values: electrical, machine, glass, liquid or NONE I also have a content type, f.e. product, where with a view one can select which part the ...
0
votes
1answer
35 views

Plugin Not Found Exception

I am implementing REST in Drupal 8. I have created a custom plugin for REST resource, enabled the plugin and configured permissions for that REST endpoint. After few days, I removed the code for ...
-2
votes
0answers
45 views

Custom YouTube preview image in node detail view

Presently I am using https://www.drupal.org/project/video_embed_field. Now I can embed YouTube and Vimeo videos finely in my website. I want to display my own preview image rather than YouTube/Vimeo ...
0
votes
1answer
26 views

Entity Validation API: Retrieve parent field entity while validating

I'm using the Drupal 8 Entity Validation API. I've implemented my Constraint and ConstraintValidator classes and added them as a constraint against the relevant entity field. If I understand the ...
0
votes
1answer
41 views

Custom line items to be included in $order->getTotal()

I am using Ubercart for our e-commerce on Drupal 8 website. Everything seems to be working fine except for the $order->getTotal() function - it does not somehow pickup the amount from my custom ...
0
votes
1answer
8 views

Purchases with points occupying ubercart

I want to use ubercart to create a site for online purchases but I would like to know if you can use points as a form of payment, I mean that users are placed points with which they can buy items and ...
0
votes
0answers
36 views

Redis constantly resaving DB

I've started doing maintenance on a D8 site that uses Redis. In the redis logs - I see the following type of pattern: 208:M 16 Sep 20:44:11.512 * Background saving started by pid 1986 1986:C 16 Sep ...
0
votes
0answers
11 views

How can I set a Custom Field's label to 'visually_hidden' by default?

So I created my own field plugin, and I wonder if it's possible to set a default value for the display option. Obviously, there's no way to set this in the field formatter, and I don't see where I ...
0
votes
0answers
13 views

Undefined property $uid when running update.php

I have had a minor issue which has been popping up whenever I run update.php such as after updating some modules, etc. Anytime I run update.php I get the following error: Notice: Undefined ...
-1
votes
2answers
51 views

JavaScript dependencies for a specific block or page [duplicate]

I am migrating a Drupal 7 site to Drupal 8. I have a custom block (visible only on the home page) that has some tabs on it. Currently, the tabs are implemented using jQuery UI tabs and it would be ...
2
votes
1answer
57 views

Have followed instructions to disable cache for development but it's still caching

I have followed all the instructions here https://www.drupal.org/node/2598914 I'm developing a module with a block, and when I went to the Block Layout page and clicked "Place Block", the list of ...
0
votes
0answers
18 views

Print Select Option HTML field in View's PHP Header

Following code I am using in PHP Block of Header in View Page <?php $query = \Drupal::entityQuery('node'); $query->condition('type', 'media')->condition('status', 1); $results = $query->...
0
votes
1answer
24 views

How can I programmatically apply text formats?

I've created a custom text format I'm trying to apply to a field programmatically. As best I can tell, the format IS getting applied, but it is not stripping HTML tags like it is supposed to. The ...
0
votes
0answers
24 views

Upgrade Core to 8.7 and “Content” nodes no longer display

I recently upgraded my Drupal core to 8.7.7 through a manual update (from 8.6.1) Initial inspection looks good, no DB update errors. When i go the "Content" tab of the admin panel (/admin/content), I ...
0
votes
0answers
27 views

After installing commerce and commerce license I'm getting the install screen

I've installed commerce (latest version) on Drupal 8.7.7 using composer. Installation goes fine but as soon as I create a product variation or even when I install commerce license, the website ...

15 30 50 per page