All Questions

14
votes
0answers
997 views

How do I setup Chained fast backend, Varnish, APCu and Redis cache bins in settings.php?

On a Debian Jessie server (Nginx, PHP 5.6, Zend Opcache), I installed Apcu, Redis, Varnish. I also installed APCu, Chained fast backend, Redis and Varnish modules. In order to make these caching ...
6
votes
0answers
450 views

So, running Drush update messed up your SVN repo

I'm working on a client's site. We had the sites folder as the root of a SVN repository. At some point we ran drush to do module/core updates but Drush was (mistakenly) set to ignore the repository. ...
5
votes
0answers
44 views

After implementing hook_node_access, how to stop node from appearing in view?

In Drupal 8, I implemented a hook_node_access function in my module to control access for a certain role under certain conditions and it works fine. However, all of that content type are still shown ...
5
votes
0answers
154 views

How to use Context with Views' Contextual Filters

I have content type City. I have a view page with contextual filters to show the cities at the URL pattern locations/<city id>. I want to use Context to add blocks to these cities pages but I ...
5
votes
0answers
149 views

What is the way to restrict access to a store and its products by user?

I'm using Commerce 2 and I have: User A and User B Store X assigned to User A (by entity reference) Store Y assigned to User B I would like to restrict access to products of stores so that User A ...
5
votes
0answers
391 views

How do I make an archived-dump of my site?

I have multiple versions of drush and cannot make an archive-dump of my site. drush8 ard/drush8 archive-dump returns [error] The drush command 'ard' (and/or 'archive-dump') could not be found. ...
5
votes
0answers
321 views

Replacing tokens in Newsletter

I'm trying to create a custom template using the Drupal Newsletter module. I need to populate the newsletter with existing content. For this, I think I need to replace a token like [node:nid] in the ...
4
votes
0answers
249 views

Image styles are not generated in Docker for Windows

When I open in browser http://localhost:1567/sites/default/files/styles/thumbnail/public/2017-10/478069720_1384178114_4.jpg, I see 404. The "original" images are uploaded successfully, and the ...
4
votes
0answers
2k views

How to setup Swift Mailer to send mails using SMTP server and TLS encryption?

I'm trying to send Drupal 8 emails using Swift Mailer (5.4.8, 8.x-1.0-beta1) and a remote SMTP server. The transport should be encrypted, so TLS should be used. This is my setting: Unfortunatly when ...
4
votes
0answers
601 views

How to theme Drupal 8 modal popup

How can I style Drupal 8 modal window to achieve Instagram style and behaviour? I'm creating modal through extending ControllerBase class, thus have full control of content. However I can't figure it ...
4
votes
0answers
72 views

Is there a way to modify attribute options with a percent value?

I'm using Drupal Ubercart and I have created an attribute that should affect the price of the product using the attribute. The problem I have is that out of box, it can only affect the price by adding ...
4
votes
0answers
938 views

How to enable (use) view mode for Commerce2 Product type

In default commerce2 (drupal 8) I want to add second product-type view mode, to show in views - like teaser version, including add-to-cart btn with variations. I have additional field in Product type ...
4
votes
0answers
871 views

How to create a Draft view with Content Moderation?

In Drupal 7 with Workbench Moderation is easy to create a view to show the last Draft of a content: You have a relation in the view named Workbench Moderation: Node, so using the filter Workbench ...
4
votes
0answers
481 views

CAS Server setup

I have setup a Drupal 8 with CAS configurations - https://dev.cas.local Here is the configuration: Version: 2.0 or higher Hostname dev.cas.local Port 443 URI /cas SSL Verification Verify using web ...
4
votes
0answers
663 views

SSL and Session Cookies Issue

I've spent a lot of time trying to resolve this issue but I feel like I might be missing something. I'm having an issue with Drupal 7 and SSL. Here's what's going on: Session cookies are not being ...
4
votes
0answers
72 views

How to modify auto populate field value?

I m Stuck in two situation where I have to modify value of one field depending on another field selection. First situation is like I have two field Region (Node reference) - the widget type is ...
4
votes
0answers
59 views

