All Questions

16
votes
0answers
895 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
401 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
2k views

getvalue() of multiple values field return only the first value

I added a new field in the field manage user page. This is a sample integer multivalue field. (we can enter several integer) I edited the profile of the admin user. I added (and save) some values in ...
5
votes
0answers
313 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
37 views

How to get a second join into hook_views_data?

I am trying to make the value of a string (name) found in mymodule_names.name available to Views by means of hook_views_data(). To get the name, I need to first look up the nid of the node I want ...
4
votes
0answers
60 views

How is password hashing/encryption performed?

I am fielding a question for a project that is asking if we use Blowfish crypt in Drupal, or, if we could. The class that performs password hashing in 8 is PhpassHashedPassword, based on https://www....
4
votes
0answers
60 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
62 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 ...
4
votes
0answers
1k 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
134 views

How to render a @FormElement in Views area plugin

I am doing a custom plugin area for displaying some data in a views footer (Drupal 8). I do something about just like this : Create a custom area plugin The only point is, instead of #markup in the ...
4
votes
0answers
275 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. ...
4
votes
0answers
57 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
526 views

How do I remove JOIN in hook_views_query_alter()?

I have a view with two filters (A + B). Filter B should only be included in the query, if a specific value in filter A is set (like a "conditional filter"). So I tried to remove the where condition ...
4
votes
0answers
406 views

How to get Ajax to load first?

After updating module webform_paymethod_select I noticed that Ajax on webforms stopped working. I was unable to edit any existing webforms or create new ones. This happens when JS Aggregation is ...
4
votes
0answers
754 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
413 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
608 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
207 views

What to return from form AJAX Callback

I used the examples found here as my AJAX guide. I have a custom form field $form['elements']['refunded'] which is entirely defined in a single line as an array. My AJAX DIV's and callbacks work ...
4
votes
0answers
803 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
707 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
54 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
943 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
78 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
550 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
649 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
650 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
221 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
269 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
72 views

unable to create new draft programatically for published node

I am using workbench_moderation module. When I edit the node and save it using node_save($node) it is changing the status of actual node to draft and original node is getting unpublished. While I ...
4
votes
0answers
117 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
338 views

Editing a Field Collection element in a custom module

In a custom module, I'd like to to edit a Field Collection element. The element is linked to a taxonomy but I think the code would look quite similar if it was to a content type. I've read a lot of ...
4
votes
0answers
510 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
398 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
9 views

Migrate - 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
40 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
138 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
40 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 ...
3
votes
0answers
52 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
91 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
86 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
75 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
77 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
45 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
41 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
132 views

Whats the difference between “Content Type” and “Content Types” on a block configuration form?

Whats the difference between these two tabs? There is no help text here. One has "negate" the condition but the other does not.
3
votes
0answers
199 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 ...
3
votes
0answers
1k 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
48 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