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
54 views

Why do I get “Nothing to install or update” when I update to latest core version?

Under /admin/modules/update, Drupal core is listed as requiring update from 8.8.8 to 8.9.1. I have started my Drupal installation using the drupal/recommended-project project template and I used ...
-3
votes
0answers
18 views

a way to automatically add the captcha field to all webforms

Is there a way to add the captcha field to ALL webforms - created and new?
4
votes
4answers
8k views

How to properly add inline Javascript?

Now that drupal_add_js(...., 'inline') is no longer possible, how can I inject dynamic Javascript from a custom module's Controller? (I'm trying to upgrade a D6 module with as little refactorings as ...
5
votes
6answers
11k views

How can I theme the outgoing contact mail?

I want to theme the outgoing mail from the contact module, because the standard output looks horrible. Where can I do this? It's the one starting with admin (http://example.com/user/1) sent a message ...
5
votes
4answers
4k views

How to make a wishlist button and page [closed]

How can we possibly add a user-specific wishlist feature associated to a drupal content type ?
0
votes
0answers
41 views

Bigpipe after load event

When I enable the bigpipe module most of the blocks disappear, since I use a Vue layer. I've tried the following codes but none of them have worked for me: var charging_blocs = $('[data-big-pipe-...
0
votes
0answers
30 views

Own permissions for paragraphs and ECK entities

I have come quite far in my Drupal 8 development without needing to write much custom php code. However, I am using paragraphs and eck entities as referenced entities in content types. For users to be ...
0
votes
1answer
1k views

How to Logout user with Basic auth?

I can log in, perfectly fine, but can't get logout to give me a JSON response. Currently, I can only do POST to d8.com/user/logout?csrf_token=123&?_format=json and that would log out, even ...
0
votes
2answers
25 views

How can I export and then import taxonomy terms?

So I built my own custom entity type (we'll call it notes). And on my notes I have fields that use taxonomy terms, however when it comes to exporting the data out on individual fields, it shows the ...
1
vote
3answers
2k views

How do I use the Password Policy module?

I just installed and configured the Password Policy module, but the constraints like password length should be minimum 8 characters is not reflecting when an administrator user adds a new user and ...
0
votes
1answer
1k views

How to access weight of a paragraph in twig?

I use paragraphs with my content type. I need to show weight (order) value of each paragraph in my twig template. I can change weight with select box when I edit the node, but I can't figure out how ...
0
votes
0answers
45 views

Entity Error While Running update.php from 8.6.14 to 8.9.1?

I have been trying to update the core from 8.6.14 to 8.9.1. I am facing the below error while running drush updb comments > [error] Field storage definition for 'revision_id' could not be > ...
2
votes
1answer
2k views

How to use composer for installation profile?

I have a Drupal 8 installation profile with custom modules and themes and I am wondering how should I use composer so that I can run it and drupal core and other dependencies(like contrib modules) ...
1
vote
2answers
487 views

How to change DateTime field value on form submit

I am trying to update a DateTime field in an altered form submit. Something like: php function my_module_form_submit($form, FormStateInterface $form_state) { if (!$profile->field_someother_field-...
1
vote
1answer
438 views

How can I use CKEditor for teaser text on a long form text field?

In Drupal 8, the teaser text for a long form text field (specifically, text of type "long, formatted, with summary") does not have a CKEditor wrapper around it: How can CKEditor be added to this ...
0
votes
1answer
23 views

Change sort order for view when exposed filter text field submitted

I have a view that by default is ordered by date. It has several exposed filters one of which is for filtering by text (we use it as a search field). I'd like the view sort to change to Relevance when ...
0
votes
0answers
23 views

How can I set a value of a hidden webform field in the backend?

I have a field A that is hidden by conditional logic and only appears if the user selects a specific radio button. But when I want to edit/set a value for the field A of a submission the conditional ...
0
votes
1answer
654 views

Getting a menu delivered via REST

I am trying to get a menu via REST and I've created a new module and rest resource plugin that allows for GET on /entity/restmenu/{menu_name}. I can successfully return this example json using this ...
0
votes
1answer
50 views

“recommended-project” installs drupal into the /web subdirectory, but hosting solution directs traffic to webroot

Per https://www.drupal.org/node/3082474 the preferred document template, drupal/recommended-project, uses a "relocated document root" for security purposes. HOWEVER, many cPanel driven ...
1
vote
1answer
587 views

form_alter and #element_validate inside .module file

Inside my .module file, I have created a hook for alter register_form and add a password field with a custom field-validation: function xenforo_form_user_register_form_alter(&$form, \Drupal\Core\...
1
vote
1answer
500 views

How to extend a specific node type form?

I am searching a way to overwrite the NodeForm to get a class per bundle. Actually EntityForm manages the form for all entities. NodeForm extends it and manages the forms for all nodes. I wrote a ...
4
votes
3answers
7k views

How to get one time login for all the users?

I want to send one time login for all the users, So I am using drush uli and getting link like: http://html/user/reset/1/1509979615/VBPx_FMfKeJUEt1moVcsSQGUMX_tFUSYEdEfRlmq7eA So if the user 5 ...
0
votes
0answers
19 views

Migrating content from RSS feed to populate multiple Entity reference media field

In the Drupal 8 site I'm working on, I've currently set up some migration configurations which import content from an external RSS feed. The file urls references in this RSS feed are imported into the ...
1
vote
1answer
1k views

How do I delete files attached with media entity?

Background: drupal 8.4.2 custom media solution Issue I can not delete files permanently which created as media entity. Reproduce Created an image media entity. /admin/content/files claims status ...
2
votes
0answers
124 views

How can I show the flagging field edit form on a node?

On a flagged node, instead of showing the flag/unflag link, I want to show the flag edit form. Here's my setup. Basic page content type can be flagged with the flag Bookmark. Bookmark is a per-user ...
1
vote
1answer
564 views

Convert UTC to local time in date field

I have a content type with a date field, which I convert to a specific date format in a preprocess function: $variables['date'] = \Drupal::service('date.formatter')->format($variables['node']->...
2
votes
1answer
448 views

Error : No eligible views were found. Create a view with an Entity Reference display, or add such a display to an existing view

I cannot work out some basic stuff ... what do I not correct? Using D8, distribution varbase. I would like to create a reference from one content type to antoher in D8 so a user is able to use a ...
1
vote
1answer
1k views

How do you join a custom table to a node from a field with hook_views_data()

I have a custom table that contains (for simplicity) two fields: id client_id On my node content type, I have an integer type field called: field_dashboard_id. All my nodes have the ...
1
vote
0answers
48 views

Logged in users are automatically logged out when visiting some specific pages

I have a page view /all-authors where both (Anonymous & Authenticated) users have access to it; However, authenticated users can follow (flag) an author and Anonymous users cannot do that. What I ...
0
votes
0answers
28 views

Changing HTML5 element to military time in Webform

Would anyone be able to suggest a way that I can change the current AM/PM default 12-hour HTML5 time into 24-hour military time when using the Date/time element in Webform? When I change it to 'Time ...
38
votes
9answers
63k views

How to get the valid URL of a Link field from within a Twig template?

I have a Link field named field_my_link (machine name). Within a Twig template I can get the link's URL value with this: {{ node.field_my_link.uri }} If inside the Link's URL there is an external ...
0
votes
1answer
13 views

Dynamically add destination fields to migration - importing data when fields on destination entity are not know

I am trying to import content from JSON from an API call. This API call has different source data depending on what the call is. For my migration from this JSON, there are set fields that I have coded ...
0
votes
2answers
735 views

SMTP Error: Could not connect to SMTP host

We have a new Drupal 8 site and are having issues with the SMTP module. The account we are using to send email works successfully on our Drupal 7 sites and in other cases, but we cannot get it to work ...
1
vote
1answer
25 views

Override page.html.twig with custom module template

I want to override the page.html.twig template from a custom module. I know how to create a suggestion, but I would like it to find the template file in my custom module. function ...
0
votes
1answer
786 views

Redirect before 404 page

I'm currently migrating a site to Drupal. The old site has thousands of dynamic urls which i can recognize via regex. Those urls does exist in a slightly different form in the Drupal page. ...
0
votes
0answers
22 views

Speeding up Search API DB search?

I'm using Search API with it's build in Database search, and while the results are much better than the default Drupal search, the speed is quite slow. I'm seeing 10-15 seconds to get the results page ...
0
votes
0answers
16 views

Displaying image of type BLOB format stored in external database in Drupal 8 [duplicate]

I have created external database on localhost with image stored in one of the columns in BLOB format. Then I interfaced this external database using View Database Connector, created VIEW. I could ...
-1
votes
0answers
52 views

How do I get all articles from the database? [duplicate]

i am new on Drupal 8 ,in my case i want to get all articles from database filtered by name i have done dome code but it doesn't work for me can anyone help me please ? public function getArticles(){ ...
0
votes
1answer
42 views

How do I display an array of entities from a controller?

I am new on Drupal 8 , so i have created a service class which return a list of data, 'articles' (node entities), and I call this service class inside a controller, but no data showing up : My ...
1
vote
2answers
2k views

NotFoundHttpException after changing webiste hosting, sub-domain

After changing webiste hosting (Drupal 8) I got this very un-intuitive error message: The website encountered an unexpected error. Please try again later. Symfony\Component\HttpKernel\Exception\...
0
votes
1answer
49 views

Translate path controller

I have the following path defined in my routing.yml: path: '/department/{department_node}/qualifications/{qualification_id}' I need to translate that route into other languages, for example into ...
12
votes
1answer
16k views

Set the template for the frontpage

How do I change the Drupal 8 frontpage template, so it doesn't use the regular page.html.twig template?
0
votes
1answer
28 views

How to add a translation to an existing node/entity using REST?

I have a headless Drupal 8 and want to create a translation for an existing NODE using a POST request but cannot figure how to. I know how to create, edit and delete a node but am unsure on how to add ...
3
votes
2answers
71 views

How to get total number of rows on a block of a view

On hook_block_view_alter() I need to get a total number of rows that this block displays. For example, I have a view with the following block: On hook_block_view_alter() I do the appropriate checks ...
1
vote
1answer
239 views

How to create options in installation profile/ distribution to enable custom content types?

I have created a custom installation profile/ distribution with exported config files of a site. I have 4 content types in this site from which two will be installed by default but for other two are ...
0
votes
0answers
57 views

How do I distribute/share a project/product?

I have a site that I've built with Drupal 8, using composer and git to manage the code base. It's a fairly simple site that includes a handful of third-party modules, a few custom views, and a custom ...
0
votes
0answers
80 views

Configuration Inspector error…The site's configuration does not match the associated schema

I have recently started using Drupal 8 and I decided to go with the Varbase distribution. I installed it once and it came up with errors. I figured things were timing out so I increased the execution ...
0
votes
2answers
29 views

How do I fix these requirement conflicts?

While updating through composer, I am getting an error from the Webform module. Drupal version 8.9.1 updated. How do I resolve this error? Problem 1 - drupal/webform_node 5.15.0 requires drupal/...
2
votes
2answers
2k views

Translate view header

I add a simple text as view header but it is not exists in translatable text in admin/config/regional/translate. In Drupal 7 we could even translate unformulated views header and footer with the ...
0
votes
1answer
980 views

how to pass loop.index from view to node

In a views template (views-view-unformatted.twig.html), I have {% for row in rows %} {% set row_index = loop.index0 %} {{ row.content }} {% endfor %} where each row is processed in ...