Questions tagged [8]

Version tags should be used only 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
0answers
16 views

When rendering a custom form, how do I use <button> instead of <input type=“submit”> for the button #type? [duplicate]

I have a render array for my custom form, which acts as a "Like" button for articles (but with custom functionality for our client). The button is defined like so: ... $form['like_btn'] = [ ...
0
votes
0answers
40 views

How can I solve this Uncaught TypeError: $elements.tooltip is not a function?

Problem The tooltips don't work. I have the following error message in Chrome's JS console. jquery.min.js?v=3.2.1:2 Uncaught TypeError: $elements.tooltip is not a function at Object....
0
votes
1answer
29 views

How can I set up a “blog” area?

I am very new to Drupal and Twig. I've a custom Drupal theme I've built, but my client now wants a "blog" system as well. This includes the following features: Show most recent article in a blurb on ...
0
votes
1answer
32 views

How can I add paragraphs to a translated node?

I have a problem with the Paragraphs module and translation. I'm using Drupal 8.7.7 and Paragraphs 8.x-1.9. When I add a translation to a node with a paragraphs field (unlimited), I can only ...
0
votes
0answers
12 views

How to know what is changing views sql query?

I would like to know what modules are altering the select sql of a view. Is there any way I could know it?. Due to this question I put some days ago, I would like to find why that sql is altered. I ...
0
votes
0answers
17 views

Expose custom db table to views to join with any entity data

We have a db table from custom module which has fields entity_id and entity_type. I need to exposed this table to views using hook_views_data() and it should be possible to join with this table within ...
0
votes
2answers
47 views

Display the day of the week

I have a content type with various fields. One of these is a date field. After typing in the date I would like to display the day of the week to the right of the date.
1
vote
2answers
260 views

How can I make a response cachable by browsers?

I am working on a Drupal Controller implementation that would return a generated image as response. I used Symfony's Response and I was trying to add ETag header to it: use Drupal\Core\Controller\...
0
votes
1answer
26 views

Why is my view for Solr indexing is not showing any results?

I have installed solr 8.2.0 for drupal 8.7.6. My Solr server and index are enabled and indexed. But when try to search via views, the results are not showing up. Please help me in solving this. My ...
0
votes
0answers
59 views

Manual Update from Drupal 8.7.6 to 8.7.7 Acts Like New Install

I have been manually updating Drupal 8 core successfully until now. When I try to update from 8.7.6 to 8.7.7 it goes to a new install. Here is what I did Back up database, and back up entire site ...
0
votes
0answers
41 views

How to use Sentry with drupal 8 [closed]

I'm trying to use Sentry(it's real-time error tracking) with my drupal site. I install Raven module using composer composer require drupal/raven then enable it. My question is where this line should ...
1
vote
0answers
14 views

8 - How can I update the entity reference fields of the form when I close the modal?

How can I update the entity reference fields of the form based on selection in the modal dialog when I close the modal ? I have a form and users starts fill the form. Then click on choose address ...
0
votes
1answer
18 views

How can I filter which entities are available in the admin form for an Entity Reference Field? [duplicate]

I've got a Field which is called "Primary Article" which is an Entity Reference Field. I've configured this field setting the "Reference Type" to be "article", so that only articles show up in the ...
0
votes
0answers
11 views

How to sort Views on code-only field?

In a custom entity, called Foo, I have a method called getDisplayName that conditionally returns one of Foo's base fields. Foo::getDisplayName() public function getDisplayName() { return $this-...
1
vote
1answer
49 views

Can I get integers from a dynamic query using fetchAllKeyed?

So basically I want an array of integers from a query using fetchAllKeyed for the results. The field is an tinyint in the db so I would expect an indexed array of integers but I am getting an ...
0
votes
0answers
23 views

How to view entity when I kint or vardumper views twig?

