Questions tagged [8]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

Redis::select() expects parameter 1 to be integer [closed]

I have been using PHP Redis for my website from long time. Yesterday I updated my site to core 8.9.2 and Redis Module to 8.x-1.4. After updating I get a PHP warning in my log: Warning: Redis::select()...
0
votes
1answer
13 views

Add relationship to node view

I recently installed the "simplenews" and "simplenews_scheduler" modules. The first module generates a view where you can see the newsletters. My idea was to create a relationship ...
0
votes
1answer
14 views

How to create content / entity via ajax on a view?

I have a view listing some content and I want to have an "Add new" button, which should load the node form via ajax (either modal or into a div). After I save the form, it should still stay ...
-1
votes
0answers
13 views

Dynamic node field based on terms in a vocabulary

I'm hoping there is a module for this, but happy to get dirty in code if need be: I have a vocabulary "Currency" which has "USD", "HKD", "GBP" as terms. On my ...
0
votes
0answers
5 views

Promotion codes discount not working for existing order

I'm using Commerce 2.20.0, where there are existing orders by the end-users where they've utilized the promotional coupon code provided & the discount is working as expected. But when someone with ...
1
vote
0answers
33 views

Paragraph's fields value loaded in a custom controller are in the default language instead of the current language

I made a custom controller that load a paragraph field from a node and then render some part in a template. The paragraph field field_title and field_description are translatable. The translation ...
0
votes
1answer
49 views

How can I disable the cache for a specific page or have the cache ignore query params?

I need to disable the cache for a specific page, or get the cache to ignore query params. I have tried this, but it does not disable the cache for me https://www.drupal.org/project/...
0
votes
0answers
23 views

How to set URL for image with view method properly?

Image formatter should accept image_style and url parameters. I've got image_style working but not url. function mymodule_preprocess_views_view_field(&$variables) { // ... $variables['image'] =...
0
votes
1answer
41 views

Hook on drush cache:rebuild

Is it possible to hook on drush cache:rebuild before the command is executed? I've seen some hooks for afterwards, but I am trying to compile my less files into css before cache the is rebuild. I'd be ...
0
votes
0answers
25 views

Custom Action not available in Views

I am attempting to add a custom User action so that it will be available as a Bulk Update in the user_admin_people view. In /web/modules/custom/my_module/src/Plugin/Action directory I have this file ...
0
votes
1answer
16 views

Custom PHP Unit test trait for a custom module cannot be found

I have created a new Trait for testing my custom module and placed it in my_module/tests/src/Traits with the namespace Drupal\Test\my_module\Traits, the same as core modules do. When I try to use this ...
0
votes
1answer
33 views

Add custom access check to user page

I would like to add an additional access condition to viewing user pages like user/1. I looked at the following guidelines, but have not succeeded in coming up with a solution. https://www.drupal.org/...
-1
votes
0answers
22 views

Share private content via e-mail

I'd like to use my Drupal 8 website to share some big files to some authorized people (20-30) on a monthly basis. These people change every time, so I wouldn't register them as regular users with a ...
0
votes
1answer
28 views

How to get the entity ID in a twig template

I have a custom entity, with the template my-custom-entity--my-entity.html.twig. How do I access the ID in the template? I can do this by implementing hook_preprocess_entity, but am wondering if the ...
0
votes
0answers
30 views

For performance, one multi-value field or four individual fields?

I have a node content type that needs to store four different int values: Score A Score B Score C Score D Each node of the content type always has all four int values. I could store this one of two ...
4
votes
1answer
56 views

Load nodes by property, including empty ones