Why are English translations of Field Labels shown on site's default language?

I have 5 languages and all my fields are translated into them. My default language is ancient Aryan. When I clear cache English translations of Fields Labels are displaying in default language. Other ...
4
votes
0answers
1k views

Loading a form in dialog/modal returns an error

I have a form with a submit button binded to an AJAX callback that opens up a modal with another AJAX form. The modal dialog opens with the form, but the AJAX submit in that modal form isn't ...
4
votes
0answers
97 views

drupal_process_states function doesn't work for managed_file

The following code is working for text field, but it's not working for image field. function THEMENAME_form_system_theme_settings_alter(&$form, FormStateInterface &$form_state, $form_id = ...
4
votes
0answers
634 views

Image upload AJAX error

I have an image field called field_image in a content type called Blog Post. I am able to use this field as expected, to upload and replace images, etc. I have a second content type called Event, ...
4
votes
0answers
776 views

Trying to set a twig global variable for a function

I have a Twig function in my theme that sets a random ID. The function works well if I include the entire function within any given template and then render the variable for that {{ randomID }} in the ...
4
votes
0answers
751 views

Why is my field definition update not working?

My module extends the existing image field type by 2 new fields, copyright and description. FieldType plugin: <?php namespace Drupal\image_extra_fields\Plugin\Field\FieldType; use Drupal\...
4
votes
0answers
292 views

Execute form custom validator first before default validation

I have added a custom form validation on node/add page in drupal 8. The purpose of adding this validator is to add a slash before the path alias string. By default if a path alias string is added ...
4
votes
0answers
311 views

Views doesn't like multiple entity references in my entity