I am using "views-views-unformatted--view-machine-name.html.twig" twig template. I want to show value of row content like folowing: {{file_url(row.content['#row']._entity.field machine name.entity....
2
votes
1answer
33 views

How can I get the parent node of a referenced node?

I have a node called project which contains field building as a referenced item, I used the the hook on building node insert and, having this building id I need to get project id which this building ...
0
votes
0answers
51 views

How to delete node of a content type if having millions of node

I have a content type in my Drupal 8 instance and having more than 2 millions (20 lakhs) node and want to delete those node, tried many things but nothing helps, either HTTP 500 error occur or Website ...
1
vote
0answers
28 views

Where to describe a State API variable?

We can describe the configuration variables in the *.schema.yml files but there is a place to describe the State API variables? I searched in the Core for some State variables and I don't find a ...
0
votes
1answer
27 views

Drupal.behaviors js code executes mutiple times (depends on active modules)

I have two almost similar websites (one was a test project) and second one is more like final version. On both of them i have quite simple custom module with js and on first web site it works fine, ...
0
votes
0answers
27 views

How can I theme the login form?

I new in Drupal 8 and I have an a problem, i want to change de look of my user_login_form, reading about that i knew that i could use the hook_form_alter for my purpose but I can't access the form ...
0
votes
0answers
32 views

How can I create a patch for a contrib module or core which is not in version control?

Because we use a devOps system that installs packages on the server via Composer, my core drupal installation and contrib modules are not in version control (Git). I used to patch modules as follows:...
-2
votes
0answers
25 views

Documentation View

I am looking to create a document/node library on my Drupal 8 site that looks a bit like this: https://docs.devexpress.com/WindowsForms/114561/controls-and-libraries/forms-and-user-controls It is for ...
0
votes
0answers
17 views

Views date range filter adds weird condition

I have a view for a content type. This content type has a date field (only date) and I have added and exposed a filter for this field ("date is between" option). I have added and exposed a filter for ...
1
vote
1answer
73 views
+50

Can a product support recurring and not recurring payment at the same time?

So if for some product variant I check option "Allow subscriptions" all product variants of that products can be bought only in recurring way? Is that true? I mean, I can not have one product and one ...
0
votes
1answer
41 views

How to modify default login page using theme?

Version: Drupal 8.7.x Currently, I am using a subtheme of the Bootstrap theme and I want to override the default login page because the interface doesn't look good. I was hoping to override the ...
0
votes
0answers
32 views

How can I get the metatag_config site name by consulting my db with php?

I want to obtain the metatag_config data through a mysql query with php from my db drupal, in order to obtain the site name, description, keywords and abtract. How can I do it? Or where they are ...
-1
votes
0answers
40 views

How can I populate an image field using JSON:API?

I tried to upload image files into an image filed using the JSON API. I am following the instruction in the page: https://www.drupal.org/node/3024331 However, I get an error (response 500). Below is ...
0
votes
1answer
35 views

Access table form field's data from submitForm

I'm building a custom form and it display well. My form has a table type field which I can't manage to access from the submitForm method. public function buildForm(array $form, FormStateInterface $...
1
vote
1answer
25 views

Looking for a Menu Module on Node Page [closed]

Out site has many, many nodes included in a number of menus. When creating a node, the Parent Item select box under Menu Settings is quite long. Is there a module that provides a better, more usable ...
0
votes
0answers
39 views

Reloading a block by Ajax [on hold]

Version: Drupal 8.7.x I have created a sticky notes block, which takes notes and is also able to delete then asynchronously. The problem is that the block which displays the notes is static. I have ...
1
vote
1answer
33 views

How to install multiple modules with composer at once? [closed]

Let's say we need to install these 2 modules : composer require 'drupal/redirect:^1.4' composer require 'drupal/pathauto:^1.4' I couldn't find the correct syntax so I've tried this but it doesn't ...
0
votes
1answer
15 views

Sub tabs similar to Media library

I am trying to replicate the user interface Media library provides in 8.8. I've created a view with 2 displays: View 1: Menu tab where Parent is "Content" /admin/content/media-image View 2: /...
1
vote
1answer
28 views

Fetching node field values programmatically

I have figured out how to query the node table programmatically without using the deprecated db_query() function. However, I soon discovered that the actual content fields are not held in the node ...
0
votes
0answers
20 views

“Views Contextual Filters OR” only works for logged in users [on hold]

I'm building a Drupal 8 commerce page and have a view to show content related to taxonomy terms of multiple vocabularies. Unfortunately there's no contextual filter "has taxonomy term id" like for ...
0
votes
1answer
26 views

Programatically get the webform submission “sid” on submitForm

I am trying to programatically get the webform submission sid on submitting a webform but failed to get it ! On my customwebformhandler.php file i have the below: public function submitForm(array &...
-1
votes
1answer
36 views

Create a simple download link using twig

I want to create a simple download link on twig using Drupal8 but as easy as it can seems, I didn't find anything that was matching for me, it will always be the same file to download, it will be ...
0
votes
0answers
12 views

Override form field #value after ajax request sets it

First of all, here is the code: /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $form['join_newsletter'] = [ '#type' => '...
1
vote
1answer
67 views

Error: Undefined index: render element

I encountered an error: Error message Notice: Undefined index: render element in Drupal\Core\Theme\ThemeManager->render() (line 200 of core/lib/Drupal/Core/Theme/ThemeManager.php). ... I found ...
2
votes
2answers
64 views

How can I exclude some entities in “drush entity:delete” command?

I want to delete all content of custom entity type except some specific items, I found drush entity:delete CUSTOM_TYPE command to delete all contents but couldn't exclude some items from deletion in ...
-1
votes
1answer
45 views

Why would a page created by a custom module work in my DEV environment, but produce a 404 on the live server?

I have a custom module that's creating feeds of my content for me. It's been running fine up until now. Existing feeds work, and the new feed I just added works on my development site on my local mac. ...
0
votes
1answer
25 views

How to Determine a View Row's Content Type

I'm putting together a view with multiple content types. In my my_theme.theme file I want to set the template suggestion based on the item's content type (e.g. Content-Type-A gets Template-A.twig and ...
0
votes
0answers
17 views

D7 to D8 site migration and location of migration log

I'm using drush to migrate a D7 site to D8. I'm getting several errors in the drush migrate-import --all step. D8 site is installed using a bash script that executes: drush site-install standard -...
0
votes
1answer
22 views

Alternative #markup in a block's build function

Version: Drupal 8.7.x I am adding some canvas element to my page, and it gets ignored by Drupal. I can't even see it in the source page of browser. If I have something like this in my code: public ...
0
votes
1answer
43 views

Drupal 8 REST add custom error messages to existing core /entity/user/ resource

I am using drupal 8 rest and I want to be able to do a few computations and return custom json messages as per the defined condition when posting a user. I am using the already existing /entity/user/ ...
2
votes
0answers
30 views

Add an existing node as a translation to another node [duplicate]

I am migrating contents from a multilingual website. I'm using Feed modules to import all the nodes so, in the end, I have multiple nodes that are in English and multiple nodes that are in French. ...
-2
votes
1answer
30 views

How to add custom php field views that returns my custom functions value?

I'm designing a form that creates a user on sign in. After that I'm displaying the data in a view for an admin to approve. I need to add custom PHP code that calls a function that performs approval of ...
0
votes
0answers
29 views

How can I define an offset when rendering a view with the renderRoot method?

In my app I'm calling an API to get the list of tasks as view(It has a complex html structure) and It is working correctly. But now I have to create a pagination for it. How can I pass the ...
0
votes
1answer
37 views

Is there any PHP package that's very similar to the Plugin API? [closed]

I really like the Drupal 8 plugin system. I am now also working on a non-Drupal related project and am wondering if there's any similar solution to that on packagist.org? Was trying to find one but ...
-2
votes
2answers
39 views

Where might I place code to programmatically update nodes?

I want to update or set value of specific node/entity with one button that have function to update specific field on that node / entity? And put in on view tab on that specific node on a button? How ...