All Questions
87,318
questions
0
votes
1
answer
719
views
How do I import product category based on taxonomy vocabulary?
I have a products catalog based on taxonomy vocabulary, as advised the term reference field is on the product content type.
Products imports are working fine, but when I try to import product ...
-1
votes
1
answer
24
views
How to add a script tag into a twig page template?
I am trying to insert a script tag into a page twig template but it appears that Drupal 9 doesn't allow that. Specifically, this is what I am trying to do:
<script>data-entry-id="{{$id}}&...
0
votes
0
answers
10
views
Querying a pool of multiple (200+) databases to check if a table is empty or not
My task is to query if the customers are using a certain feature on all our sites 150+ sites.
Probably if I can draft a query like this and I get 0 the table is empty = feature is untouched.
SELECT ...
3
votes
1
answer
1k
views
Prompt user to download file via AJAX form submission
I have a file that is generated when an AJAX button is clicked. I want to immediately have a file download prompt come up. The file is being generated and has the correct data in the file. I just don'...
2
votes
4
answers
4k
views
use-ajax class for ajax link not working in dynamic content load
use-ajax class link not working when i load new content using custom ajax code, which has the use-ajax class links.
I use normal jquery ajax to load the content because, i have drag and drop ...
4
votes
2
answers
4k
views
Programmatically modifying global custom text field in view
I have a (Apache solr) view with a Global: Custom text field in addition to my normal fields. This field is meant to get value from a custom function/existing field/passing an existing field to a ...
0
votes
2
answers
581
views
How to let a user switch between blocks that need to be shown?
I have pre-defined blocks A,B and C that are meant to be placed in the sidebar_first region. What I would like to achieve is: a visitor could select the block that needs to be displayed for the ...
0
votes
2
answers
26
views
How to do Do a redirect in buildForm()?
I send a link to a URL by email. This page is created with a controller which contains a form (FormAPI). I pass a token as a parameter to secure access to this form. So I check if this token exists ...
1
vote
2
answers
967
views
Node Add / Edit Options Vertical Tab Problem
For just one of my content types -- the built-in Article content type -- the node option vertical tabs at the bottom of the add / edit form are not displaying correctly.
As shown in the attached ...
1
vote
2
answers
740
views
Value from ajaxified form field not passed to ajax callback
This is a continuation of this issue, where I couldn't get the ajax to fire on an entity reference field in a node edit form. With the following code, I'm able to get the ajax to fire.
/**
* ...
0
votes
0
answers
34
views
Upgrade Status, PHPStan problem [closed]
I am about to upgrade my project to Drupal 10 and I am using the Upgrade Status module for that.
I have a few projects on my machine, for some of them I am facing this error, for some of them not.
In ...
4
votes
1
answer
725
views
How to properly log custom exceptions?
I'm trying to improve the code quality of my custom module by adding custom exceptions. Before, I was lazy and throwing \Exception everywhere, but I recently refactored all my code to use custom ...
7
votes
1
answer
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/...
0
votes
1
answer
1k
views
Composer downgrading module version
I wish to move the bootstrap theme from the repository
located in the folder theme/custom to be a dependency in composer.json
I've checked that the current version drupal/bootstrap is 3.16
I perform ...
1
vote
1
answer
761
views
Pass multiple ids as Views Arguments in the Rule action Save PDF as file on server
I'm using views PDF to print out a list of nodes on a single PDF, one per page.
Now I have more than 1000 nodes/pages on a single generated pdf, so I'm trying to use VBO and Rules to create a view ...
0
votes
1
answer
418
views
How to make Adaptivetheme dropdown menu show on start page?
I'm using Drupal 8 with an Adaptivetheme subtheme. The horizontal navigation menu resides in the leader board region. Some menu entries have submenus, but they do not show on the start page. One has ...
0
votes
0
answers
40
views
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "The filter image lazy load" plugin does not exist
How can I resolve this issue? This log issue occurs in Drupal 10.0.10, Drush 12.2.0 PHP 8.1
Everything seemed fine when I had upgraded to D10 all the sites were working fine, All of sudden its ...
1
vote
1
answer
3k
views
Content: Has taxonomy term ID depth modifier
Answer to my question was found here: Show all child nodes of a taxonomy term D7.
But I'm not able to understand the use case of the second option: "Content: Has taxonomy term ID depth modifier" as ...
0
votes
1
answer
2k
views
How to get order information on the checkout complete page?
How do you get the order information such as user's name, address, e-mail and products he ordered, on the checkout complete page on Drupal Commerce for Drupal 7?
0
votes
1
answer
791
views
Is it possible to add inline css styling to a twig email template?
Is it possible to add inline css styling to a twig email template? Not as a source file reference but by inclusion of css within the template similar to html <style>...</style>...
-2
votes
0
answers
15
views
gutenberg module giving errors when adding web pages [closed]
i keep getting this error when i am trying to add a page to my website using gutenberg module. Added a picture of the display screen. Could someone help figuring out this issue.
TypeError: Cannot read ...
1
vote
2
answers
2k
views
Add CSS class to <form> element using webform and template file
I have an existing webform in Drupal 7 which I am trying to theme.
So far I managed to add CSS classes, placeholders, prefix, suffix,.. to form elements (fields) but not to the actual <form>-tag?...
0
votes
2
answers
421
views
Hide a view tab if it has no results
I have a view which has 5 menu tabs. I want to hide the tab if it doesn't have any results. Can anyone please help me with the suggestions.
1
vote
1
answer
718
views
Trigger AJAX from a Google Maps Marker
I have a Google map loaded through the Google Maps API with markers generated from node locations.
How can I cause content to be loaded via AJAX when one of the markers is clicked.
For example, if ...
0
votes
1
answer
411
views
How do I properly install?
In order to install MailChimp in Drupal 8 I followed the instructions for the MailChimp Drupal module.
Instructions for 8.x-1.x
The 8.x-1.x release uses version 3.0 of the MailChimp API and ...
0
votes
1
answer
1k
views
Storing and retrieving custom field value of a webform in/from database?
I have altered a webform by adding a date field in different language like chinese in Drupal 7. But what steps are required to store custom field value in database and retrieving value when webform ...
0
votes
1
answer
21
views
How to create a page with a specific form display?
And how do form displays work at all? I have a content type "Sketch" that has an image. As an authed user, I can create a Sketch at /node/add/sketch . But that uses the default form - how do ...
1
vote
1
answer
740
views
Backup & Migrate scheduled backup silently fail
I've tried to use backup & migrate for backups on my omega8 based aegir server.
Although I've defined a schedule, and setup cron interval to 1 hour, it doesn't work - no backups are generated. ...
0
votes
2
answers
26
views
How to Save Configuration Data for Custom Block
I'm have a custom module that creates a custom block plugin, but am having trouble figuring out how to add some custom configuration settings to the block.
Just for understanding how to do this, I've ...
0
votes
1
answer
559
views
Custom webform validation handler not getting called using Event subscriber
I am trying to implement a custom validation for webform. I need to validate if user entered email is valid or not. For that I have altered the webform using event subscriber and assigned a validation ...
0
votes
1
answer
1k
views
What's wrong in my code for setting up entity title in a Computed Field?
I have written inside a Computed Field's Computed Code section the following code:
<?php
//work if the node is new and there is no value for the field yet
if (empty($entity_field[0]['value'])) {
...
3
votes
3
answers
1k
views
AJAX doesn't work in custom form element
I want to create a custom form element for email that have a textfield and button and when click button send an email but ajax not working inside form elemen class. I test it in form api and it's ok ...
0
votes
0
answers
28
views
Why does changing subsite nginx vhost file to use php8.1 result in /core/install.php for an already installed site?
I'm trying to get the three sites of a multisite installation to use php8, all three have existing vhost files. The root site will use php8 after updating the vhost config, but the subsites respond ...
0
votes
1
answer
693
views
Can't install modules from UI when site placed in subdirectory
I have Drupal 8 installed in a subfolder (www.example.com/drupal), and I have my root .htaccess configured to mask the subfolder (i.e. the URLs resolve to www.example.com; /drupal does not appear in ...
1
vote
2
answers
711
views
Why is my library not attached when programmatically rendering a block?
I have this block:
public function build() {
$build = [
'#attached' => [
'library' => [
'mymodule/mylibrary',
],
],
'#markup' => '<!-- see template -->...
2
votes
2
answers
4k
views
How do I create a conditional form field?
I have this dropdown menu of options in the user registration page of my site (image shown below), and i want when the user selects the employer, some text fields appear, like name of company, and ...
0
votes
1
answer
739
views
Exposed Filters View is not functional with Anonymous Users
I created a Filtering Search with Multiple Exposed Filters. It all has been working fine except one thing; when I logout as an admin and use the site as an anonymous user, exposed filters don't work.
...
0
votes
1
answer
578
views
User password reset link leads to access denied page
Command:
drush uli
Output:
http://default/user/reset/uid/..../...hash.../login
The output URL normally logs you in automatically, but it gets takes to access denied error instead.
3
votes
1
answer
56
views
Drupal::entityQuery NULLS LAST
I want to sort some entities ascending after expiration date, but I want those without expiration date to be at the end. Is there a way to add a CASE expression like this to the Drupal::entityQuery?
...
0
votes
1
answer
2k
views
Returns 403 error after user login
My site was copied from production to test server. It works on Drupal 7 + Nginx + PostgreSQL. On production, user login works fine, but on test server I receive a 403 error on users/admin (or user/1) ...
0
votes
0
answers
23
views
Restrict access base from a database table
I was modifying a 2fa module for restricting users to access other account's page (user/%/2fa) which is working.
function custom_2fa_menu() {
$items['user/%/2fa'] = [
'title' => t('...
0
votes
1
answer
583
views
How to edit the id of a form element of a content type?
I have a content type with a text field that I need Javascript to do some work on (when in the content type add/edit form). I prefer to have Javascript identify the form element by it's id so I would ...
9
votes
4
answers
1k
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 ...
0
votes
3
answers
2k
views
Google API callback doesn't work
I've created this javascript (delivery.js) that is supposed to take a pre-existing div on a webform page and append a Google Map to it, along with a few circles of differing radius.
Here is my ...
0
votes
2
answers
48
views
How can I programmatically update an exposed filter? [closed]
I am trying to apply an exposed filter programmatically.
If filter 'a' is set to 'apple' I want to set filter 'b' to 'green'.
Using this code updates the filter. If a user sets the drop-down filter 'a'...
0
votes
1
answer
47
views
Why is the Charts module not working for anonymous visitors?
I'm using the Charts module in my project. I've configured Google Chart in my custom view which needs to be shown to anonymous users. The view is shown, but the chart is not rendered for anonymous ...
3
votes
3
answers
2k
views
How to migrate to translatable fields
I am using the latest Entity Translation module in order to provide a couple of translatable fields for some of my content types. I have a content type which has a translatable field which is called "...
1
vote
1
answer
978
views
How to calculate the average ratings for the post when the user submits 3 field ratings?
I need to implement ratings in my site. I have user five star rating and voting API module, I created a content_type with "beach", and created some field in the manage field settings, name, id, etc. ...
0
votes
1
answer
61
views
Finding all nodes not referenced by a menu
I see this question was asked for Drupal 7, but the menu_link table doesn't exist in Drupal 9.
Is there a SQL query for listing all nodes that are not assigned to a menu?
2
votes
1
answer
376
views
Jump Menu Style Dropdown To External Links
I'm attempting to create a jump menu of links to external websites, and I would like to be able to order the links within this menu differently depending on the organic group of the current user ...