All Questions

0
votes
0answers
7 views

Dynamically remove library based on user role, cache context not working

I want to remove all libraries of modules & themes, except those from modules/themes that are defined by me. This should only be done for anonymous users. All libraries should be served to ...
-1
votes
0answers
7 views

Rule to redirect if user has role

The edit-ed version of my question: I installed the rules module, and I am trying to create a simple redirect rule, the rule must activate if the person that logs in succesefully has a role of ...
0
votes
0answers
8 views

Simple rental system for an estate agent

I've been asked to build a simple rental system for an estate agent. He rents pieces of land to farmers so I wanted to use Drupal for that. I've created two content types: Land and Farmer. How do I ...
-3
votes
0answers
13 views

Comments on Paragraphs functionality [on hold]

I'm currently working on a Drupal 8 project. And I phase some challenge. I want to use Paragraphs as multiple body fields. Each paragraph should have its own comments. And each comment has like/...
0
votes
0answers
11 views

Changing the style of a specific block

I need to change the color of a specific block in Drupal. But no matter what I try in CSS it does not work, I know the code is correct as I have tried it in a different scenario (in Codepen) and it ...
-2
votes
0answers
12 views

drush cr command error

Why I'm getting this error when I'm trying to rebuild cache in drupal 8? Command cache-rebuild needs a higher bootstrap level to run - you will need to invoke drush from a more [error] ...
-3
votes
0answers
12 views

.js conflict after start session drupal 8 [on hold]

In Drupal 8, I have configured \Drupal::request()->getSession(); then start session, but my .js files are conflicted. When I start session then it's automatically added some .js links, so after ...
0
votes
0answers
12 views

Language specific sitemap

I've setup a Multilingual website in Drupal 8 using the default content translation bundle and tried to generate a XML sitemap using the Simple Sitemap module, but the default way the sitemap ...
0
votes
1answer
23 views

How do I remove a module JavaScript file through a theme?

I need to remove a JavaScript file added from a module through a theme. How can I achieve this?
0
votes
0answers
10 views

Strange Migration Errors

Really bizarre Drupal problem making me unable to use Drush to check migrations. With Migrate Tools enabled I get the following error: PHP Fatal error: Trait 'Drupal\content_translation\Plugin\...
0
votes
0answers
13 views

How do I mock the “file_system” service?

How do I mock the file_system service in PHPUnit? The issue is being reproduced when \Drupal::service('file_system') is executing in the test suite environment. If \Drupal::service('file_system') ...
0
votes
1answer
14 views

Non-standard port with aliases

I'm running Drush 9.5.2. I set up a site alias. Drush recognizes it, but it will not connect via SSH. I get the following error: ssh: connect to host mysite.com port 22: Operation timed out The ...
0
votes
0answers
16 views

Need to mass delete users

I want to start by saying this is my first dealings with drupal of any kind. I can turn a wordpress site inside and out but have zero experience with drupal. My company has recently inherited a ...
1
vote
0answers
14 views

How do I obtain the field source from within a process plugin?

In my migration yaml script I have: process: dest_field: plugin: myplugin source: source_field If I dump the contents of MigrationExecutableInterface $migrate_executable within the ...
0
votes
0answers
24 views

Successful Drupal Application Architectures & Patterns [on hold]

I maintain a Drupal 8 instance for a large community college. Increasingly, my audience is asking for various applications to be built using Drupal as the development platform. While this is a ...
0
votes
1answer
28 views

Trouble installing drupal-project with Composer

I have followed the directions to install drupal-project with drupal-composer. I keep getting this error and it doesn't make sense to me. [InvalidArgumentException] Could not find package drupal-...
0
votes
0answers
18 views

How to grab taxonomy term with node_presave hook

So I'm running a hook to update the title with values from the node whenever the node saves. I want to update part of it with a taxonomy term but when I try to get the term from the entity it says it ...
-4
votes
0answers
26 views

Node Content Download using C# [on hold]

