Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [8]

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

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 ...
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
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
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
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
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 ...
3
votes
0answers
14 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
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
46 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....
3
votes
0answers
268 views

Front page without language prefix

I have a multilingual site on Drupal 8 migrated from Drupal 7. It has URL language detection method. Default language is English, it has path prefix /en. With this configuration front page is ...
3
votes
0answers
183 views

Creating a view by comparing two fields of two different content types using the same taxonomy

I'm trying to create a view to desplay contents based on shared taxonomy terms. More concretely, I have two content types: Offers (with field "Category") Needs (with field "Category") This ...
3
votes
0answers
776 views

Related content in D8 Views using entity reference

I've browsed through (and tested) every solution I could find here to this seemingly simple challenge. I've got multiple content types (fx. News, Releases, Events, Videos etc.) that are referencing ...
3
votes
0answers
180 views

Forms get glitchy with too many nested paragraphs

We have built a complicated structure for building pages out of paragraph components, but are now quickly running into performance limitations. It seems that the node form is monolithic, and is built,...
3
votes
0answers
170 views

How to hide a menu item of a view for an administrator?

I have created a view with Views and restricted the access by Role. I also created a menu with the view, and I didn't select the Administrator role to be included (so Administrator role does not have ...
3
votes
0answers
674 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 ...
3
votes
0answers
70 views

internal:node/x - wrong link

In my Drupal 8 multilingual site I used the link field and set it to "only internal links". If I save them, I now get the following: <a href="internal:/node/29" target="_blank" tabindex="0"> I ...
3
votes
0answers
648 views

Drupal 8, Paragraphs and search api. No excerpt available with title of node

I've spent all day and night battling with search api (with and without solr) in Drupal 8 Does anyone know if you can use search api to index paragraph content and then in a search views result, get ...
3
votes
0answers
68 views

How to include pages created with Views in a Search API index

I have configured Search API on a site to search all content. It works fine. The only thing I can't work out is how to include pages which are views in the search index. Is the only way to do this to ...
3
votes
0answers
68 views

Custom Storage Fields (Not showing in my index)

namespace Drupal\custom_storage_example\Entity; use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\BaseFieldDefinition; /** * Defines the ...
3
votes
0answers
220 views

How do I apply taxes to orders?

I have just installed fresh copy of commerce 2.x-dev and done initial steps as per "Getting Started with Commerce 2" doc. I have added some test products using default product type and variation (...
3
votes
0answers
750 views

How to change the placeholder title of the search box

I created a Drupal 8 website and enabled multilingual modules, so my website is in French, English and Spanish. In the placeholder of the search box the word Search appear for English and is ...
3
votes
0answers
43 views

Multilingual admin interface

I have a multilingual website ( english, dutch and german ). The language detection is setup to look at the URL for both interface and content. This results in an admin interface that goes from dutch ...
3
votes
0answers
613 views

Cookie-less authentication with session ID

I'm building decoupled drupal site. I need to be able to authenticate REST client via session ID passed in a URL (or maybe custom header) instead of a cookie. At first I thought about implementing my ...
3
votes
0answers
119 views

Git workflow and Acquia Dev Desktop .dd files

Using Acquia Dev Desktop I created a multisite setup. All working fine. I added all files to a local Git repository I added a .gitignore file I pushed all the files to a central remote repo I want ...
3
votes
0answers
835 views

How do I translate theme settings?

How do you translate custom theme settings in Drupal 8? I use hook_form_system_theme_settings_alter to add custom settings to a theme. One setting is the text string (e.g. 'Menu') to display beside ...