Add Expression for Entity Query

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 attribute that has access to addExpression(). In my case... read more
Add Expression for Entity Query

How do I enable language without importing translations?

I need to enable many languages on a site. I don’t want Drupal downloads translations, since only few forms and pages will be actually translated on the front-end so I’ll handle that manually. Is there a way to avoid translations are downloaded? Do I need... read more
Add Expression for Entity Query

How to add onBlur attribute to ZIP code field in Address Field

In order to control the input format in the ZIP code field in the dynamic address fields provided by the Address Field module (I use it in Drupal Commerce) I need to add the attributes onKeyUp and onBlur to this field. My plan is to use Javascript to manage the... read more
Add Expression for Entity Query

Commerce: How to skip checkout cart and redirect to PayPal

How i have to set a rule to go direct to Paypal site? I use PayPal Express and i am not able to solve this. The only one rule i can set is to go to cart/checkout. But i´d like to go one step forward without to see the order and to have to click on the PayPal button.... read more
Add Expression for Entity Query

if empty statements in views fields or field templates

Normally, my situation is easily solved using views rewrite feature. However, in this case I am unable to use views rewrite because I have data attribute tags in the field wrappers that are stripped out by views. So I need to handle this at the template level. I have... read more
Add Expression for Entity Query

Alter language select on a node add/edit form

Wonder if anyone has had any experience altering the options presented to a user from the language select on a node add/edit form. I have some custom access control ont the site and basically I’m looking to remove options based on a individual editors access to... read more
Add Expression for Entity Query

How to sort view by content type, using literal ordering, as second order-by clause

In a view, I want to sort content by: Collection (a taxonomy term) Content type Something else Something else … I have this configured in the View UI and I want to leave most of it as it is but for the content type ordering, I want to make this literal – I... read more
Add Expression for Entity Query

JavaScript from custom module not detected

I have created a custom module, which is working. Except the JavaScript, which is not being detected. I have been following the description at https://www.drupal.org/docs/8/api/javascript-api/javascript-api-overview and I have checked other modules. What have I done... read more
Add Expression for Entity Query

How do I fill the authors name in a term reference field?

Content type stock contains the term reference field field_producer. What is the rule for Rules in order to fill this field with the node author name on creation? In detail The form looks like: — Content type Stock (stock) —- field Producer... read more
Inline Entity Form validation

Inline Entity Form validation

Created a content type and add taxonomy form in it using Inline entity Form module. So, the rendered taxonomy add term looks like : What I want to do is ADD CUSTOM VALIDATION to the “NAME” field. I tried: function... read more
Add Expression for Entity Query

Set maximum / disable custom block cache for anonymous users

I have a little issue regarding my custom block module. The module itself fetches weather data via json-request and the data is shown as a 4-day weather forecast to the user. As the weather should be actualized every day I want to set a “maximum cache... read more
Add Expression for Entity Query

Webform custom composite

Could someone advise on how to adopt the working composite example that comes with Webform in Drupal 8? https://www.drupal.org/node/2824714 suggests it can be done. I’ve copied the example from modules/webform/modules/webform_example_composite folder. Does this... read more
Add Expression for Entity Query

Customize autocomplete field to show children terms depending on another field

I have a taxonomy with 2 levels City1 -Park1 -Park2 -Park3 City2 -Park4 -Park5 -Park6 In my form, I created a field that links to this taxonomy with an autocomplete widget. I also have a second field where the user chooses the city. I would like to dynamically change... read more
Add Expression for Entity Query

Cannot install core in the root of site

I am going absolutely insane. I have been up for several hours scouring the internet, installing, removing, installing, removing, and I CANNOT get Drupal (7 or 8) to install at the root of a site (hosted Linux server, not local or vm). If I try to run the drush si... read more