Questions tagged [drupal-8]
Drupal 8 is the Drupal version that was officially released on November 19, 2015. Rather than using this tag, consider posting your question directly on https://drupal.stackexchange.com/.
2,832
questions
0
votes
0
answers
11
views
Drupal custom payment module form problem
I'm a bit new to drupal and i'm trying to create custom payment gateway module and stuck with a problem.
When creating OnSitePaymentGateway, everything is ok and i can edit checkout form with ...
0
votes
0
answers
7
views
Drupal 8 - outage screen shows " The Specific URL cannot found" error
Recently WAF has been implemenent in my project to enhance network security. Whenever I go to maintenance mode window ,enter the outage and click save configurations " The Specific URL cannot ...
0
votes
1
answer
12
views
How do i get the url from a drupal webform url field in a webform handler
I created a webform handler and it's creating the node and passing all the content appropriately EXCEPT the url in one of the webform fields (the field 'Apply').
Any idea what I am doing wrong? Below ...
-1
votes
0
answers
20
views
How to create a log of date,time in database whenever cron executes in php
How to add condition in my code that whenever a cron executes log should get in database that today at this time at this date the cron executed...
So when next time cron executes should check in table ...
-1
votes
0
answers
11
views
Drupal 8.9 : TypeError: Argument 1 passed to Drupal\update\ProjectSecurityData::createFromProjectDataAndReleases()
Hi Drupal Community -
I started seeing this error while doing the composer update on my drupal 8.9 websites. Could anyone please take a look at it and see if you can give me direction?
117 FastCGI ...
1
vote
0
answers
13
views
Drupal\Core\Form\EnforcedResponseException at View reset button click - D9
I have a view that uses exposed filters with a "Reset" button. After searching, when the reset button is clicked, I get to see the below error:
The website encountered an unexpected error. ...
0
votes
0
answers
13
views
Hide/show additional fields depending on whether the checkbox is checked using formstate and hook_from_alter
There is an entity form on the website.
This entity form has a checkbox with the label Remind me about an event
If the checkbox is checked, I need to display two additional fields in this entity:
...
0
votes
0
answers
11
views
How can I see/access the revision history of a Drupal user in Drupal 9
How can see the revision history of a Drupal user. I can see the history on content types, but I don't know how to access this same data for a Drupal user. So if i am here
user/13/edit there is no ...
-1
votes
1
answer
18
views
how to dismiss drupal supported version alert
I have hosting with php 7.4 and Drupal 8.9.20.
In admin section I have alert that drupal is old.
Drupal 9 support only php 8 and I can't update server, hosting supports only 7.4.
How to remove this ...
0
votes
1
answer
29
views
Warning: file_put_contents(): Filename cannot be empty
After updating Drupal 8 to Drupal 9, the following error is displayed on the website page:
Warning: file_put_contents(): Filename cannot be empty in /var/www/html/web/modules/contrib/devel/src/...
0
votes
1
answer
30
views
Read values of entity reference within another entity reference in Paragraph preprocess - D9
I have a content type that has a Paragraph entity reference field named "Grants". This "Grants" paragraph field has another paragraph entity reference field names "contacts&...
0
votes
1
answer
16
views
How can I add a new tab to the product description page in Drupal 8?
enter image description here
How can I Achieve this?
1
vote
0
answers
16
views
How do I call a theme function from Drush command?
I would like to use a function defined in (active) custom theme (i.e. mytheme.theme) in a Drush command which is defined in a custom module, but it does not seem to be available and I cannot find a ...
0
votes
1
answer
18
views
How to embed Comment on Custom Template in Drupal 8 Twig
I have a content type named Project and I created a template for it page--project.html.twig I am new with Drupal and I want to include a comment box and comment list on this page but not sure what to ...
0
votes
1
answer
38
views
Print user role when submitting comments in Drupal 8
In my Drupal site, user profile has username, role and group Taxonomy term. There is a Article content type setup to take comments from users. Every time when a user comments, I would like to show as:
...
0
votes
0
answers
22
views
State/Province select list is not populating on selection of country in Address field drupal 9
I have added Address field on Webform in Drupal 9[version: 9.2.10]. But the State/Province select list is not populating when the country is selected from country list.
Current version of Address ...
-1
votes
0
answers
98
views
Composer updatec - curl error 35 - error:0407008A:rsa routines:RSA_padding_check_PKCS1_type_1:invalid padding
Environnent : WSL with Debian Distrib with proxy settings
Project : Drupal 9
Action : composer update
Result :
composer update Gathering patches for root package. Loading composer
repositories with ...
0
votes
1
answer
27
views
How to use Drupal 8 logger within the .theme file
I need to debug a preprocess function in a theme's .theme file. I don't have the project on my local computer, so I can't use dump-like functions on production.
I thought about using logs, but \Drupal:...
0
votes
1
answer
33
views
Validate the API key and the city name by the API request
I created a custom module where in the block I display the weather using data from https://openweathermap.org/
Code of this block:
https://phpsandbox.io/n/sweet-forest-1lew-1wmof
Also I have ...
1
vote
1
answer
25
views
Not the required data is displayed for the new user, because the data is taken from the cache of the previous user
I made a custom module that displays the weather in a particular city.
But I got these comments after the code review:
1. Interesting question, what happens to your cache data, if the site first comes ...
0
votes
1
answer
38
views
Modify "The changes have been saved." message - Drupal 9
When modifying and saving account information, drupal shows "The changes have been saved." message and that comes from Drupal core user module. Is there a way to modify this message?
0
votes
0
answers
9
views
Node wont save if text field contains word "having"
When I try to save edited node Drupal just reset field values and do nothing without any error message or log.
I entered text word by word and found that word "having" cause such behavior.
I'...
0
votes
0
answers
22
views
How do I read element attribute from $form_state?
I set a data attribute on my autocomplete element using jquery like this
$(event.target).attr('real-value','6');
How do I get this value from my $formstate or $form object in my form submit function? ...
0
votes
0
answers
75
views
GuzzleHttp\Exception\ConnectException:cURL error 7:
Using racaptcha in webform , while submitting form getting that error
Full error message GuzzleHttp\Exception\ConnectException:cURL error 7: in GuzzleHttp\handler\curlfactory::create rejection()(line ...
0
votes
1
answer
52
views
Drush cim proper workflow
We have a DRUSH CEX set under config/sync folder. Our 2 developer are working on the same project. Now here's the situation
Dev 1 ran drush cex and his config was exported
Dev 2 had a few changes in ...
1
vote
1
answer
38
views
How can i set up my drupal database correctely?
I guys I'm getting an error while I'm trying to set up my drupal database.
the drupal give me this error when i insert the database info, but I'm sure the database info is correct.
Warning: count(): ...
0
votes
0
answers
22
views
drupal 8 captcha in user login form if not true must be show validation before submit username and password?
how to make captcha in user login form
if not true must be show only message validation for captcha before submit username and password ?
0
votes
0
answers
11
views
Drupal 8.9 "Error: Call to a member function __toString() " [duplicate]
I have this error in Drupal 8.9.20 in a custom module: "Error: Call to a member function __toString()" with this code:
$html = \Drupal::service('renderer')
->renderRoot($template)
->...
0
votes
0
answers
39
views
Drupal 9 - custom module caching issue
Longtime D7 user, first time with D9. I am writing my first custom module and having a devil of a time. My routing calls a controller that simple does this:
\Drupal::service('page_cache_kill_switch')-&...
0
votes
1
answer
14
views
antiClickJack snippet's style tag part being inline requires unsafe-inline. How can we avoid the use of unsafe-inline?
I am working on Drupal 9.3.8 site and using CSP module to setup the CSP header.
There are few core dependencies or contrib modules which require unsafe-inline in CSP header but scanner recommends not ...
1
vote
1
answer
64
views
Drupal 9 multisite split .htaccess
I am working on Drupal 9 multisite and I want split the .htaccess file, one per site to create different redirect rules.
I know that it's possible to add all rules on drupal_root/.htaccess but I ...
0
votes
1
answer
39
views
Drupal Error 502 bad gateway. When I Access TabPages inside of Content
I'm having this issue with Drupal after an update from Drupal 7 to Drupal 8.
The error is the following, when I go to the admin page, I go to content -> filter by -> tab pages -> and try to ...
0
votes
0
answers
56
views
Drupal 8 Localhost is super slow with MAMP on MACOS
Currently im trying to host a drupal 8 website in my local using MAMP in MAC (bigSur)
but unfortunately, it has a weird behaviour that it takes more than 10 mins to load a single page when connected ...
0
votes
1
answer
145
views
Query Drupal 8 content types with expression
In short, I need to do an entity query while running an expression. I can't find any way to accomplish this. I'm assuming there should be two ways.
An entity query with an expression - When I try ...
0
votes
0
answers
84
views
How to submit webform submission after modal popup shows message click Accept submit webform
I have one sample webform on Drupal 9 in my scenario
After I filled webform. Click submit nees to open modal popup message Accept or Decline
2.After popup shows message if click accept button need to ...
-1
votes
1
answer
56
views
is there a way to delete a taxonomy term without deleting its children in Drupal 8?
Is there a way to delete a taxonomy term without its children being deleted and without going through the Taxonomy Manager contributed module (This module causes a problem when editing a term)?
Thanks ...
0
votes
0
answers
136
views
Route does not exist
I am new to the dupral. The site throws the error
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.webform_ui.element.add_page" does not exist. in Drupal\Core\...
0
votes
2
answers
567
views
The website encountered an unexpected error. Please try again later.-- Upgrading Drupal from 8.9 to 9.3.5
I am upgrading my drupal project from 8.9 to 9.3.5 but after the upgrade while hitting website one error occur i.e
The website encountered an unexpected error. Please try again later.
I followed the ...
0
votes
2
answers
29
views
i don't know how to access to my drupal website ubuntu
I don't know much about Drupal and Drush, but I followed all the instructions and i was able to put a Drupal project on one of my servers. The problem now is that I don't know how to access
to the ...
1
vote
1
answer
57
views
Geolocation module - how to call abstract class method properly
I'm using the custom module in my project, and it was working fine with Geolocation 1.11 module.
After I've updated Geolocation to 3.7 my custom module stopped working.
What I've found - my custom ...
0
votes
1
answer
59
views
HOOK_module_theme_suggestions_node_alter suggestion twig not working
I implemented a HOOK_module_theme_suggestions_node_alter to add a custom twig template. Now below is my code
function gf_theme_module_theme_suggestions_node_alter(array &$suggestions, array $...
0
votes
1
answer
129
views
Fresh Pantheon Drupal Install not working on Local
I've cloned a fresh Drupal install from Pantheon and I'm attempting to run it on my local machine.
I've used Lando to clone a repo and pull the relevant files, db, and code. I attempt Lando Start and ...
0
votes
0
answers
39
views
Drupal 8 TWIG: Retrieve the value of the ID in another content type
We have trying to get value from question content type to answer content type, what we could able to get the ID of the Question content type using the below mentioned codes.
<ul>
{% for ...
0
votes
1
answer
60
views
How do I change the content in the Drupal 8 full-calendar dialog
I am using the Full Calendar View Plugin (via Smart Date Calendar Kit) on Drupal 9 and I do not see any way to manage the dialog/popup content displayed after clicking an event.
The dialog displays. ...
0
votes
0
answers
7
views
URL not rendering properly in JSON file
I have a JSON file that includes URL's. I have one that is giving me a problem. The URL breaks at the # tag. I have searched through the docs to no avail. We are using Drupal 8 and I do not have ...
0
votes
0
answers
59
views
Drupal Auth0 retrieving access token to make external API calls
We have a Drupal project which is integrated with Auth0 using this module https://www.drupal.org/project/auth0
Authentication works as expected and everything is cool so far.
There is one React ...
0
votes
0
answers
89
views
Filter View Reference results in paragraph based on taxonomy term selected in Drupal's backend
I have a paragraph named "Car Slider" and a Content Typ "Cars".
The content type consists of different fields like name, make etc. as well as a "Tags" taxonomy reference.
...
0
votes
1
answer
34
views
Varnish cache is missed after some time
Varnish cache is missed after some time even though the Page cache maximum age in "GENERAL SETTINGS" of Advanced Varnish configuration is set to "1 month"
While overriding the TTL ...
0
votes
1
answer
144
views
Is there a way to call a JavaScript function declared on another file en Drupal?
I want to create a custom module, to do consume an API, and I need to create a JavaScript function to return API data, and call this JavaScript function from another JavaScript file, in another custom ...
0
votes
1
answer
29
views
How to output nodes tagged with only one term?
I have many nodes with taxonomy term field "Tags"
For example:
1 node with tid: 10, 12, 20
2 node with tid: 10
3 node with tid: 10, 16, 18
4 node with tid: 10, 20
5 node with tid: 10
I try ...