Questions tagged [8]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
0
votes
1answer
6 views

drush migrate:upgrade not behaving as expected

I'm working with the Migrate Tools modules for the first time. Specifically, I'm trying to use the Migrate Upgrade module to import users and roles from an old Drupal 7 site to a new, Drupal 8 rebuild ...
0
votes
2answers
41 views

Get path alias of node on presave

I was trying to get the path alias using for nodes using the following code. \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $nid); It works for nodes that are already created, ...
1
vote
1answer
31 views

Custom redirect to an url with “+”

I use search api module and a view of products. If I put the search text block and I do a search, It redirect to an url like this: <my domain>?search_api_fulltext=word1+word2+word3&sort_by=...
0
votes
0answers
23 views

How do I get the file path of a document?

I'm using views-view-fields.html.twig to display content. I can print the file name using fields.field_module_field_name.content, but the code below outputs not only the file name, but also the path ...
1
vote
2answers
42 views

Hide/show a custom block [duplicate]

I have created a custom block of id downloadourapp and I would like to show/hide it base on certain statements. I have create my custom module along with .module file where the code should be, ...
1
vote
1answer
20 views

Find if $view object is a block or page

I am unable to debug this because when I print the display object I get a memory error from the size. so with something like this I can get the display title. function mailnow_views_pre_render(\...
0
votes
0answers
15 views

Back-office in English / Front office in other language [duplicate]

Is this possible the have the back-office of a drupal 8 website in English (for exemple) and the front office in one other language only ? I don't want my front office to be multilingual (with /fr ...
0
votes
0answers
21 views

Can't resolve “entity_name needs to be installed” on custom entity

I'm working on creating a custom config entity and I'm pretty confused. I created it via Drupal CLI, configured some fields, adjusted the schema.yml file, and everything is working. I read that I ...
0
votes
1answer
29 views

How can I use LottieFiles to render animations?

I created an Lotti animation and rendered it as a .json file. Is it possible to use this file in Drupal? Almost every other site builder from Squarespace to Webflow allows this file type of animation. ...
0
votes
1answer
25 views

Overriding 'user.login.http' method

I am trying to override the core login method in Drupal\user\Controller\UserAuthenticationController by extending the UserAuthenticationController class so that I can inject custom data into the ...
0
votes
0answers
15 views

Can a published node have a later unpublished revision?

I haven't used Drupal for a while and I'm wondering whether this has been fixed recently or whether I'm mis-remembering. I believe that if revision X of a node is published, it wasn't possible to ...
0
votes
1answer
21 views

How to get taxonomy tree with path auto token?

I'm using Path auto module to automatically set url of articles. Last part of url is node title and [node:title] works just fine. But url part before node title should follow taxonomy structure (tree) ...
0
votes
0answers
14 views

Use default menu links in multilingual site

I have a Drupal 8 site with Greek and English installed, where Greek is the main language. I have only translated some of the pages in English. I have a flag to change the language in these ...
0
votes
1answer
21 views

Fetching and rendering custom-library generated blocks in twig

I am using the following code in my theme to fetch 3 blocks (each containing 4 fields) generated via the custom block library interface i:e all 3 block are of the HomePage-Block type: function ...
0
votes
1answer
22 views

Output node reference field data in page.html.twig

I have a homepage node-type in which I have an entity-reference field holding 3 references to 3 separate custom blocks. The theme I'm working on requires that my 3 element reference field needs to be ...
0
votes
0answers
26 views

DBupdate schema update can't rename table because it already exists -

I recently updated a couple of modules and core: To Drupal 8.8.6 Modules updated: metatag, Search API, Feeds, External Links and EntityQueue. There was a small hiccup that broke the site, so I re-...
0
votes
2answers
64 views

Trigger a Drupal behavior from another module in Javascript?

The block_ajax module defines a behavior in its module: https://git.drupalcode.org/project/block_ajax/-/blob/8.x-1.x/js/refresh_ajax_block_command.js I want to initiate this call every 60 seconds so ...
0
votes
0answers
36 views

How to migrate content using migrate-manifest?

English is not my native language so please be patient. I'm totally new to Drupal development so I was learning how to migrate from Drupal7 to Drupal8 due to some work necessities to test a POC, the ...
0
votes
0answers
27 views

User field to entity reference

I have created a content type, with a custom field. Then i have created an Entity Rereference on the users fields, so the user can select from those nodes on their user account settings. The idea is ...
1
vote
1answer
23 views

How can I hide search results until the user submits the exposed form?

I have a fairly straightforward view, which exposes a simple keyword filter to the user. Currently, when I first land on the page containing this view, all records are displayed (i.e., the search ...
0
votes
1answer
38 views

Can not override template for specific view

I'm new to Drupal so this might be a noobish question. I have a view called 'Category' where all posts are listed that belongs to the chosen category. I would like to override the views-view-...
0
votes
1answer
60 views

How can I add classes to the rendered “body” field on a content type?

Preface: I don't often work with Drupal, so I may not be using the correct terminology or fully understand the stack. Please bear with me, I'll do my best to be as clear as possible. I want to filter ...
0
votes
2answers
73 views

Count how many children have a reference to the parent

Explanations: 1) I have a node "parent" 2) I have 2 nodes "child" 3) Each child has a reference field (filled with a reference to the node "parent") Now, I'm trying to create a list with the ...
0
votes
0answers
11 views