I have a couple of custom entities defined by my module against plain tables in my database (because I have a lot of data and don't want to unpack it all into fields). My contact entity has a ...
4
votes
0answers
127 views

How do I get a true panels page clone?

Any panels experts here? I want to clone a panels page with fieldable panels panes on it. I can use the clone option in the page manager. It creates a new page at a new url but the FPP are just ...
4
votes
0answers
570 views

Theming links in blocks using twig templates

I have a block for the language switcher. I want to override the links in it. I can override a specific language switcher block's markup, and I can override the links markup in all language switcher ...
4
votes
0answers
370 views

View exposed filter block no alter form with ajax

I am trying to filter out the no results items in my exposed filters. (I know i can use selective filters, but in this case i can't use them). So i alter the filters with form_alter, check which ...
4
votes
0answers
407 views

currency field and currency switch with currency module

I installed the Currency module expecting to setup a currency field and a currency switch. Like switching the language, I'd like to switch the currency (of a field). The currency should switch ...
4
votes
0answers
1k views

Using the Batch API with AJAX?

I have been trying to figure out how to use the Batch API in an overlay via AJAX, but are not sure that's possible at all? - As far as I can see the batch API, when javascript is enabled, calls the ...
3
votes
0answers
70 views

What does it mean if expire is set to null in a cache table?

I am looking at the documentation for the expire field in the cache tables and the documentation in CacheBackendInterface.php says: * @param int $expire * One of the following values: * - ...
3
votes
0answers
93 views

Warming up dynamic page cache for authenticated users

We're currently working on a rather complex Drupal 8 based website. After clearing caches, the majority of pages/routes require about 30-60 seconds for being rendered/returning the desired results. ...
3
votes
0answers
93 views

Multiple source items per row

I'm migrating content from a Joomla SQL source. The images are stored inside of the text as inline images. This is how my source data looks like: +------------+--------------------------------------...
3
votes
0answers
20 views

Module Uninstall Validators and Lazy Services

I have recently been working on creating functionality for a module that requires certain content related to the module be deleted before the module itself can be uninstalled. https://www.drupal.org/...
3
votes
0answers
52 views

When a path is associated to more routes, which route is used?

How does Drupal 8 decide which route to use, if there are two routes defined in Drupal 8 via routing.yml that lead to the same path? Of course this sounds like a stupid idea or like a mistake in code ...
3
votes
0answers
180 views

Change workflow transition state of translated node

I have a content node that has several translated nodes attached to it. My goal is to set the workflow transition state of translated nodes according to the state of the "original" node. The problem ...
3
votes
0answers
230 views

How to change the title of a modal window?

I have a link that displays a modal window. The link redirects to a page view. When I click on it, it is marked in the title of the modal window Array. How to customize the title ? <?php ...
3
votes
0answers
54 views

Can I enforce required fields when creating a node programmatically?

I'm experimenting with creating content. I made a method to create a piece of example content and redirect to its edit page. I didn't set some fields that I had defined as required on the content type....
3
votes
0answers
111 views

How to set the correct RSS row plugin?

I need to add an image to the RSS feed. So I create a new row plugin for the RSS and it extends RssFields row plugin. /** * Renders an RSS item based on fields. * * @ViewsRow( * id = "...
3
votes
0answers
203 views

How to fix the core.extension.module list when the currently active profile has been added to it by the system?

Following the 8.6 upgrade, several of our sites have developed a strange problem. The currently active profile, let's call it foo_profile, is now also listed as a module in config (core.extension....
3
votes
0answers
260 views

How to add 'Set-cookie' header on rest POST response

I have subdomain front.test.local as frontend ngx-app and another subdomain back.test.local for the backend pure Drupal both on https - cookie-domain is set to '.test.local'. I need cookie because ...
3
votes
0answers
114 views

--root required for all drush 8 commands and I don't know why

Does not work: root@deftig-web001:/var/www/1.websiteserver.net/platform# drush status --uri=dev052 PHP executable : /usr/bin/php PHP configuration : /etc/php5/cli/php.ini PHP OS ...
3
votes
0answers
382 views

Filter by taxonomy parent using Json api

In drupal 8.5 I have a taxonomy term list like this: Term A (12 items) Term 1 (3 items) Term 2 (8 items) Term 3 (1 items) Term B (3 items) Term 4 (1 items) Term 5 (2 items) I want to use ...
3
votes
0answers
124 views

How to convert an existing D8 image field into a Media Image reference field?

I have an image field that I created before Drupal 8.5, when media was introduced in the ui. The field already contains content and I would like to make use of the reusable media functionality that is ...
3
votes
0answers
547 views

Custom view sorting plugin / handler

I am trying to create a custom sorting option for view that will sort result on the basis of percentage of 2 fields. field 1 = node__field_funding_amount field 2 = node__field_funding_goal and i am ...
3
votes
0answers
138 views

Detail page route gives error

In my_module.routing.yml my_module.detail: path: '/module/{id}' defaults: _controller: '\Drupal\module\Controller\DetailController::view' requirements: _access: 'TRUE' In template twig ...
3
votes
0answers
72 views

How do I use hook_entity_access() to let anonymous users upload private files?

I have same issue described in How to skip the ReferenceAccess constraint on a file upload by an anonymous user? So I need to use hook_entity_access() or hook_ENTITY_TYPE_access() to solve the issue. ...
3
votes
0answers
227 views

How to make title exact match appear first in search API

For example, I have content A with : title = Quick brown fox jumps body = (empty) and then I have many other content with word 'quick', 'brown', 'fox', and 'jumps' all accross the body field. I ...
3
votes
0answers
556 views

Creating custom 'Display Suite' 'Bootstrap layouts' layouts

I am using the bootstraps layouts module with display suite to provide bootstrap styled layouts for a bootstrap themed Drupal 8 website. Is there a way to create custom layouts based on the '...
3
votes
0answers
2k views

Drupal 8 creating a custom Views filter plugin

I am trying to create a custom Views filter plugin. Basically it should read the current path, check the relevant path field in the node (defined as text-field) and get that content. I'm stuck around ...
3
votes
0answers
67 views

Benefit of config entities over regular config entries?

In Drupal 8 it is possible to store configuration in "config entities". However, the same can also be achieved with non-entity config entries. E.g. one example for a config entity schema, from core....

15 30 50 per page