All Questions

23,134 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
14
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 ...
9
votes
1answer
485 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
2answers
1k 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
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 ...
8
votes
1answer
416 views

$promotion->apply($order) doesn't work in commerce v2.0-rc1

I have a redemption form that I want to enter a coupon code and then an order should be created automatically, then the coupon code applied to the order as well. The order gets created successfully ...
8
votes
2answers
2k views

What is the equivalent of hook_translated_menu_link_alter() to Alter a menu link?

I want to alter the menu link in Drupal 8. In Drupal 7 we can achieve this using hook_translated_menu_link_alter function module_translated_menu_link_alter(&$item, $map) { global $user; if (!...
8
votes
1answer
672 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 ...
7
votes
0answers
1k views
+50

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 ...
7
votes
1answer
469 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
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 ...
6
votes
1answer
110 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 ...
6
votes
2answers
313 views

Big pipe and behaviors context

I have problem with drupal behaviors and context in combination with big pipe. It seems like context variable sometimes contains same part of page. I have tried: (function ($, Drupal) { Drupal....
6
votes
1answer
190 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 ...
6
votes
2answers
2k 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: ...
6
votes
1answer
787 views

Upload multiple files through a single file dialog?

In a Webform, I want to let the user upload multiple files via one call of the file dialog. I found the following modules. Webform Multiple File Upload Webform Multiple File With either of them, I ...
6
votes
1answer
491 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. ...
6
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/...
6
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 ...
6
votes
0answers
460 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. ...
6
votes
2answers
2k views

Reasons for subsequent Broken/missing handler in Views?

In the process of upgrading Drupal 6.x to 7.x I'm facing a problem that makes all my views show nothing relevant. (I believe the problem is here but I'm not sure, I don't know. That's why I'm asking): ...
6
votes
3answers
647 views

Why Content Path cannot be used to sort a view?

Using Views with Drupal 7, how can I use the content path to sort a result table? I have node title, created date and path as fields for a view. The first two fields have the checkbox to make them ...
5
votes
2answers
2k views

How can I hide the entity ID on an autocomplete widget?

I have an autocomplete widget for a taxonomy entity reference. Every term shows its entity ID between parentheses; plus, if the term name contains spaces, it appears between quotes, e.g. "Lorem ...
5
votes
1answer
75 views

After implementing hook_node_access, how to stop node from appearing in view?

In Drupal 8, I implemented a hook_node_access function in my module to control access for a certain role under certain conditions and it works fine. However, all of that content type are still shown ...
5
votes
0answers
190 views

How to use Context with Views' Contextual Filters

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 ...
5
votes
2answers
255 views

Configuration management with different database and websites

We have a central code base (Git repo). From this code base we deployed several websites already. Till now we used features. The websites which are already in production they have a filled database ...
5
votes
2answers
250 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, ...
5
votes
0answers
420 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
1k views

How do I enable and use a view mode for a 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 ...
5
votes
1answer
663 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 ...
5
votes
1answer
2k views

Creating date field with only month and year

We are using the form API in a custom module (and not an entity field), how can we easily set the date widget for just year and month data entry. I've tried adding a #date_format attribute but no ...
5
votes
1answer
825 views

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 ...
5
votes
1answer
3k views

Clear only CSS/JavaScript cache when files are aggregated

When aggregating CSS/JavaScript files using performance page in Drupal 8, drush cc css-js doesn't work, and I've to clear/rebuild all cache. Is this a bug or the normal behavior? How do I properly ...
5
votes
3answers
2k 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
803 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
6k 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
419 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
122 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
296 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
2answers
833 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
542 views

Drupal Commerce causing database deadlocks

I'm trying to get to the bottom of a known Drupal Commerce bug to do with row locking. When a user logs in on my development site, Drupal Commerce starts multiple identical queries that look like ...
5
votes
2answers
2k 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-...
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
132 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
1answer
134 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" ...
5
votes
2answers
921 views

How to create field collection item fields programmatically?

first of all, English is not my native language so sorry if this reads bad. I'm trying to program a field collection with field collection item fields like the code as given by rbruhn here: https://...
5
votes
2answers
343 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
937 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
2k 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 ...
5
votes
1answer
250 views

Make variables outside of node available to pathauto

I'm trying to port a website over to Drupal 7. The structure consists of locations which have an entity reference to a region which has an entity reference to a country: location<-region<-...

15 30 50 per page