Filter by the label of a content type in a query

I'm trying to modify the entity reference autocomplete to search by the content type label. Does anyone know how to search by the label of a content type? With "node_field_data.type" I can search by ...
0
votes
1answer
26 views

Looping through an array using Migrate Plus

I'm trying to loop through an array (called "Attributes") in a JSON migration source, but I can't figure out how to do it. Here's a shortened sample of my data source: [ { "Id": "ST00000002", ...
0
votes
0answers
19 views

PHPUnit fails when logging in user

I've got a custom module and have the auto generated LoadTest but it is not working. This is a functional test. protected function setUp() { parent::setUp(); $this->user = $this->...
0
votes
0answers
21 views

Is there any native way to implement AJAX form submission without a button?

I need to implement a form that automatically saves data on each element change. So I can add a button with ajax callback and trigger mousedown on this button on "change" event using jQuery. And ...
3
votes
2answers
119 views

What is the best practice for writing a link to the screen through t()?

In Drupal 7, one could do the following one line:: t('Visit !mylink', ['!mylink' => l('my website', 'http://example.com')]); But that no longer works in Drupal 8 or 9 😞. So far, I've tried this:...
0
votes
0answers
14 views

The provided host name is not valid for this server on OVH Web Server [duplicate]

I'm using an OVH web server, I went to the ftp browser and did add all my files into www. I was using Drupal 8 in local. When I want to go to my website, I've this error: The provided host name ...
0
votes
0answers
19 views

No formatter for PHP in field selection

I am using computed field module in a Drupal 8 installation. I set up a prototype project on a Raspberry Pi, where computed field module runs like desired. Now I set up a fresh installation on a ...
1
vote
0answers
32 views

Do multiple normalizing modules conflict with each other?

Drupal Core serialization service is selecting normalizers from container by looking at "normalizer" tags and their priorities. But we have multiple modules using serialization, providing their own ...
0
votes
0answers
29 views

How do I apply HTML IDs to field output result?

I'm trying to build a block for tb_megamenu of a view of items of a certain content type. I want to use some JavaScript so that when the end user hovers over a title then associated content appears on ...
-1
votes
1answer
40 views

How to alter the POS order item table header and columns

Using Drupal 8/Commerce 2 and the Commerce Point of Sale (POS) module, the autocomplete form to search and add a product to an order shows this table header. As indicated by @JayPan below, here ...
0
votes
0answers
54 views

Set and read data in session between anonymous and authenticated user [duplicate]

On my Drupal 8 site, when an anonymous user "A" visit this link: https://www.example.com/page-1?data=12345678, I want to store the data value in a session and save it later to the user account under ...
2
votes
4answers
170 views

