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

Can't use exit(0), how else can I terminate a response?

Here's my code(using Drupal 8): public function checkForRedirection(GetResponseEvent $event) { $is_authenticated = $this->currentUser->isAuthenticated(); $route_name = $this->...
0
votes
2answers
893 views

How to load and render a webform with Ajax

I'm new on Drupal 8, and I want to make a custom module to load any webform of (webform module) on other pages of the website. The idea is to load the webform when the page load. All webform has ...
2
votes
1answer
18 views

How to add highlighting to exposed views_autocomplete_filter in Drupal 8

Is there a way (a hook perhaps) that would allow me to modify the autocomplete fields returned by an exposed views_autocomplete_filter field? I'd like to style the text typed into the field ...
0
votes
1answer
488 views

Suddenly unable to add a field to a new content type

When editing a content type I was going to add a simple boolean field to an existing content type. When attempting to add the new field Drupal threw an error. After a few more attempts to add a field ...
1
vote
0answers
9 views

Metatag migration from html

Drupal 8.8 Modules: Metatags & Migration plus. I am trying to convert a tag in an XML file to an open graph image metatag. File: modules/custom/my_module/dataxml.html This is the url that has ...
2
votes
1answer
42 views

Error “The module ldap does not exist” after composerizing project

I've inherited a tarball-based Drupal 8.7.8 project. I'm moving it to new hosting, and assuming responsibility for updates and maintenance. After updating core to 8.8.2, and updating all contrib ...
0
votes
0answers
11 views

How to use Media Library Tab order widget in CK editor

I'm trying to make the media embed button in CK to behave the same way as a Media field with the widget set to Media Library Tab order. At the moment, I can only select a view (see screenshot) What ...
0
votes
2answers
31 views

How can you filter an integer column by “Starts with”?

I have a view, and I want the users to be able to filter on an Integer field. String fields allow for filtering by 'Starts with'. I would like to do the same but with an integer. If the user enters ...
1
vote
2answers
2k views

D8 doesn't create .htaccess for private file system path

Following this guide: https://www.drupal.org/documentation/modules/file it says "When you specify the private directory in admin/config/media/file-system it will automatically create the sub-...
1
vote
0answers
21 views

Render blocks of custom type

Either I'm stupid or I can't search. Sorry if this is a duplicate, but I can't find any answer to my problem. I made a custom block type in admin panel, named it content_under_listing, and then I made ...
12
votes
2answers
5k views

KernelEvents::REQUEST is not fired on cached pages

I am trying to implement a KernelEvents::REQUEST event subscriber to perform some action on page load. I need this event to fire regardless of whether the requested page exists in the Drupal cache - ...
0
votes
0answers
12 views

How to change the Add another item button text for a multivalued field?

