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
0answers
6 views

Is there a way to get the controller class from a Request object or any other service class?

Background: My controller class holds some not so easy logic to receive some data from a route parameter but in a block plugin I need this data. As this block will only be rendered on this specific ...
2
votes
1answer
37 views

How can I add a new field from config inside hook_update_N?

I have to add taxonomy by php code. Taxonomy has to got 2 fields. I added new function to test_taxonomy.install, and it seems to work: function taxonomy_update_8805() { $config_path = 'modules/...
0
votes
1answer
434 views

DateTime iso format in api [closed]

I have created an api that filter out unixtime format. Currently, we can filter using /api/blogs?filter[created][value]=1426766400&filter[created][operator]=">="&api_key=DEMO_KEY That ...
0
votes
0answers
17 views

How can I create a custom field type for a select with multiple values?

I need a field type with 3 select in it. The field type is created and works like a charm but I'd like one of these select may have multiple values. What must I change? I add '#multiple' => TRUE, ...
-2
votes
1answer
549 views

A way to push notification to desktop and mobile from a website?

I'm looking for a way to push notification to desktop and mobile from a website built with D8. All modules I could find are abandoned sandbox or for D7... If I well understood, the way to push ...
1
vote
2answers
395 views

Forwarding request to a content page

How can I forward a request from module to a content page? I have got a module that authenticates users; once authenticated, the module should forward the request to a content page or node (not ...
0
votes
1answer
425 views

How to change filed type from integer to string

using D8. I have a field field_number just in one bundle (a node content type that I called law). Now I found that I need to change the field type; it needs to be of type string and not integer. I ...
1
vote
1answer
555 views

How to change search placeholder?

So far I have tried this code in mytheme.theme: function mytheme_form_search_block_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { $form['keys']['#attributes']...
-1
votes
0answers
10 views

What is the best way to let a user grant node access to other users? [closed]

I am using the module Group, and as the name implies, it does create groups. But, I need a way for users to create private nodes and grant access to one or more users. This custom module here ...
0
votes
1answer
20 views

Is there a plain-text equivalent to the 'html' suffix for [webform_submission:values]?

I've written a Drupal 8 webform handler plugin that sends webform submission data to another server via REST. I'm trying to send all the populated fields of the form to the third-party server so that ...
0
votes
1answer
502 views

Limit the number of uploaded files in a custom form [closed]

I have a custom form that uses a managed_file form element. How can I limit the number of uploaded files to, for example, 3?
16
votes
10answers
19k views

Add class to content field (link)

I want to add a class to the <a> tag of a field that consists of a link and text. (It's a field of type Link.) The name of the field is content.field_c_button_link. In the template file, I ...
2
votes
1answer
1k views

TypeError on “drush config-export”

I've been receiving the following error message when trying to do a drush config-export command. However, I am able to successfully do the configuration export from the Drupal admin page (admin/config/...
0
votes
1answer
47 views

How do I use the computed twig element to get the value from a custom composite element?

I have created a custom composite element by cloning the example module of Drupal 8 Webforms. It has a radio button and 4 select boxes. So when clicking 'Add" button, another row is being created,...
19
votes
5answers
10k views

Release cron lock

I ran cron and aborted the execution. Now I get this message: Attempting to re-run cron while it is already running. In Drupal 7, I could delete the cron_semaphore variable. What's the way to ...
0
votes
2answers
55 views

How do I edit serialized values in “config” and “key_value” tables?

While trying to switch original language of a Commerce product type I've encountered longblob serialized data in config and key_value database tables. Is there a quick way to edit them, possibly ...
1
vote
1answer
25 views

How do I change the original language of a product type?

On a multilingual site with commerce project I've created a product type while having one language selected as default but now I want to switch it to a different one. On /admin/commerce/config/product-...
0
votes
0answers
25 views

Styled images are created with nobody user

I don't know why my Drupal 8 site is creating styled images owned by "nobody" user instead of web server account user. This cause a problem that those images can`t be read (not found error ...
0
votes
1answer
451 views

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1 no such table:

I'm getting a strange error with my Drupal site. The error is as follows: Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1 no such table: router: SELECT name, route, ...
0
votes
1answer
20 views

Additional attribute for menu link

How I can add itemprop="url" for each link (<a>) in main menu? So, I need to get from <a href="/node/114" data-drupal-link-system-path="node/114">Test</a&...
0
votes
1answer
19 views

How do you add a class on webform submission in the modal?

I am using webform in a modal. now I want to add a class in the confirmation pop up of the webform. How I add class in submission form in twig. I am using html.html.twig of my theme to show webform in ...
0
votes
0answers
12 views

How do I add the flag bundle as a field in Views for all users?

I have a view of flaggings. My site has three types of flags: Fruits Vegetables Mushrooms In Views, under Filter Criteria, I can add Flag: ID and then select the Flagging type in order to filter by ...
0
votes
1answer
457 views

How to process html in twig file

I've a plain text field, where I've added few text in wrapped in tag. I've tried to get the processed html text in the twig by using {{ content.field_front_page_description|field_value }} {% ...
4
votes
1answer
830 views

Cannot import Paragraph based Feature into new site

Perhaps someone with a bit more Features expertise can help me here. I have a Drupal site with 25 or so Paragraph types that I would like to export (one by one) to its own contained Feature. I ...
0
votes
2answers
740 views

Change can I programmatically change the format of a view?

How can I programmatically change the format of a view using hook_views_pre_render in Drupal 8 or some another method?
0
votes
2answers
490 views

Multiple domains with a language each

We've setup that english language points to an english domain, and for spanish we have a language. The spanish one is simply a symlink to the english code base. When translating nodes, I am being ...
-2
votes
0answers
30 views

Is there a way to restrict access to a private file for a limited period? [closed]

Is there a way in Drupal 8 to restrict access to private files for a limited period (for example, 48 hours)? After that period, users should not be able to access those files.
0
votes
0answers
28 views

I can't override the node template

I have installed Barrio Bootstrap (8.x-4.33) and it worked so far. But I can't override a template for a specific node type. I copied the original template into my subtheme/template folder and named ...
7
votes
2answers
2k views

Creating date field with only month and year

We are using the Form API in a custom module (and not an entity field), how can we easily set the date widget for just year and month data entry? I've tried adding a #date_format attribute but no ...
-4
votes
0answers
40 views

What video player module should I use? [closed]

Problem 1) I want a Video player for drupal that has all the options that are available on Youtube player but I want it to play my local videos. Using the Media module (Drupal 8.9.5) gives me very few ...
0
votes
2answers
754 views

How to process single queue item using QueueWorker on cron runs?

For each cron run, I would like to be able to process only 1 item in my queue using QueueWorker. At the moment it seems to me that Drupal keep processing items until it reaches the time parameter for ...
0
votes
2answers
375 views

Use twig to style a specific block (unformated list)

I have a block showing a unformated List of fields. Now I would like to use twig to style that block. I am able to use block--views-block--blockname-block.html.twig to do the outer styling. But I ...
1
vote
1answer
1k views

REST GET ResourceResponse returns encoded json

I have a decoupled drupal project with an angular 5 front end that is utilizing a restful api to store data. Because this API needed a key that we didn't want to expose we have created a restful ...
0
votes
1answer
562 views

How can I get this command defined in migrate tools to work? [closed]

I have a Drupal 8 site since some months. Today, I realised I needed Drush in order to migrate some content (using the Migrate Tools module). Composer was not installed, so I installed it; then I ...
2
votes
1answer
736 views

Import content using the “Default Content for D8” module

I am using Default Content for D8 to import content on my site. After Profile installation completed, I enabled my custom default content module with contents sample json for node entity [my_module/...
0
votes
1answer
499 views

Fatal error while editing and deleting menu items

Facing one issue in deleting the menu items on my Drupal 8 Site. Steps to reproduce: Add a link to main menu. Create Child terms under one link. Delete the parent term. After deleting the parent link ...
-2
votes
1answer
36 views

How do I access user fields inside a template file?

I have added a field_name_last field to the User entity. How do I access it in the user profile template file? I can use {{user.account.name}} for such basic information, but I would like to access ...
2
votes
0answers
20 views

Webform clone translation and caching issue

when i clone a webform programmatically i loose the translation. This is my code. //Load webform to duplicate $webform = \Drupal::entityTypeManager()->getStorage('webform')->load($default_template);...
-1
votes
1answer
22 views

How do I get the taxonomy term name?

I added a taxonomy field inside a view. I need to show the term name on the page in a grouped way, like this. taxonomy term1 name title1 content1 title2 content2 taxonomy term2 name title1 ...
3
votes
1answer
5k views

Updating core to a specific version with Composer

My site hasn't been updated for two months, a few new updates has been released. My site's core version is 8.5.6. Before running composer update -with-dependencies I read the release notes to the ...
-2
votes
0answers
23 views

How do I insert Webform record values ​into a field? [closed]

I am working with Drupal 8.9. I installed the Webform module and created a form (Country) which has the following values. 1 | United States 2 | Spain 3 | Mexico I created another form (Region) with ...
2
votes
0answers
54 views

How can I have a single QueueWorker run on cron for multiple Queues?

I have a site in which I associate multiple Config Entities with a single Queue ie. example_queue (using the default QueueInterface). My Config Entities produce records that are processed as queue ...
0
votes
2answers
759 views

How to add a custom row class or ID to type table render elements

I'm trying to add row ID's for a custom table I implemented via a custom module. But when I append an ID to the '#attributes' array it becomes the table ID, not the row ID. How can I define IDs for ...
0
votes
1answer
416 views

Trigger redirect after Webform Remote Post Handler posted successfully

I've made a webform with a handler. This handler does a Remote Post towards an API. This API is actually a custom module within the Drupal install which (after some logic) passes all of the ...
0
votes
1answer
33 views

Some #states not working for custom field but do work on identical webform field

I'm working on a project where I'm programmatically cherry picking elements from a webform and then creating a custom form with all sorts of alterations and additions to the "cloned" webform ...
1
vote
1answer
771 views

Node view mode in page template suggestions

I would like page template suggestions when a node is using a custom view mode. I think this would happen in hook_theme_suggestions_page_alter(). I have already been able to get page-level template ...
0
votes
1answer
189 views

Pass custom variable to an entity reference templete

i have the following problem in Drupal 8. In custom content type there is a field, which is a multiple entity reference to the same content type. The field is set to use custom view mode, where only ...
-1
votes
0answers
31 views

What is the route in my myModule.routing.yml for myModule.module?

I built my module called myModule with Webforms module. myModule is defined in \web\module\custom\mymodule\ I introduced some forms (myModuleHeightCalculation, myModuleWidthCalculation...) and defined ...
1
vote
0answers
26 views

Updating a Node image field from an external URL

I need to retrieve an image from an external URL and then save the image on Drupal's file system, and then set the image as the image for a node. In D7, this was a pretty simple task, but it's causing ...
0
votes
1answer
2k views

How to call preprocess functions from my custom module

I have created a custom module that declares a custom image formatter. Now I need to call the Core image module preprocess function 'template_preprocess_image_formatter'. How would I do that? I tried ...

1
2 3 4 5
304