All Questions

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

Retrieve last published (moderation state) version of node when transitioning to published

I'm wanting to get the last published revision of a node that has a content moderation state of "published". The below code works fine until I set a node to the "published" state at which point it ...
0
votes
1answer
9 views

How to add extra eventlistener to menu object in attached library

This is my first Drupal 8 project and I'm running into a problem figuring out how to attach an extra event handler to an object. I am working on a custom theme using Radix as base theme. I am using ...
0
votes
0answers
8 views

How to add a pager to the TOP of a forum in Drupal 8?

I am using the standard forum module that comes with Drupal 8. The problem is, when I view a forum node, it shows the pager the bottom. I want the pager to also appear at the top. The closest I've ...
0
votes
0answers
7 views

Poll module alternative / node integration

I just added the Drupal 8 Poll module and can't seem to get it working in a content node by entity reference - rendered entity. It shows nothing, not even a field. Perhaps I'm missing something?
-1
votes
0answers
9 views

How to add Checkbox Fields to User Accounts?

Is it possible to add multi-choice checkbox fields to a Content Type or the fields of a User Type? Hoping it is possible to create the following when a User is registering for an account. They should ...
0
votes
0answers
10 views

One field (entity reference - paragraph) with two display modes

I am having issue with displaying one field twice in my template having different display modes. I have a content type basic page with field field_gallery (which is entity reference on paragraph). In ...
3
votes
1answer
45 views

Date input format problem

I need to import a large dataset (over 300,000 records) into a Drupal 8 site. I have figured out how to do this with feeds on a small test dataset. The dates in the records are in the format June 8, ...
0
votes
1answer
14 views

How to include a patch to a JS library?

I'm using the Superfish library in my Drupal 8.7.x project. I included it in composer.json like this: "repositories": [ { "type": "composer", "url": "https://packages....
-2
votes
0answers
13 views

How can I calculate the total value of two fields in webform

Here is my scenario: a user calculate a price for house design he/(she) can select in a drop down called type of house : apartment, office, standard home, and I want to if to specifies type of ...
-3
votes
0answers
13 views

Cannot change node url value [on hold]

I am using drupal 8 and php 7.2 in windows 7 How can I change or replace url value in node field ?
0
votes
1answer
20 views

Hook to run afer config import

I need to run some code after the config for my module is imported(it will create/update a css file that depends on configuration). So what is the correct hook to use? The module install will run only ...
0
votes
1answer
15 views

Block email from submitting webforms

I have a list of email addresses that I would like not be able to submit in webforms. I can't seem to find a setting for this? Is this currently possible or do I need to make a custom module to ...
0
votes
1answer
38 views

Change view mode based on the URL

I have nodes whose content type is X that I would like to render differently based on the node path. I'd like to use the default view mode for a path alias and a custom view mode for the other path ...
0
votes
0answers
23 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
1answer
25 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
35 views

How is the user logout process supposed to work?

I’ve built a complete private site. Everything seems to work. When users wants to log out, they are redirect from /user/logout /user/login?destination=/, which seems the normal behavior, for what I ...
0
votes
0answers
10 views

How to change taxonomy link? [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
12 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
30 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. ...
-2
votes
0answers
10 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
14 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
17 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
12 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
11 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
29 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
23 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
11 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
11 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 ...
-3
votes
0answers
30 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, ...
2
votes
1answer
54 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 ...
1
vote
1answer
53 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
24 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
28 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
14 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
9 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
22 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
10 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
41 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 ...
-2
votes
1answer
18 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
260 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
45 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
27 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 ...

15 30 50 per page