How do I create a HTML link from an internal path using the core Link class?

I miss the deprecated l() a lot. I am trying to construct the Drupal 8 equivalent of: l(t('mylink'), 'admin/structure/types'); This call generates this HTML: '<a href="/admin/structure/types">...
1
vote
2answers
41 views

Layouts using the grid system

How can I lay out blocks or paragraphs using Bootstrap's grid system? I found this seven-year-old answer and am hoping things have evolved since then, and if so would like to know how. My best stab ...
0
votes
0answers
17 views

How to get drupal to check for a twig template in the active theme folder before checking the module folder?

I'm developing a contrib module for Drupal 8 that sends email notifications to group members when new content has been posted in groups they have subscribed to. The module defines some new view modes ...
3
votes
2answers
250 views

How should I include <link> or <style> inside <head>?

I'm trying to use a Google font, which requires adding either a <link> or <style> section inside the <head> per the below instructions. I am using a subtheme and can modify the ...
0
votes
1answer
26 views

How render view with programmatically passed parameters of contextual filter

I am using Drupal 8. Added new view My Vocabulary and created a contextual filter with paragraph ID. Now I need to render the view with passed parameters to contextual filter. What hook to use to ...
4
votes
2answers
381 views

Migrate users and retain passwords

I'm transferring 10K users from Drupal 7 to Drupal 8. I want to retain passwords. What I'm trying is Dump user records from Drupal 7 as a CSV file Dump hashed passwords from MySQL as a CSV file Load ...
0
votes
2answers
47 views

Fix for “'csrf_token' URL query argument is invalid” error during logout

I am creating a set of API endpoints for a mobile app using Rest. For User authentication, I am using the default API endpoints supplied by Drupal. That would be /user/logout?_format=json&token=&...
3
votes
1answer
86 views

How can I determine which module is associated with a field plugin?

I'd like to implement an entity hook, and act on all fields defined by Computed Field FieldType plugins. So I either need a list of all FieldType plugins provided by the module or need to know which ...
0
votes
0answers
31 views

WidgetBase with Ajax Callback and manipulate #tree values

After many tries, maybe someone can help me here. I want a dynamic form field in a widget base, but I keep having problems. 1st Values of the submit button are lost after submit and can´t manipulate ...
0
votes
0answers
44 views

PHP error in the log after PHP and Drupal upgrade

I got this error message in the log but not sure what is it about and how to fix it. Has anyone seen the same issue before and know how to fix it? Thank you so much! Drupal\Core\Entity\...
0
votes
0answers
20 views

Override templates in profiles templates

in drupal 8 I'd like to be able to override a template found at the root of Drupal in profiles/name/modules/menu/template/menu.html. I tried to put it in the child theme in templates/ but both ...
1
vote
1answer
25 views

Change sort order of SOURCE STRING list at User interface translation page to alphabetical instead of date created

At the User interface translation page (/admin/config/regional/translate) the SOURCE STRING list seems to be ordered by creation date/time (it is for strings I add). Is there a "good" (non-hackish) ...
4
votes
2answers
42 views

Upload an image to filesystem, rename it and set it as Profile Picture for current user

I have the external link of an image where I am trying to: Upload the image to filesystem. Rename the image. Set the owner of the image to current user. Set the image as Profile Picture for current ...
2
votes
1answer
22 views

Setting value of form element from $form_state not working

I need to track previous values of a few form elements on a form to detect when they change to invalidate some other options on the page. Essentially, if the value of these fields change a field that ...
2
votes
1answer
78 views

What's the difference between the two-column layout and two-column bricks layout?

I enabled the experimental Field Layout core module. There are two different two-column layouts available: one called "two column" and another called "two column bricks." The dialog provides the ...
0
votes
1answer
30 views

How to check if custom variation field is null in twig?

I would like to know how to check if a custom variation field has content in a twig template (commerce-product.html.twig with variations injected). I have tried with some filters and conditions but ...

1
4 5
6
7 8
294