I wonder if there is a secure way of downloading content from drupal using a HTTP request. I am currently using the public url, http://xxxxx/drupal/sites/default/files/*filename*, to download the ...
0
votes
0answers
6 views

How do I specify a Forena PDO data source in settings.php?

I would like to override my Forena data sources in a local settings file for development. I would also like them in settings.php on production for database independent deployment. I have checked the ...
1
vote
1answer
19 views

Check if user_picture value is changed or compare with old value

I am trying to find if a field value is changed or updated by the user. But there are blockers. function custom_form_process_user_picture(&$form, FormStateInterface &$form_state) { $...
0
votes
0answers
17 views

Migrating multi-lingual wordpress site

I need to migrate my multi-lingual wordpress site to Drupal 8. I have posts and pages translated in other languages and every post/ page have different post id. How can I migrate these translated ...
-2
votes
0answers
29 views

How to fix SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded on multiple POST requests via JSONAPI module?

I have a custom Drupal 8 module which includes React app. When making multiple POST requests using JSONAPI module to create new nodes in Drupal from the app, the first request passes well, but others ...
0
votes
0answers
21 views

Enabling and configuring Mailchimp module results in HTTP 500 Error [on hold]

I'm pretty new to Drupal, and have been working on optimizing an old website. It's built in Drupal 7.6x. After installing the Mailchimp module, and configuring its Permissions, I get an HTTP 500 ...
0
votes
0answers
10 views

What should be the redirect_uri for facebook login with Use Strict Mode for Redirect URIs enabled?

I had facebook login integration for my drupal site via hybridauth module. It is not working with Use Strict Mode for Redirect URIs enabled and i am failed to disable it. I think the issue of ...
-1
votes
1answer
20 views

Help with Views Relationships and Entity References

This is my scenario: I have three content types, Content type A is linked to Content type B with an Entity reference field . Content type C is linked to Content type B with an Entity reference field ...
-2
votes
0answers
18 views

Comment form on Ajax loaded node view does not work

I am loading node view content using a custom route via ajax (in Drupal 8). Content loads correctly and comment form also shows correctly but when I try to submit the form, it redirects to node view ...
0
votes
2answers
46 views

How do I remove the term ID from the view URL?

I have a content view with an exposed filter based on a vocabulary. In the URL (for example, mysite/myview?tid=taxonomy+term+(3)), and incidentally in my page title (I use argument.tid to display a ...
-3
votes
1answer
32 views

How do I clear the cache for a custom block?

I have custom block holiday this block is not updating once I'm updating data in database when I'm clearing the cache block is working. Is there any solution for this cache issue? I'm attaching the ...
-1
votes
2answers
12 views

Commerce discount rule

Have this scenario, a user must get 10% discount on only these products (product 1 & 2 is defined in rules), if at least 5 items of each is in cart. Cart: 5 pcs product 1 500 5 pcs ...
-2
votes
0answers
29 views

Empty node in content type after migrate from d6 to d8? [on hold]

After migrating node type with drush migrate-import d6_node:chassis --update, It show error drupal-8\core\lib\Drupal\Core\Database\Connection.php:683 SQLSTATE[23000]: Integrity constraint violation: ...
0
votes
0answers
5 views

Views Search API Filter on Year (date) field with Select List

Using Search API with Solr I am able to use views filters on all fields that are taxonomy getting a full list of the terms. I am trying to use filter on the date field, but am not getting a list of ...
0
votes
1answer
24 views

Pass hidden fields using drupalSettings to Twig template

We have a paragraph field (field_pr_custom) on the Basic page content type that has a custom twig template, pr-custom.html.twig. In the twig template, we need to pass in an array inside of a <...
0
votes
0answers
10 views

How do I troubleshoot a node not appearing in wokbench?

I have a bug report where a user is not able to see 'Draft' status nodes that they have just created in their workbench interface (at /admin/workbench). They are able to see other nodes in various ...
0
votes
1answer
12 views

Use 'Search Api Attachments' file extractor in my own custom 'Search Api' processor plugin

I'm writing a custom processor for search api that will search body content of nodes for links to pdfs and extract the content from them to be indexed. It's meant to be able to do the same thing ...
2
votes
1answer
22 views

Generate installed modules into a composer.json for existing site: I need to manage via Composer, not via UI

I have a Drupal 8 site up and running with modules that were manually installed. I want to generate an appropriate composer.json file to manage these using Composer. The closest I could find to ...
0
votes
0answers
10 views

How do I handle “group by” for values in multiple groups

In Drupal 8, using the Views module, I have values of Content type "X" grouped by a 'category' field. Everything worked fine until I was forced to apply two groups to one of the values. In my example, ...
0
votes
0answers
26 views

Fatal error when I try to alter appearance of the site [on hold]

please help me. I do not know what else to do. Every time I click on the appearance section, it gives the following error and I have to restore to backup: Fatal error: Call to undefined function ...
3
votes
1answer
38 views

How do I programmatically duplicate a view display?

I have a view (my_view) with the following displays: master page_1 I am looking for a way to programmatically duplicate page_1. $view = Views::getView('my_view'); $storage = $view->...
0
votes
0answers
26 views

Add custom ajax command to ajax response after webform is submitted

What I'm trying to do is to invoke some javascript after a webform is successfully submitted by ajax. To do that I followed this advice and created an EventSubscriber to intercept ajax response and ...
0
votes
0answers
19 views

Theme files being pulled from sites/default/files rather than sites/<sitename>/files

I'm pulling down a repository of a D8 multisite install and running it locally. The sites are set web/sites/default and web/sites/mysite. In the root of sites there is a sites.php which contains $...
1
vote
1answer
49 views

How do I fix the “The each() function is deprecated” error?

I am using Drupal 7.6.0 on a server with PHP version 7.2.11. I get this error message. Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in ...
0
votes
1answer
18 views

Validating a node body

hello i am trying to validate the content of the node body for certain text having some trouble with it. it outputs an message "array". function test_form_alter(&$form, FormStateInterface $...
0
votes
1answer
18 views

Permission for private file to anonymous

I have an ad content type, with a file field that is in a private directory when saving the node. Ads and their files are only accesible for authenticated users. I wish I could allow anonymous users ...
0
votes
0answers
18 views

How to open modal on form button click with data from callback?

I have a form button with ajax callback: 'button_ajax' => array( '#type' => 'button', '#value' => t('Add short name'), '#attributes' => [ 'class' ...
0
votes
0answers
18 views

Duplicated node pages are created with other language prefixes. How to fix it?

The content on our website is primarily created in English, however, we also have 3 other languages (fr, de, es) implemented. But not all the content is translated. The problem is - in Google, we see ...
0
votes
1answer
25 views

Disable registration on commerce checkout

According to https://docs.drupalcommerce.org/commerce2/user-guide/checkout/allow-register-at-checkout the 'Login or continue as guest' checkout pane should have an option 'Allow registration'. In my ...
0
votes
0answers
5 views

How to synchronize the new panes of a content type in panelizer with the existing nodes?

I have a content type which uses panelizer. I have placed different panes in different regions. Everything is working. I have existing nodes with the same settings. Now I added a anew pane to the ...
-2
votes
0answers
17 views

Is it possible to add an Ajax action on a button define in a twig view template?

I have a view for which I customized the views-view-field...html.twig template. On each row, I added a first button A which opens a modal with two buttons: Button B to confirm the action and Button C ...
-2
votes
0answers
16 views

Form type specific field with modal select [on hold]

How could I implement something like this: How to render a list of elements in drupal_form so that they would be all as an independent element? This way I output textarea and button: 'short_name' =&...
-2
votes
0answers
13 views

Find the sum of a column and group by a field

Please see the below image, I need this to be collapsed and summed according to the FIELD. I have spent a long time searching but most of the steps refer to drupal 7 modules and ways. I'm using drupal ...

15 30 50 per page