All Questions

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

Enable translation for theme settings

Theme settings are not translatable in core. Is there a way to make them translatable? I have some additional theme settings which needs to have different values per language. I'm trying to achieve ...
0
votes
0answers
3 views

ConfirmFormBase to FormBase

Drupal 8.7.x I have a Form button with a confirmation page to delete an ingredient. I'm trying to convert it to a standard Form that just deletes it without confirmation, however I keep getting an ...
0
votes
1answer
14 views

How the user logout process is supposed to work?

I’ve built a complete private site. Everything seems to work and when a user wants to logout, the link is /user/logout and then he is redirected to /user/login?destination=/ IMO it is the normal ...
0
votes
0answers
6 views

Custom Taxonomy View [on hold]

I have taxonomy called "departments". I would like to make new view with list of all departments. Department should be a link to single department view with list of all articles. When I tried to do ...
-1
votes
0answers
7 views

Error generating document: Failed to generate PDF [on hold]

I have installed Entity Print on Drupal core 8.6.2 The following is my configuration: Enable Default CSS Force Download Default PDF engine for printing = Php wkhtmltopdf Paper Size = A4 Paper ...
0
votes
0answers
16 views

Hook “form_views_exposed_form_alter” is called multiply times

I would like to understand why form_views_exposed_form_alter is called multiply times. There is just one view, also there is just one exposed filter. However the hook is getting called twice. ...
-1
votes
0answers
8 views

getting error during installation of drupal-8.0.1 what we have to do?? i used MAMp [on hold]