I have tried with this in template_preprocess_input function mymodule_preprocess_input(&$variables) { $element = $variables['element']; if (!empty($element['#name']) && $element['#...
2
votes
1answer
1k views

Views Rest Export and sending page numbers in it's response

I have a paginated views using "rest export" and I'm using it to show that data on mobile app, everything works fine, but I want to know how many pages exist on that endpoint to show page numbers in ...
7
votes
3answers
4k views

How to load theme style(s) in CKEditor?

In Drupal 8, how can you have CKEditor load additional stylesheets when using a configured filter format? In Drupal 7, you could give the WYSIWYG module paths to CSS sheets to load, which made the ...
0
votes
1answer
34 views

Creating ajax modal from event

Here's the deal. I want to create a modal popup when an add to cart event is triggered. I've got the event working just fine but can't seem to get the ajax to work properly. What I'm working off of ...
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 ...
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) ...
3
votes
1answer
830 views

Update a field without changing the node

I need to change a field in a node without altering the 'changed' timestamp. I know this was possible in Drupal 7 using field_attach_update(), but that has been removed since then. I could use an ...
0
votes
2answers
677 views

Print image with alt text

In the node template, I print an image gallery. I need to add the alt text. <div class="field--name-field_gallery"> {{ content.field_gallery }} {{ content.field_gallery.alt_field }} </...
1
vote
0answers
40 views

Create a route that redirects users to a path via parameter

I'm working on a custom module that needs to act as a mediator between a third party service and this Drupal site to manipulate some parameters. I've created a route: my_module.process_redirect: ...
0
votes
0answers
19 views

Manage Display Format options not saving

I'm trying to edit a field label under Product Type > Manage Display. I expand the settings and type in "Product Name" and his "Update" and then scroll to the bottom and his "Save". When I expand the ...
2
votes
0answers
992 views

How to obtain paging results from REST view [duplicate]

I am using Drupal 8 rest views extensively. I would like to be able to know how many page results there are available, as well as what is the current paged result. Does anyone have and knowledge or ...
0
votes
1answer
430 views

Theming paragraph fields from entity reference in view

I have a view (Drupal 8) where I load my entity reference field (display hidden), with three fields from a Paragraph type and a certain custom display). The HTML markup looks like this now: <div ...
1
vote
3answers
2k views

How to expose paging data in REST export views

How to allow views to export paging data along with entities? I can set pager, and it works of course, for example my_view?page=1 displays something like [ {...}, {...} ] but I only get list ...
4
votes
1answer
2k views

Pagination in a rest view api

How to handle this situation in the Rest Export View as api. We want to fetch a limit of 20 items in the api and with a load more feature. Currently our api produces hundreds of items. In the Pager ...
0
votes
2answers
26 views

twig check if image style or view mode exists

I have a site design the i need to implement. in this design I have a grid and in the grid I can put any content (node/paragraph) that i choose. the image of the content changes size and ratio in ...
0
votes
1answer
38 views

What's the proper way to refer to all the code in `core/lib/Drupal`, or the code in `core/lib/Drupal/Core' or `core/lib/Drupal/Core/Foo`?

When we say 'core' we mean the whole of Drupal core that you get from the Drupal project page. On D7, core code that wasn't in modules tended to be called 'the includes' IIRC. But on D8 they're not ...
-2
votes
1answer
34 views

How can I delete vocabulary terms at a certain level?

I know there are several threads here about deleting terms with various techniques; I'm going to experiment deleting terms with drush at a certain level, say level three terms and below in the ...
26
votes
4answers
22k views

How do I export/import views?

I know how to do it in Drupal 6/7, but I cannot find where to export/import views in Drupal 8. From which admin page is possible to do it, in Drupal 8?
16
votes
8answers
8k views

Exclude configuration from import/export

I thought this was a simple use case of the new Configuration management system, but I haven't had any luck finding out how to solve this: Problem I want to store configuration in git and use drush ...
1
vote
2answers
184 views

structure_sync not working

I am trying to use structure_sync within my Drupal 8.4.4 project to export the block content of custom blocks as a configuration (see also the discussion "Custom blocks cannot be properly exported and ...
0
votes
0answers
11 views

InvalidParameterException for node must match “\\d+” [closed]

My Drupal 8 has for a long time this error, which happens when I just login, or edit some webform. Even after updating it persists. Backend log: Uncaught PHP Exception Symfony\\Component\\Routing\\...
8
votes
4answers
5k views

Get a field instance's settings

What's the equivalent of field_info_instance() for Drupal 8? The default field settings are stored as configuration in a file like field.field.ENTITYTYPE.BUNDLE.FIELDNAME.yml, but how do I get their ...
0
votes
2answers
347 views

Problem installing Devel module onto site

I went to drupal.org, copied the link for the Devel module, went to my site, New Module (under extensions) paste the link into the "Install from a URL" and when I hit Install it gives me the following ...
1
vote
1answer
997 views

How to add class attributes to radio options in Drupal 8 Webform YAML Editor

What I'd like to be able to do is provide some extra detail to the HTML markup that the Webform module provides in Drupal 8, specifically being able to classify individual radio button options. What ...
11
votes
6answers
21k views

How do I add a CSS class to a form label?

I want to add a CSS class to a label on a page that is using Drupal 8 Form API. I have been unable to find a reference online on how to apply that. I have used the following workaround, but it ...
1
vote
0answers
31 views

How can I keep logs of all outgoing emails?

I am using SMTP Authentication Support module to send emails with drupal 8.When I see watcdog mail-log from admin it shows only emails sent for registration or password reset, that is also with single ...
1
vote
1answer
175 views

How do I add a script just above the closing body tag?

How do I add a script on Drupal 8 site/app just above closing body tag? Vendor provided some JS in the following form: <script> ... code </script> Asked me to place immediately ...
2
votes
1answer
343 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 ...
0
votes
1answer
67 views

“Button with id|name|label|value ”Log in“ not found”

Trying to run some functional JS tests, Anyone know what is up here? Runtime: PHP 7.1.33 Configuration: /app/phpunit.xml Testing Drupal\Tests\commerce_product\FunctionalJavascript\...
0
votes
2answers
50 views

How do you programmatically include an entity type to a workflow?

I have a workflow to which I want to include entity/content types programmatically since these content types will be included to the system by the installation of the module to which they reside. I'm ...
3
votes
2answers
966 views

How do I get comments to be indexed?

I'm not sure if it's actually doing this; I can't see any options for comment fields in the configuration. How can I check? Does it say explicitly somewhere?
0
votes
1answer
61 views

Can we pass argument to a form from a Twig template

I have a form that accepts a custom argument sourceid public function buildForm(array $form, FormStateInterface $form_state, $sourceid = NULL) Now, this form is displayed in a twig template ...
0
votes
1answer
750 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
2answers
643 views

Edit a form retrieved using FormBuilder::getForm()

I found out how to get a node creation form, but I want to display and modify it (e.g. delete some fields I don't need). This is my code. public function buildForm(array $form, FormStateInterface $...
-1
votes
0answers
13 views

How do you add fields to content payment entity for an off-site payment method?

I would like to create some fields on payment entity and make different bundle of it, if possible, so I can use it with an off-site payment. Some of the fields regarding the payment are stored before ...
8
votes
2answers
12k views

Get the public path directory

I want to save file programmatically in public path, and I want to know how can I get Public Directory path in Drupal 8. In Drupal 7, I would use the following code. drupal_realpath(...
0
votes
2answers
280 views

Export/import users

I am looking for a way to export users from one Drupal 8 Site into another Drupal 8 site. Is it possible to do this by exporting and importing the Users tables? If so which ones? I see there are ...
0
votes
1answer
543 views

How to write SQL Statements With Spaces In Column Names

Hi I am trying to write a Dynamic Query to get data from the database but I am facing issues to write a query for column names with white spaces. My Product_Details Table looks as below: | S.No. | ...
0
votes
1answer
28 views

Unable to auto-create node from webform

I attempted to create a custom module that automatically creates a node upon submission. I used the second response in this post: How to create a node out of a webform submission? Per the ...

1 2 3 4 5 283