All Questions

24,222 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
15
votes
0answers
1k 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 ...
12
votes
0answers
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 ...
10
votes
6answers
2k views

How do I allow a free product into a cart, but only if cart net value is above $10?

I'm interested in running a promotion ... I'd like to make a product free if the customer's cart total is $10. I was able to do that with this module: http://drupal.org/project/uc_discounts_alt ...
9
votes
0answers
561 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,...
9
votes
1answer
973 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 ...
8
votes
1answer
469 views

Is it possible to migrate data into multiple translations of entities?

I'm running a multilingual migration of events (which are stored as nodes) that have keywords on them where there are keywords (stored as terms). The keywords should be stored in a multilingual tags ...
8
votes
3answers
4k views

How to set required POST parameters for routes

With GET method we can do something like this example.user path: 'example/{user}' defaults: _controller: '\Drupal\example\Controller\ExampleController::content' requirements: ...
8
votes
0answers
3k views

How do I use a custom twig template with a render element?

I am fairly new to Drupal 8 module development, so I decided to follow a tutorial at https://docs.acquia.com/articles/drupal-8-creating-elements-theming-elements-and-managing-frontend-libraries, which ...
8
votes
1answer
634 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
3answers
1k views

How to use URL parameter and page callbacks for tab menus correctly?

I'm using Drupal 6 and I'm trying to display two tab (menus) on a page that has the URL /vehicle_info. Both pages that the tabs link to should take a node's nid as parameter. My current code looks as ...
7
votes
1answer
147 views

How can I write a unit test for a custom field formatter?

I'm working on a project where we need to have code coverage using phpunit. I have a public method that includes this code: /** * {@inheritdoc} */ public function viewElements(...
7
votes
0answers
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 ...
7
votes
2answers
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-...
7
votes
1answer
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
0answers
149 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" ...
7
votes
1answer
485 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 ...
7
votes
1answer
2k views

Disabling Browse to Library in Media Upload Field

I'm on d7.2 with the included Media Module. I'm also using WYSIWYG if that matters at all. I'm seeing that when a user clicks the image upload field, they have a choice of either 'web' or 'library'. ...
7
votes
2answers
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 ...
6
votes
1answer
549 views

Set SameSite=strict for session cookies

I'm trying to figure out how to set the SameSite cookie attribute for Drupal 8 session cookies, but I can't find a solution. I thought SessionConfiguration might give me enough options, but it seems ...
6
votes
1answer
2k 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 ...
6
votes
2answers
590 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, ...
6
votes
1answer
1k 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? ...
6
votes
1answer
1k views

Change views exposed filter format

I am build a JSON export using a View in Drupal 8. Problem is that the parameters for retrieving the json doesn't seem to work as I would want. In my View I need use two exposed filter criteria to ...
6
votes
1answer
155 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 ...
5
votes
0answers
467 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 ...
5
votes
1answer
122 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....
5
votes
1answer
2k views

Manipulating Theme Suggestion Priorities

I'm adding in some theme suggestions using mytheme_theme_suggestions_alter(), when certain criteria is met. My issue is, for some reason these additional theme suggestions are appearing at the top of ...
5
votes
2answers
939 views

Send mail notification when node of given type gets created

Use case: a small site where I want to warn all users by mail whenever a new content of a particular type is created. I thought I would try Rules+Actions to handle this. I'm working on a vanilla ...
5
votes
0answers
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 ...
5
votes
0answers
90 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 ...
5
votes
0answers
392 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 ...
5
votes
2answers
2k views

How to programmatically add content to a group in the Group Module?

I'm using the Group module. If I have a group type such as Project, and I have a content type such as Article, and I programmatically created a new article node using Node::create(), how can I in the ...
5
votes
3answers
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 ...
5
votes
1answer
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 / ...
5
votes
1answer
7k views

How to create a "read more" button using AJAX in a module?

I'm working on a really simple module in Drupal 8 to get the hang of things. What it does (or rather, what the page I'm asking about in this question does) is grab some data of a bunch of simple ...
5
votes
1answer
478 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 ...
5
votes
1answer
129 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
1answer
333 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
1answer
926 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/...
5
votes
2answers
1k views

How do I display empty fields?

I have redesigned the layout of the page using the display suite module. When I go to the node, I see empty fields are not there. I like to see the empty fields on the node. I have been looking for ...
5
votes
1answer
341 views

Hitting the back button after a batch process cause a nasty error

I have a batch process (using batch API) that runs when a user on my site tries to launch a non signed Java applet. The batch process does all the needed codesigning and other things and then ...
5
votes
0answers
574 views

What is the use of Drupal.settings.ajaxPageState object?

I am working on a Drupal site on which a functionality breaks because the value of Drupal.settings.ajaxPageState.js gets reset to an empty array instead of an object containing the list of js files. ...
5
votes
1answer
2k views

jquery date picker in views exposed filter changes the date values

I have a node type "tasks" and created a view so that current logged in user can see his/her assigned tasks. I have used a "time ago" formatter in the field "deadline" which shows the remaining time ...
5
votes
1answer
146 views

Letting a view know in which pane it's being displayed

I've got a very non-trivial question on integrating Panels and Views. Maybe there's no solution out of the box, but I would really appreciate any help. Essentially, I've got a lot of tagged nodes. ...
5
votes
2answers
972 views

How to create field collection item fields programmatically?

I'm trying to program a field collection with field collection item fields like the code as given by rbruhn on Creating field collection programatically. I want to create it on an easier level for ...
5
votes
2answers
3k views

Save data to custom field columns using entity_metadata_wrapper

I have a simple custom module that creates a new field type. The field has multiple columns in the database; the idea is that a user (or code) will enter a single value, and then that value is ...
5
votes
2answers
354 views

How to create a chart for tracking Product stock over some period of time using Ubercart?

Does anybody know about a good solution for tracking Product stock in a certain timespan? It is nice to see the stock numbers of products, but I find quite handy to see product performance over time. ...
5
votes
1answer
1k views

Database table cache_views_data is extreme large, what size is normal?

I have a Drupal 7 site with ~70,000 nodes and ~500,000 terms. During some investigations for the cause of substantial performance problems, I found out that the database table cache_views_data is ...
5
votes
2answers
2k views

Displaying the contents of a document file (doc, docx, etc.)

I'm looking for a way to display the contents of an uploaded document file such as a .docx file. In Drupal 6 I used the iPaper module which did the trick as all I needed was api code to connect ...
5
votes
3answers
3k views

Role Hierarchy and Management of Assigned Users

I need to set up a role hierarchy like this: Super Admin - Full permissions, can manage all users and content Regional Manager - can manage only his/her own Store Managers; cannot manage another ...

15 30 50 per page
1
2 3 4 5
485