I want to render a node with certain properties set. For example, I want to load every node which ONLY has field_a and the other fields are empty. If I use $this->nodeStorage->loadByProperties(['...
3
votes
0answers
21 views

How can I correctly attach a file to a mail? [duplicate]

I am very new to drupal and need to upload a file and sent it as attachment in Drupal 8. I have created the form element like $form['candidate_attachment'] = [ '#type' => 'managed_file', '#...
-2
votes
1answer
43 views

Clear render cache with Rules [closed]

In Drupal 8, I want, every time I publish a node, to clear render cache. I have a Cover image in the homepage from a custom module, that doesn't follow the caching defaults as the rest of the site. I ...
-6
votes
0answers
74 views

What exactly is Drupal? [closed]

I asked this question which I later learned is apparently preposterous and was heavily downvoted. I'm not sure what Drupal is or what it's for. I am wondering of someone could enlighten me, like how ...
-1
votes
0answers
32 views

Getting values from checkbox in foreach loop form [closed]

Im building a custom module, this module is getting data from values in db, i have created the form using this way: $data = []; foreach ($nodes as $node) { $getData = \Drupal\node\Entity\...
0
votes
0answers
31 views

Replace the default modal with a different one

I want to replace Drupal 8 default modal with MDB. How I can do it? Should I unload default library for modals and load new one? Any idea?
1
vote
0answers
22 views

Use Order Number in Receipt

I want to use the Order number rather than the order id. I'm using Commerce POS and it uses $commerce_order->id()to generate the id used in the receipt generated and receipt email sent. But in ...
1
vote
0answers
25 views

Views_pre_render How do I get a file's path url if I only have the file name?

I have a dynamically created Views listing page where I display fields from "Collection Items" node type in this order: Item Title Item Status Date Stamp Document (uploaded file. I'm only ...
1
vote
1answer
40 views

Using container element in form widget

I want to build a widget for a own field type. In the function formElement() of my widget I want the elements wrapped in a div. For this purpose exists the container element. So I build my form: ...
0
votes
0answers
36 views

How do I move a Composer-managed site to a new server? [duplicate]

I have a Drupal 8 site on an Ubuntu 18.04 server and want to move my site to a new server with Ubuntu 20.04. With Drupal 7 I did these steps Create a set of keys (on the new server) : $ sudo ssh-...
0
votes
0answers
28 views

The SQL storage cannot change the schema for an existing field (id in sms_phone_number_verification entity) with data

I am using the SMS Framework module and after updating my site from Drupal core 8.8.8 to Drupal Core 8.9.3 and the SMS Framework module from 8.x-1.3 to 8.x-2.0.0-alpha1, I start seeing the below error ...
0
votes
0answers
26 views

Access custom fields on account of current logged in user [duplicate]

I am trying to do something which seems like it would be pretty damn simple, yet I can't get to work; access a custom field (added via the UI at /admin/config/people/accounts/fields), for the current ...
0
votes
0answers
26 views

Ajax callback issue

I am using ajax callback on field_status. This is a drop down menu. A selection in field_status should trigger comment fill-up. I am getting blank comment box. function helper_form_alter(&$form, \...
1
vote
1answer
39 views

How can I avoid to return HTML markup for access denied? [duplicate]

I've developed a custom controller that serves as a simple endpoint, POST method. This controller has custom access control. Custom access is done by looking for a header in the HTTP request, by ...
0
votes
1answer
21 views

How do I detect whether any contact forms have been created?

Context: On my Drupal 8 site I'm trying to add in a new section containing a view that lists out all forms. The user can then click on one of the form and it launches a download of all the messages ...
0
votes
1answer
48 views

How can I get a list of all connected/logged in users?

I would like to make a list of all logged in users accessible through the backend. The routes are created. It is only the request to retrieve the users that I would need. Is this data in the 'sessions'...
0
votes
0answers
26 views

Default_value not working for radio buttons after ajax calback

I am having problem to set the default_value of radio button populated after ajax callback. After ajax callback radio button is populating but default_value is not selected. Here is my code. $...
-1
votes
1answer
22 views

Email verification field for content types

I have a content type with email field. I will like users to verify the email field when they create content. I don't see a Drupal 8 module to do this. Is there an easy programmatic way to achieve ...
0
votes
0answers
41 views

D7 to D8 migration running incredibly slow

We are upgrading our D7 instance to D8 and when I migrated my local instance over it took a couple of hours, but that was no surprise. User migrations were processing about 50 users at a time via the ...
0
votes
1answer
28 views

Why will drupal not recognize my configuration?

I am trying to import configuration from one site to another. I have copied the directory full of config files from an older site to my new site. When I try to run Drush cim, the files all show up ...
0
votes
1answer
50 views

Copying prod multi-site installation to dev multi-site installation

I am attempting to upgrade my Drupal 8.9.2 multi-site installation to D9. I was hoping to work this all out on a development installation, that is located in a subdirectory of my home directory on my ...
0
votes
0answers
13 views

Google Tag Error when clearing cache?

I have been trying the below issue when clearing the cache on DEV. Drupal\Core\File\Exception\FileWriteException : The specified file 'temporary://file9PWd0P' could not be moved to 'public://...
2
votes
1answer
42 views

How to send system mails in html format (with Swift Mailer)?

At Account settings page (/admin/config/people/accounts) I can edit system mails Drupal is sending (Welcome, Account activated, Account blocked and so on). I also installed and configured Swift Mailer ...
0
votes
0answers
10 views

How to add another form mode(commerce_order_item) in add to cart formatter?

I need to configure multiple form mode(commerce_order_item) for add to cart formatter. By default add to cart points to add to cart form mode. I have created couple of form modes like quick add to ...
0
votes
0answers
17 views

How do I use the computed twig element to get the value from a custom composite element?

I have created a custom composite element by cloning the example module of Drupal 8 Webforms. It has a radio button and 4 select boxes. So when clicking 'Add" button, another row is being created,...
-1
votes
0answers
24 views

db_select fails when query condition argument contains & symbol

$query = db_select('node','n') ->fields('n', array('nid')) ->condition('n.title', $node_title, '='); When $node_title string contains the & symbol, it isn't working. How can I encode ...
0
votes
1answer
68 views

Ajax error when trying to add another paragraph

Drupal 8.9 and paragraph 8.x-1.11 My issue is that Ajax breaks when altering the #validate form. This is an issue for any form! It may have to do with my ajax, but here is my setup. I have a paragraph ...
0
votes
2answers
21 views

Migrate Multiple URLs from a Spreadsheet into ONE Link Field

I'm trying to migrate from Google Sheets into Drupal 8.9+. I have successfully configured most of the migration, but am having trouble migrating two source link fields (Event URL & Ticketing URL) ...
-1
votes
1answer
28 views

What is correct api key name in headers

I'm using this module https://www.drupal.org/project/services_api_key_auth, it states that you can either put the api_key in query string or inside header. In query it works like this domain.com/api/...
0
votes
0answers
18 views

Content moderation “current revision” not set on nodes migrated from Drupal 7 where there are both a published and draft revisions

I am working on upgrading a Drupal 7 site to Drupal 8. The upgrade uses a content-only custom migration. The Drupal 7 source site and the Drupal 8 destination do not contain any custom modules other ...
0
votes
0answers
15 views

Automate notification to Mailchimp

I am trying to automate a notification integration between Drupal8 and Mailchimp. I currently the Mailchimp module installed and a signup form has been configured so that people can signup for ...
1
vote
2answers
42 views

phpcs rule or sniff for detecting usage of the “ksm()” or “kint()” function?

Would it be possible for my local PHPCS standard to warn me when I use certain PHP functions like kint() or ksm()? It's not part of the Drupal Standard but I'm running a modified version with some ...
-1
votes
0answers
57 views

Layout Builder and field_collection issue

I migrated all my field_collection content to the paragraph module without any issues, but Layout builder seems to be buggering up when I try to use it. I get: Drupal\Component\Plugin\Exception\...
-1
votes
0answers
29 views

How do I make a value unchecked if another value is checked?

Sorry if there's a simple remedy for this, but I have two separate checkbox types that both need to be unchecked when the other value is checked. Both have attached sections to them that also need to ...
2
votes
1answer
35 views

Is the X-csrf-token only available for authenticated users?

I am working on a rest api end point. I am noticing that some end points work without X-csrf-token header. Digging into the core revealed the following // This check only applies if // 1. the ...

1
2 3 4 5
297