Warning: preg_replace(): JIT compilation failed: no more memory in Drupal\Core\Database\Connection->escapeTable() (line 953 of /Applications/MAMP/drupal-8.0.1/core/lib/Drupal/Core/Database/Connection....
0
votes
0answers
6 views

Programmatically update remote video thumbnail

Scenario: YouTube video was previously unlisted, so thumbnail not retrieved and now needs to be, or chosen thumbnail has been changed and needs updating. There are a couple of core issues open on ...
0
votes
1answer
15 views

REST Export Serializer adds quotation marks to my field

I'm using the REST export to expose a list of my nodes including some fields. One of the fields is paragraphs field with subfields. I have written a formatter for this paragraphs field that puts ...
-3
votes
0answers
10 views

I can't upload user picture [on hold]

I want to upload an image for a simply user on the default form and I get the following error : "The file could not be uploaded." I have tried with all types of file formats. I also checked the ...
0
votes
1answer
9 views

hook_custom_theme() works except if a user submits a user form with mismatched passwords. Then they get served the admin theme

Title basically. My hook_custom_theme() has been working for ages and I only just realised the admin theme is being served for an error when saving a user form ie. mismatched passwords. A snippet ...
0
votes
1answer
21 views

Is it possible to show a menu in a view as buttons?

I'm trying to build a page with a quick menu. Now I've created a menu by the regular way and I've shown this on the place i wanted. Now due to the way my site currently looks, this is very out of the ...
2
votes
0answers
16 views

Layout Builder - How do we programmatically place a section and then a block in that region on module install?

We are looking for the best way to export a defined/built layout with inline blocks and then use that to programmatically set both them during a module install. eg. module install create node in ...
0
votes
0answers
9 views

How to import image using CSV user import?

I already success to import user and node, but the image is not imported. I also write the path in csv to the file public://xxx fullpathHttp://xxx and i've done upload the img to the server first, ...
0
votes
0answers
9 views

How can I get the address components from Commerce store entity?

I have an address field in a form I'm building with the Form API. I need to pull the address components from the Store's instance so I can set them in my form. I can pull other fields from from the ...
-2
votes
0answers
20 views

.htaccess is overwritten every time I make an edit [on hold]

I installed Drupal 8.7.5 and chose "Standard" on installation. The .htaccess file is rewritten on every content change. It is in drupal-8.7.5/sites/default/files/. I cannot even change that file, ...
1
vote
1answer
31 views

Variables injected or set in a Twig file are undefined after the first position of an entity reference field

I have a Paragraph setup that has an entity reference field allowing an editor to select multiple nodes to use in a display. Based on the count of nodes, I want to trigger a class. I figured a way to ...
0
votes
0answers
24 views

How to get entity Translation's title in Twig

i am trying to get row title -node title- in my custom module with template_preprocess_modulename_view($variables) and views-modulename-view.html.twig with using row.content['#row']._entity.title....
0
votes
2answers
21 views

How do you hide a page?

I'm using Drupal 7, can you tell me how to hide a page if the page does not have a menu settings at the bottom?
1
vote
1answer
25 views

Displaying associative array data in twig

Using drupal 8.7.x I have an associative array that is returned to twig. However I can't seem to get the data displayed. Associative array: array_push($mealsArray, ["meal" => [ ['...
0
votes
0answers
12 views

How can I create a user with a term reference field in a Behat test when using the Drush Driver

My Behat test has the following Given statement. (field_regions is a taxonomy reference field) Given users: | name | mail | roles | field_regions | | Joe User | joe@...
0
votes
0answers
7 views

How to print in views field template the url of a multi field image?

I would like to print in a views field template the url of each image of a multi field image. This is my code but print only the URI $vals = $view->field['field_property_slideshow']->get_value(...
-3
votes
1answer
20 views

Transfer Aegir site to LAMP

Can anyone please advice me on how to move a Drupal 7 site from Aegir to a LAMP stack? I've been handed the emergency project of moving a site to a new hosting. Ordinarily, that would be easy enough ...
0
votes
0answers
19 views

Import Submissions Permission for specific Role [on hold]

I'm using Webform Submission Export/Import [EXPERIMENTAL] submodule which seems pretty useful. My use case require to have specific roles to be able to upload their own CSV submissions and I cannot ...
0
votes
0answers
13 views

Node visibility not working?

I'm working on a site where I want to control node visibility for a content type called 'Dataset' by membership in organic groups. However, this does not seem to be working... OG Field Settings for ...
0
votes
0answers
9 views

Entities of type Group and Group_Type are deleted when running drush updb or drush rr

I am using the Group module combined with a feature module. The feature module includes two group types in the implementation of hook_default_group_type as can be seen in here: https://pastebin.com/...
0
votes
1answer
39 views

Custom formatter for paragraphs field

I want to build a custom formatter for a paragraphs field that renders some of the fields of the paragraph. However, I don't know how to access the single files of the paragraph field. So far I've ...
0
votes
0answers
7 views

Group of multiple fields + Language Based Setup Architecture

I have two different languages in the site, one is english another is finnish. Need an interface in the node add/edit like below, where user will able to add different set of items for each language. ...
-2
votes
0answers
20 views

Send JSON with hook_menu and sent to method POST to URL [on hold]

I have written the following code: /** * Implements hook_menu(). */ function [NAME_MOD]_menu() { $items = array(); $items['test/json'] = array( 'page callback' => 'test_json_logs', '...
1
vote
1answer
228 views

Why does loadMultiple load 1000 nodes 5.5 times faster than loading each single node one by one?

I have always known that loading multiple nodes at the same time is faster than loading a single node many times. What I wasn't aware of, is the huge performance difference between the two ways of ...
1
vote
2answers
33 views

How to make PHPUnit test in a Module?

I'm not very much knowledgeable about making PHPUnit and Drupal testing setup. I am having problems regarding database calls. I tried to setup phpunit test. Inside my module/some_module. I ...
-2
votes
0answers
38 views

How to create a custom token for the Message module? [on hold]

I have a site with Drupal, as well as the modules "Message" and "Token". I created a custom module based on the module "Message example". I created for entities, a display mode called ...
0
votes
0answers
14 views

Implementing a contextual filter in a view with nested taxonomies?

We have a menu with submenus, for example: MenuItem1 Sub1A Sub1B Sub1C MenuItem2 Sub2A Sub3B Sub2C MenuItem3 Sub3A Sub3B When you click on MenuItem1, we want the view to display the ...
0
votes
0answers
26 views

Is it possible to execute a function on a user object in Twig?

You can use hook_entity_load to add fields to the user object like so: function mymodule_entity_load($entities, $type) { if ($type == 'user' ) { foreach($entities as $e) { $e-...
-1
votes
0answers
17 views

website does not display well on browser or computer [on hold]

I currently work on a development website. After transferring the website from development to product website, some images do not show on web browsers like Firefox, Opera, except Chrome in my computer....
0
votes
0answers
10 views

Webform Submission - Taxonomy Term ID Token

I have a webform that uses taxonomy term fields. After form submission I'm redirecting to a custom URL with query string parameters and using tokens for the values. The page I'm redirecting to ...
0
votes
0answers
13 views

Page relative to a node [on hold]

I have a working php script which takes a few arguments and prints a result based on the arguments. I also have a drupal website with a lot of content. Every node contains the abovementioned arguments ...
-1
votes
0answers
11 views

Determine what OS that the website is running on at any given time [on hold]

I have a situation where we are attempting to use flag emojis to represent different countries in some text fields. However, we have an issue with this when the drupal site is accessed from a Windows ...
0
votes
0answers
25 views

Tell the site to ignore the file path

I have a d7 site with static files under the docroot. (www.example.com/top-directory/sub-directory/file.php) I want all of the pages to follow the '/top-directory/sub-directory' URL pattern, ...
-1
votes
0answers
26 views

Finding a page to edit? [on hold]

I found a page on my site through a Google search. I can not find it in admin. I looked in the page's code and there is no node number for the page. In /admin/content/node I have looked at the pages ...
0
votes
0answers
10 views

Allow Order Item Type field to display on some products, but hidden on others?

I have two types of products on my website: Shippable Products and Non-Shippable Products. I have several Shipping Products set up. One of those Shippable Products needs a custom field to collect a ...
0
votes
0answers
14 views

Webform as checkout pane

We want to put a webform in a Commerce checkout pane. Webform allows to return a render array, as described in How to embed a Webform? $output['your_form_id'] = [ '#type' => 'webform', '#...
0
votes
1answer
31 views

How to add multiple “submit” buttons in Webform

If I add a button to a webform creating a module with something like this in it: $form['actions']['submit_2'] = array( '#type' => 'submit', '#value' => t('Submit 2'), ); It appears in my ...
0
votes
0answers
17 views

How to specifically define name and value attributes for checkboxes form element? [on hold]

I am trying to build a form parallel to an existing 3rd party html newsletter form (from CleverReach). The final checkbox markup needs to look like this: <input name="1130400[]" value="lorem ipsum"...
0
votes
1answer
22 views

Select all nodes, where date is greater then current date and repeat event option is empty

I have content type "event". In this content type I have a date field, provided by the Date Recur module. At the result I have range of the dates: Event start and end date. Also Date Recur provides an ...
2
votes
3answers
53 views

Get node ID or URL in Twig on field level

I have a field value, which I would like to link to the content (to the node itself, using it in a teaser). How can I get the URL or at least the ID on field level, to create that link?
-2
votes
0answers
23 views

XSS problem and mod-security [on hold]

ive been got , i think . my hostings' mod-security has identified a problem> its all seemingly been fine so far for a couple of years Pattern match "(?:\b(?:(?:type\b\W?\b(?:text\b\W?\b(?:j(?:...
0
votes
1answer
16 views

Get title of referenced item two levels deep with Search API

I have three content types: A, B and C. A refers to B and B refers to C Now with use of the search api module I search my content types and I want to only output C. But in the result I want to show ...
0
votes
0answers
26 views

How to display fields in random order in a view

Hi I have a view that display mcqs (multiple choice questions). I want them in random order. I successfully sort the questions (one question in each node. I create a custom content type) randomly ...
0
votes
0answers
13 views

How can I list the previous published revisions of a node? [on hold]

I have workbench moderation and revisions enabled on my content type. How can I list all previous published revisions of a node in views? I have created a node with revision 1 and published Then I ...

15 30 50 per page