All Questions
24,629
questions with no upvoted or accepted answers
17
votes
0
answers
2k
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 ...
14
votes
0
answers
2k
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 ...
12
votes
0
answers
1k
views
With search_api_solr, how can I apply an significant field based boost when using solr 6.x?
I am using the solr backend for search_api on a drupal 8 site.
I have added the value of a taxonomy term reference field (field_promoted_search) to the index.
If an item of content has ...
11
votes
0
answers
583
views
How do I go about migrating books using MIgrate_D2D?
I've had to rebuild my sites recently due to a hit on the Drupalgeddon bug I thought I closed. I've been trying to migrate everything in easily but it doesn't seem to want to for whatever reason.
Now,...
10
votes
1
answer
1k
views
How do I theme a 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 ...
10
votes
3
answers
2k
views
LIKE clause not working in hook query alter
I'm trying to replace the default search with a LIKE clause in Drupal 7. I tried to alter the query according to Adding an OR condition to an existing query:
function MYMODULE_query_node_access_alter(...
9
votes
2
answers
849
views
Grouped Exposed filters radio buttons : one in two no value ticked. How to programatically force default button be ticked?
Some exposed filters (radio buttons) aren't systematically ticked when a view is displayed, causing an "An illegal choice has been detected. Please contact admin..." error message and No result found. ...
8
votes
1
answer
3k
views
Add Expression for Entity Query
I've been working with the entityQuery to query the db and get an array of filtered nids however I need to add an expression to my query.
I've checked the Query class and found a protected sqlQuery ...
8
votes
2
answers
737
views
Managing custom aliases on translated content
We have a Drupal 8 site with translated content, and using the Pathauto module. The issue we are running into is that when we un-check the "Generate automatic URL alias" on, say, the Chinese node, ...
8
votes
2
answers
2k
views
Configuration changes that will not import?
I have some configuration that will not import. If I run drush config-import --preview I see the changes to be imported; I hit 'y' to import. When I run the same command, the changes are still there?
...
8
votes
2
answers
4k
views
Migrate address field
I am currently searching for a example to migrate data into an address field in Drupal 8 without any luck for now.
Has someone a hint for me on how to map the fields?
I tried the following:
my....
8
votes
2
answers
3k
views
How do I enable the "print PDF" link on only a specific page?
I have enabled the print module and configured the basic page content type to show a PDF print link under the basic page settings.
On the print module's Links settings page at admin/config/user-...
8
votes
0
answers
171
views
Splitting Atom categories into two fields
I am using Feeds to import an Atom feed into my site. The feed has categories as
<category term="cat:Foo" scheme="http://www.sixapart.com/ns/types#category" />
<category term="tag:foo" ...
8
votes
2
answers
2k
views
Paging a view based on a grouping field?
I'm upgrading a site I created 2 years ago from D6 to D7. In that site, I have a view of items that are grouped according to year, so that the items for each year show up on a separate page -- you ...
8
votes
1
answer
496
views
Order list: Pay unpaid invoices
I have created some extra statuses: Paid and Unpaid.
Now they got the functionality and react on the transaction balance perfectly fine. However, on the user site, it is kind of a dumb thing.
Even ...
8
votes
2
answers
2k
views
How to setup event registration and paypal payment?
We have events and we take registrations for them. Entity Registration module is installed for that purpose and it's working great. Now, since those events are paid events, we want to implement PayPal ...
7
votes
0
answers
538
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 ...
7
votes
1
answer
2k
views
How to set up Authcache module with Varnish and ESI?
I am trying to set up Drupal 7 with Authcache beta 2 and Varnish 3.0 but I can't get the ESI blocks working. Varnish it self seems to work well.
I am using the example.vcl from sites/all/modules/...
7
votes
1
answer
167
views
Update core keeping other composer packages
After upgrading Drupal to the last version with Drush (8.1.15) the other composer.json dependencies (e.g. drupalconsole) are removed.
Are there any way to update Drupal with Drush keeping other ...
6
votes
0
answers
44
views
How to override the typehint for entityTypeManager with a more specific one?
I'm often frustrated by entityTypeManager because when I load entities, the typehint for the return value of the load methods is EntityInterface, but I want it to be a more specific interface (which I ...
6
votes
0
answers
289
views
How to get referencing parent entity when adding entities via Inline Entity Form to set automatic titles?
I have a content type "Parent" and a content type "Child". When adding Parents, the user can add Childs via Inline Entity Form.
Child content types have Automatic Entity Label enabled. In that ...
6
votes
0
answers
624
views
How can I convert an existing 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 ...
6
votes
1
answer
158
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....
6
votes
0
answers
1k
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 ...
6
votes
0
answers
112
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 ...
6
votes
3
answers
3k
views
How do I define a computed field equal to the concatenation of two fields of my custom entity?
I have a custom entity (Person) with these fields: ID, nom, prenom, telephoneportable, estactive, userID, created, changed. I created it with baseFieldDefinitions.
I want to have a computed field ...
6
votes
1
answer
1k
views
How to add multiple products to cart at the same time with attributes
I have different view blocks that display multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / ...
6
votes
1
answer
538
views
Automated login with LDAP always returns error
I have successfully setup LDAP module to authenticate users (and create new users). This is done through manual login form. Now I'm trying to enable automated single sign-on, but with no luck.
I ...
6
votes
1
answer
841
views
Why does the Webform disappear after changing Submit button text in Form settings?
I have created a Webform page called "Quick Quote".
It is working fine in the website. But when I change the "Submit button text" to a new value in Advance Settings >> Form Setting ...
5
votes
0
answers
56
views
Prioritise condition in QueryInterface
I have an overview with a search field. The query should search on both the title and description, but I would want to show my results that have the search parameter in the title first in the list.
I ...
5
votes
0
answers
78
views
How do I import a sync config file into my Kernel unit test?
How do I import a sync config file into my Kernel unit test ?
Specifically, I have some REST resources in files
config/sync/rest.resource.foo.yml,config/sync/rest.resource.bar.yml
At present, when I ...
5
votes
1
answer
774
views
How can you attach a file to a mail using Symfony mailer?
I want to attach a file to a mail from an input file in my form.
Here is how I build the mail :
$mailManager = \Drupal::service('plugin.manager.mail');
$params['title'] = 'title test';
$params['...
5
votes
0
answers
251
views
Add third party settings to a basefield definition
Is there a way to add third party settings when defining a basefield for a custom Content Entity?
I am creating a new Entity type and want to keep the fields defined in code vs config as much as I can....
5
votes
1
answer
193
views
How does the Geolocation content of a page filter is a Views block?
I have a website with Drupal 9 and the Geolocation module :
https://www.drupal.org/project/geolocation
I created a content type with a Geolocation field that contains coordinates.
My website uses the ...
5
votes
0
answers
459
views
How best to determine what differs between field schema and field definitions when "Mismatched entity and/or field definitions" is reported?
I've inherited a large, enterprise Drupal 8 site in which we have many "Mismatched entity and/or field definitions" warnings reported in the status report. The site is currently running on ...
5
votes
0
answers
528
views
How to add translation to Inline Entity Form + Entity Browser
Situation
I've got a special "Dashboard" node that consists of entity references to other node types. In dashboard form mode all widgets are configured to use Entity Browser to display an (Inline ...
5
votes
1
answer
106
views
Register an object with the Service Container and give it a setRequest() (get base url)
I'm looking for a way to get the hostname of a multisite, and I've found several answers about it.
One of the solutions was to use:
Answer link
$host= \Drupal::request()->getHost();
or
\...
5
votes
1
answer
885
views
Invalidating render cache items for anonymous?
We have a certain content type in Drupal 8 that has a small grid of data on it that is populated from an API call when the node view is being built.
In that call, I am checking for cache and setting ...
5
votes
2
answers
3k
views
How to pass a field value as contextual filter argument using Twig Tweak drupal_view?
In Drupal 8, I'm using Twig Tweak to embed a view. I have a contextual filter set to one of the node's fields, field_project_id. If I use a literal for the third argument, it works. If I try to ...
5
votes
0
answers
1k
views
Workflow, Workflows, Workspace, and State Machine-- what is the difference?
Drupal 8 core has an experimental module called Workflows.
There is also a contrib moduled called Workflow.
There's also the Workspace module, which is associated with the Deploy module.
Commerce 2 ...
5
votes
1
answer
406
views
Migration of content with an UI
My goal is to import data of customers from a csv file to my custom entity. For that I wrote a migration with the migrate_source_csv module as source plugin. This works fine, but the problem is, that ...
5
votes
0
answers
194
views
Is it possible to have a batch job run in a modal
I created a form that on submit it creates a CSV file via batch API. It works perfectly when submitting the form regularly but can't get it to work from a Ctools modal.
Could it be that it just isn't ...
5
votes
2
answers
150
views
Alter the exposed filters of a view, based on the view result
I have a view that displays matching nodes, based on contextual arguments.
I'd like to create an exposed filter that filters by node title, displaying a drop down (select) menu with options for every ...
5
votes
0
answers
986
views
Show nodes of other content type that share a common term (with depth)
I have two content types: sector and product. Both share terms from the same vocabulary, called branch.
A sector node should list all product nodes that share the same term(s) (from the branch ...
5
votes
1
answer
145
views
Programmatically Setting Content Ranking Factors For Drupal Search
I've added a dropdown to Drupal search page interface. I would like for users to be able to select this control to sort results according to Date or Keyword Relevance.
I'm able to get the dropdown ...
5
votes
0
answers
340
views
Is there any way to add a file field for multiple upload file to a custom form?
I'd like to add a file upload widget to a custom form, with core file module, as shown in the admin edit node page. I've trying with the 'managed_file' API, but I've only got upload one file. I need ...
5
votes
1
answer
366
views
Search filter result score
I'm seeing an interesting anomaly (?) I'm trying to get to the bottom of. I've set up a view with an exposed filter Search: Search Terms. I am trying to mimic the result set offered by standard drupal ...
5
votes
1
answer
2k
views
How to configure paragraphs module for multilingual
I try to configure the Paragraphs drupal module for a multilingual website.
I have :
set the content type translatable with field translation
enable translation on the paragraphs field
enable ...
5
votes
2
answers
275
views
How to determine reason for unprocessed files in Drupal to Drupal migration
Finally ran my first file migration from Drupal 6 to Drupal 7 using UI.
3100 Items
3036 Processed
62 Unprocessed
2498 messages
I am simply trying to figure out what those 62 files are, and why ...
5
votes
1
answer
1k
views
Using multiple AND/OR operators in contextual filters
I'm trying to query my nodes by using a contextual filter in views, however, I am unable to use multiple AND (+) operators and OR (-) operators at the same time. For example:
This works:
mysite.com/...