All Questions

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

new ssl cert not recognized

I created a new Drupal 8 site (latest version) on my Mac, using MAMP to test locally. I'd been using a self-signed SSL certificate, and yesterday purchased a Comodo PositiveSSL Multi-Domain (DV) cert. ...
0
votes
0answers
6 views

Custom module with config exposed in json api

I have a module with two pieces of config set using an admin form and Drupal the drupal config service. Like this /** * {@inheritdoc} */ public function submitForm(array &$form, ...
0
votes
0answers
4 views

background image with fallback

I am trying to add header images to my pages. I am currently getting the image in the form of a background using file_url(node.field_custom_image.entity.field_media_image.entity.fileuri) the problem ...
0
votes
0answers
6 views

Where are Commerce 2 hooks (or Events) in Commerce 2

I am working on replacing our payment system from D7/DC1 to D8/DC2 and the original code makes use of hooks. I have replaced some of them with events but I cannot find any information on the DC2 ...
-1
votes
0answers
5 views

WebForm - update a field with another field

Drupal 8.8.5 WebForm 8.x-5.19 I am using the WebForm module and I really like it. my need is this I have 2 date fields (Data1 and Data2) and I have to update the value of the Data2 field when I ...
0
votes
0answers
8 views

Edit search form with a module

I have made and installed a new module, called searchIcon. The problem is I want to edit the default value "Search" next to the search form. I tried the code below, but it does not seem to ...
0
votes
0answers
9 views

Which version of drupal, php, mysql combination will work on RHEL6? Which version of drupal, php, RHEL will work if we need to use mysql 8.0?

We have a working application which runs on RHEL6 with Drupal 7, php 5.3.3 and mySql 5.1.73. We are planning to migrate it AWS with latest versions which gets support. We need to know the working ...
0
votes
0answers
11 views

Form #states API by content type

I have a content type A. In this content type, i have paragraph (between 0 to n) with 2 fields. First field is content type select (A, B and C). Second field is based on the first field, only need to ...
-1
votes
0answers
25 views

Fatal error in product's pages The website encountered an unexpected error. Please try again later

Yesterday, after a clear all cache that I did, I take this error only in product's pages: The website encountered an unexpected error. Please try again later. I have found in error logs of site (/...
0
votes
0answers
11 views

Alter form field inside webforms

I have created a custom module in order to alter a webform that I created in the admin in drupal 8. I need to add ajax function to some fields. My problem is that I can not retrieve the field inside ...
0
votes
0answers
19 views

Add class to button with specific class

I'm trying to add the class 'on-load-click' to any btn with the class 'webform-submit' <div class="form-actions"><button class="webform-submit button-primary btn btn-primary ...
0
votes
0answers
11 views

How do I display the IMCE file browser in the same window?

When users access the IMCE file browser from their user profile it show in new pop up window. I want it to be integrated in the websites main content. Does anyone know how to do that?
0
votes
1answer
18 views

How to add JavaScript to a specific View if I don't know the node?

I've seen the answer here using the NID but I don't know this, I only have the URL. Is there is another way to do this please? function MY_THEME_preprocess_node(&$vars) { if($vars['nid'] == '...
-1
votes
0answers
8 views

Total paid amount deviates from the order total

A user has an order with a total of $269.35. The amount deducted was $327.48. The payment gateway was Authorize.Net AIM - Credit Card, where the order balance is -$58.13. I have debugged ...
-2
votes
0answers
19 views

Drupal legacy videos [closed]

Does anyone know where I can find Drupal 4.7 videos? I remember that I learnt Drupal through a video channel with 2 guys back in the days but I can't recall their website or their names anymore. I ...
1
vote
0answers
14 views

Pager not being rebuilt after $form_state->setRebuild() is called

I have a form that displays a TableSelect which is populated by a user-specific database query. This query can sometimes return over 1000 results so I'm paging the query and adding a '#type' => '...
0
votes
1answer
9 views

Views: List content NOT authored by the logged-in user

I want to list all the content that was NOT authored by the logged-in user in Drupal 9. Getting the list of content authored by the logged-in user is pretty easy. Create a View showing content. Add a ...
0
votes
1answer
24 views

Block plugin's render array values ending up in $variables['content'] instead of $variables

I've got a bizarre issue where my the render array from my block plugin's build() method doesn't seem to be properly interpreted by the template. I've got the following setup. function my_module_theme(...
0
votes
0answers
7 views

metatag_hreflang outputting extra hreflang tags

I need to generate hreflang tags in my website and I've installed metatag_hreflang submodule (belongs to metatag module) It's now outputting the following <link rel="alternate" hreflang=&...
1
vote
0answers
9 views

Approaches for multi-field values

I am using the Drupal 8 REST API to post content to a custom content type. I have a use case in which I need to post multiple values to a single multi-value field. If someone can show me how to do ...
0
votes
1answer
18 views

Is it possible to call response()->setStatusCode() within hook_theme_suggestions_page_alter?

We set up a custom error page theme by creating a block with the error text and then used the following code within a hook_theme_suggestions_page_alter implementation to determine when to override the ...
0
votes
1answer
11 views

How do I add a filter to a checkbox list in a content editing form

I have a taxonomy select field within a node form (7). I've chosen checkboxes and it is hard to scan them. I'd like to be able to add a filter so that the user can enter text to limit the number of ...
0
votes
2answers
47 views

How to remove stylesheets only for anonymous users?

I am trying to remove all unnecessary/unused stylesheets for anonymous visitors to get better performance and a clean <head> section. This works fine by listing them inside mytheme.info.yml: ...
0
votes
0answers
10 views

Export current gutenberg content for page entered in the visual editor as JSON

I'm using Gutenberg and various custom content types like blog post, person, article, etc. I want it so when a user creates an article it automatically fills the page with a preset set of blocks with ...
1
vote
1answer
20 views

When passing a variable from a render array to JavaScript how do you reach that variable in your Javascript

I add a variable in the backend to a render array like so (removed superfluous code): $some_var = 'Hello World'; return [ '#attached' => [ 'drupalSettings' => ['someVar' => $some_var], ...
-3
votes
0answers
19 views

How do I restrict date search to display only day and month, with hook_views_query_alter()?

I have a date popup in Drupal8, I want to restrict Year and only want to display date and month for birthday. In view I need to search all clients whose date of birth (only month and data) is same. ...
0
votes
1answer
16 views

Webform token formatting

I'm trying to get the answers from one form, pre-filled in another form by adding tokens in the confirmation URL. This works for most answers while using the token: [webform_submission:values:?] ...
2
votes
2answers
205 views

How do I send a variable from PHP to JavaScript from a function that returns a render array?

I'm trying to send a variable to my JavaScript. I would like to send a class name to my twig template and the same class-name to my javascript from a function that returns a render array. The function ...
0
votes
1answer
20 views

Webform variants as blocks

Drupal 8.9, Webforms 5.x I have a load of forms that are all basically the same, except for the confirmation URL (a download link, essentially) and some minor tweaks to the handlers. In an effort to ...
0
votes
0answers
13 views

What a part tried to get imported submission to web form without getting anything in

I have a couple of databases in excel that I am trying to adapt to webform. I have been introduced to the ten test to take this down to change some information to upload it. I have only received some ...
0
votes
0answers
18 views

How to add wrapper to article teaser content

I need to add a wrapper around the title, body, id, and created fields of the teaser below but am not familiar with how to implement this in a twig template. I need to have the image in a seperate ...
0
votes
0answers
39 views

How to add a field to menus?

I am trying to add an extra text field to the menu entity. My field is showing up and saving input but the input saves for all menus not just the one I entered the data for. This is how it is now: ...
0
votes
0answers
81 views

Best practices for modifying modules? [closed]

What are the best practices for modifying modules? Is there an equivalent to sub-themes, but for modules? Or are developers presently stuck copying/forking modules when even small modifications are ...
-1
votes
0answers
12 views

Change taxonomy term of node through comments

I have a node with status. Status is a taxonomy with states - open and closed. I need to change the status of this node to "CLOSED" using the drop-down menu and submit on the comment. How do ...
1
vote
0answers
25 views

Decoupled Drupal - Security: files structure

I am running a Drupal 8.9.2 site as a content repository accessed via an Angular 8 app. So there is one administrator who uses the Drupal interface to write content / upload files eccc.... and ...
0
votes
0answers
12 views

SOLR query - Report-ids in Solr for a given report (1,2,3) should be subset of Report-ids passed via query(1,2,3,4)

How to get the result from SOLR query where, ids in SOLR for a given report should be subset of Report-ids passed via query FQ Example : Say Report-Ids in SOLR for a given report - 1, 2, 3 Permitted ...
0
votes
1answer
32 views

How do I get the roles of the currently logged-in user?

In Drupal 8 I would use the following code. $current_user = \Drupal::currentUser(); $roles = $current_user->getRoles(); What is the equivalent code I should use in Drupal 7?
0
votes
1answer
44 views

How to create new entity within a hook?

I am trying to create a hook that creates a new entity('Notification') when an entity of another type is created (either of type 'Deadline' or 'Message'), but I can't seem to figure out how to add a ...
1
vote
1answer
41 views

drupal_set_message doesn't display message sometimes

I'm uploading a file, to process and display a message at the end. However, the messages that drupal_set_message is set to display are displayed sometimes and don't display sometimes, even, if the ...
2
votes
1answer
49 views

Drupal downloads the module update but need FTP

As the above screen shots, from Drupal 7 shows, the updates are downloaded! However, it still says Updating modules and themes requires FTP access to your server. I have tried the ownership of sites ...
1
vote
0answers
26 views

Decoupled Drupal - Security [closed]

I am running a Drupal 8.9.2 site as a content repository accessed via an Angular 8 app. So there is one administrator who uses the Drupal interface to write content / upload files eccc.... and ...
-2
votes
0answers
61 views

Allow users to control block visibility for themselves

According to this page, I should be able to give my users the option to show or hide a particular block through their profile settings, as hinted at roughly two-thirds of the way down the page: ...
-1
votes
0answers
27 views

Message Stack template remove attributes in HTML tags

I am using Message Stack to send notifications in Drupal 8. I have defined a message template and I use "style" attribute in tags to define CSS properties. I use a filter format without ...
0
votes
0answers
16 views

Token support on the menu link field

Is there is any alternative way to make token to work in the Drupal 8 menu link field other than Menu Token module. I want to use token to set as a default value when I am creating new menu, but if I ...
0
votes
1answer
25 views

how to access webform submission data from a custom content type

I 'd be grateful if someone could help with this.. I have a webform, let's call it input form, which, when submitted, triggers an external application to run on my server. That application uses some ...
0
votes
0answers
31 views

how to config nginx/drupal/links for drupal multisite installing in subdirectory

i am new to drupal , i use drupal 8.9.1 , with composer on ubuntu 18.04 , nginx , php , mysql . i try install second drupal with multisite in mypath/sites/test with mydomainname.com/test URL but i ...
-1
votes
0answers
10 views

Media Comments on Activity Stream when using Open Social

I have added the ability for users to upload Media to my OS install. I have a Media Type of Photo and have configured media to create a Message that displays in the activity stream. For some reason no ...
0
votes
0answers
28 views

How to use parent paragraph or field name in template_preprocess_file_link function?

We created custom theme suggestion for fields links using this code function THEME_theme_suggestions_file_link_alter(array &$suggestions, array $variables) { $route = \Drupal::request()->...
0
votes
0answers
10 views

How to load custom menu field when editing?

I'm extremely new to Drupal so if my question is badly worded I'm sorry. Inside my menu_ui_override.module I have made a made a new field and added a custom submit handler: function ...
0
votes
0answers
15 views

Print user field on a user profile?

I am using: Drupal 8.8.8 Open Social 8.4 Profile 1.1 Flag 4.0-alpha3 I am using the Open Social module which uses profiles and have added a flag to users called “Follow User” (Machine name: ...

15 30 50 per page
1
2 3 4 5
1658