All Questions

15
votes
0answers
975 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
437 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
132 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
344 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
318 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
71 views

Disable front-end access

I want to disable the front-end access of my headless Drupal site, that is just a REST API for a Vue site. Except for the login page, there is no need to access any node, taxonomy or view directly as ...
4
votes
0answers
87 views

Is it a security issue to put CSRF token in drupal settings?

I have an application where I created a REST resource to update a field on the user object to store bookmarked items. When you do a post request to a rest resource you are required to use a header ...
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
69 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
857 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
198 views

Ajax Exposed filter isn't changing URL

There must be something obvious I'm missing as it seems from other posts that Exposed Filters in views should generate URLS from its results out of the box. I've got some filter with ajax enabled and ...
4
votes
0answers
847 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
471 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
645 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
71 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
915 views

How do I send user credentials and get the access token?

I am linking a Drupal site to an Android application. With the help of the Simple OAuth module, users will log in to my android app using their Drupal site credentials. I understand that once the ...
4
votes
0answers
762 views

Drupal 8: When I POST an image file via rest, response is 201: Object Moved, status is temporary

I'm attempting to POST images to Drupal 8 via the REST api. The creation is successful (201) and the images appear in the files list. However, there are problems. I'm not sure if they are ...
4
votes
0answers
56 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
985 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
89 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
604 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
728 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
717 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
281 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
296 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
124 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
553 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
1k views

View for Taxonomy terms?

How can I output nodes which linked with taxonomy term through a view? How can I link taxonomy vocabulary with a view wich will output appropriate nodes for each term of this vocabulary? In Drupal 7 ...
4
votes
0answers
351 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
403 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
65 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
82 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
81 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
18 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
50 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
167 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
166 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
105 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
163 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
219 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
96 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
291 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
105 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
472 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
105 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
64 views

How to use Context with Views' Contextual Filters in D8?

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 ...
3
votes
0answers
65 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
210 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 ...

15 30 50 per page