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
2
votes
2answers
91 views

Custom view sort plugin not working only when used in table sorting

We have a view of committee memberships (= custom entity). The committee memberships hold references to the committee and the politician and have a field "role". In a view we want to output ...
0
votes
0answers
26 views

Migrating multivalue link fields from CSV

I am trying to migrate data from D7 to D8 using Drupal Migrate with source CSV. I am able to import all the data except multivalue link field. With the help of examples from Migrate Plus, I am able to ...
1
vote
1answer
46 views

How to get the parameter value from an ajax call in the page controller?

I have the following js code according to es6. (($, Drupal) => { Drupal.behaviors.mymodule = { attach: () => { document.querySelectorAll("a").forEach(element => { ...
2
votes
2answers
81 views

Can users be forced to insert only plain text by default in CKEditor?

I know there is "Paste Text" button in CKEditor, and I can limit allowed HTML tags. But it's very hard to explain clients to use specific button when they insert text. As result they often ...
0
votes
1answer
24 views

Change data export download link label

I want to change the label shown to export csv file download link that generated with data export of a view. I didn't get any setting to change the label of download link - download full list.
0
votes
2answers
30 views

How do I limit access to a custom field type I have created so that it can only be attached to certain bundles of content?

I have a custom field class. I would like to limit it to specific content types and bundles that I will choose when my custom module is installed and as other content types meet certain criteria. I ...
0
votes
1answer
38 views

How to force a JS library to be loaded via HTTPS?

How can I force a js library to always load only via SSL? Specifically, I want to get Drupal to always load stripe.js with SSL, because stripe.js refuses to load over http (you get a 403 FORBIDDEN ...
1
vote
1answer
61 views

EventSubscriber returning correct content but status code is 404

As the title says, content is being returned correctly but the status code is 404. I have checked the .htaccess file and the Apache config file as well. All seems to be fine. I have the following in ...
1
vote
1answer
34 views

Is it possible to combine two filter criteria exposed filter into one dropdown

Is it possible to combine two filter criteria exposed filter into one dropdown. In drupal 8 I am creating a view to search certain content type. One of the content type has three select list field, I ...
0
votes
1answer
33 views

How can I automatically flag new comments?

I have a Drupal 8 site with Flag and Rules modules. How to flag a new comment ? I want that when a user creates a comment, the comment should be automatically flagged. I created a type of Flag on the ...
0
votes
1answer
22 views

How to round the total price, display without decimal? [closed]

I need to count on decimal places (tax, promotion, fee ...), but the total price must be mathematically rounded without decimals. Example: 2 x product1 CZK 424.00 1 x Product2 CZK 408.00 Subtotal CZK ...
0
votes
1answer
49 views

Save customer information at checkout

My customers are required to provide an address at checkout (Shipping information pane). They can also create an account after checkout is complete (Guest registration after checkout pane). But the ...
0
votes
1answer
17 views

Custom contraint validator: show an error message with a link

We use a custom constraint on a custom entity type. In this entity type we have a string field "url basis" which is used to create aliases for many kinds of pages and data related to this ...
0
votes
0answers
28 views

Image Styles and CDN Module

I'm having an odd problem with the CDN module... If I upload an image, the URL for each image style will appear broken until I open it in the browser first. Then, it will work in the CDN. I've tried ...
0
votes
1answer
23 views

edit the custom blocks of a node's layout without having to first click the layout tab?

Is there a way to edit a node's custom blocks from the the node's normal view page with having to fist navigate to /node/123/layout? It'd be great to be able to click the block's "edit me" ...
1
vote
1answer
39 views

How can I limit query results in hook_views_pre_execute?

I am developing a Drupal 8 website where I have a block view displayed for certain content types that shows related information from other content types. I need to dynamically limit query results ...
1
vote
0answers
19 views

create a class from taxonomy to wrap image and caption field

I have a content type called events. I created an image media type reference field called speaker image and set it to unlimited. Within my media image type, I've created two custom fields, a text ...
0
votes
1answer
105 views

How to flag an entity when it is created or updated?

I have a Drupal 8 site with the Flag module. I want when a user creates or updates a node, product, store, group, ... the updated entity is flagged. How to flag an entity when it is created or updated ...
0
votes
1answer
26 views

JS scripts not loading on certain pages

When logged in as a user (not admin), some JS scripts do not load on certain pages. I found out about this issue because I am using the module EU Cookie Compliance and the scripts it uses (...
0
votes
1answer
44 views

How do I install core on Windows 10 with Nginx server?

I Want to install Drupal 8 on Windows 10 with nginx server. I do know how to install with Apache using XAMPP. I use PHP 7.2, Microsoft SQL as the db. I installed nginx 1.18.0 and PHP in C:/ I ...
0
votes
0answers
35 views

Add field to menu link content

I am trying to add a list field to the menu links. I have executed the database update and it creates the field in the "menu_link_content_data" table correctly. But when I go to the menu ...
0
votes
0answers
12 views

Override “International phone” field placeholder

I've installed phone_international contrib module for Drupal 8 project and want to override placeholder. In widget setting there are no placeholder. Also tried to change it with form_alter_hook and ...
-2
votes
1answer
39 views

Get base URL in a custom block

How can I get the base URL in the custom block?
0
votes
0answers
29 views

Contact form doesn't send body message for anonymous users

I'm having a problem with contact form module, from core 8.9.5. I've created a contact form: if I send a message with admin user, recipient gets the email with all fields, also "body" ...
1
vote
3answers
91 views

How to clear image (or file) field data for specific node programmatically?

I need to clear/remove image (or file) field from specific node. I have before: I want to get after code execution for the field: What code should I use to properly clear image (file) field data?
0
votes
3answers
44 views

Constraint on paragraph field not working

Here is a very simple code: 1-My constraint plugin (MyConstraint.php) /** * @Constraint( * id = "MyConstraint", * label = @Translation("Never Validated", context = "...
0
votes
0answers
25 views

How to catch various Guzzle exceptions in s3fs module?

In working on a site with the s3fs module, we have encountered various scenarios that cause page loads to fail with the error, The website encountered an unexpected error. Please try again later. The ...
5
votes
1answer
72 views

What does the array_filter key in $form do?

I'm following this tutorial on creating a settings form for a module in Drupal 8. The instructions say to implement the buildForm method of ConfigFormBase in the following way: public function ...
0
votes
1answer
14 views

How do I get low level data from the Flag module?

Is it possible to get the following raw, low level data from the Flag Module and/or it's services? Flagging count as integer URL to flag/unflag as a string Current user's flagging status as boolean ...
1
vote
1answer
60 views

How to have config from a ConfigFormBase immediately take effect without needing to export it?

I created a simple test module that adds a text banner to all nodes if a checkbox is checked in the form of the modules configuration. Currently it is working halfway as I want. When the checkbox is ...
0
votes
0answers
20 views

Lable of radio button does not have `for` attribute in custom form

I have created a custom form and showing the radio buttons as below. $organization_options = array( 'ABC' => t('ABC'), 'PQR' => t('PQR') 'Other' => t('Other'), ); $...
0
votes
0answers
20 views

How to add “null” value in elastic search field if data is empty?

This might be long , but I am trying to make understand my problem. If a field is having empty data then that field is not coming in elastic search index. I want to print something like empty or null ...
0
votes
1answer
16 views

Why am I getting an error message in my dashboard for unprotected private files?

I have a site with Drupal 8.9 Why am I getting an error message in my dashboard for unprotected private files ? When I go to the link it says this is for Drupal 6 and 7. PRIVATE FILES DIRECTORY Not ...
0
votes
1answer
29 views

Why can't I apply patches in the recommended-project?

I just created a new site and I cannot apply the patches with Composer in Drupal 8.9 Here is my composer.json file : { "name": "drupal/recommended-project", "...
0
votes
1answer
39 views

How to use DefaultSelection::getReferenceableEntities in custom controller?

My Goal: I want to create a customized entity_autocomplete form field to better fit my needs compared to the default one - making some modifications to the HTML and JS that's being used, as well as ...
0
votes
1answer
36 views

Display custom form mode in twig with drupal_entity_form

I am using the form_mode_manager module for creating new form modes. I have currently a new edit form mode which is called applicant, but whenever I add the drupal_entity_form function in my twig ...
0
votes
0answers
16 views

Problem using Leaflet Map

I am trying to use a simple Leaflet Map, which gets its markers from a AJAX feed and I have got it working on a basic HTML page outside Drupal. But when I try to use it from Drupal, only an empty (...
1
vote
0answers
27 views

Database dump without revisions?

Are there methods to exclude revision data in a database dump? The purpose would be to reduce the file size for developers that want a db dump for local development. I know that drush sql-dump has an ...
0
votes
1answer
48 views

How can I auto-rotate an image on file upload in a custom form?

I'm using the FAPI to provide the user an upload field for an image. The field is: $form['product_img'] = [ '#type' => 'managed_file', '#description' => 'Upload a PNG or JPG image of the ...
0
votes
1answer
33 views

Using twig, how to show a message on the frontend if a field is empty?

Using twig, I would like to show a message on the frontend if a field is empty. My question refers to a date field, but I think this question could apply to other field types. In my event content type ...
0
votes
0answers
12 views

How to render the feed display of a view as an xml file to download?

I have created a custom entity. I have used a controller for view_builder. "view_builder" = "Drupal\mymodule\Entity\Controller\MymoduleViewBuilder" MymoduleViewBuilder.php class ...
1
vote
1answer
39 views

How can I programmatically get various common user profile related URLs?

I'd like to get the following URLs in Drupal 8: /user/register /user/login /logout /user I already know I can use \Drupal::service('path.current')->getPath() to get the current path. I want to ...
0
votes
1answer
41 views

How to add constraints to custom data arrays?

I am validating csv files. I am thinking of using constraints and constraint validator framework available in Drupal to validate the data in the files. However, these seem to be designed to be ...
0
votes
1answer
28 views

Change Link URL in preprocess function

I need to slightly modify some URLs that are in a "Link" field on a custom entity type. In a mytheme_preprocess_myentity I've found that field with $variables['elements']['field_my_url'][0] ...
0
votes
0answers
12 views

How can I create a hierarchal book view page?

I created a node book with the following structure: Introduction Volume 1 Chapter 1 Chapter 2 Chapter 3 Volume 2 Chapter 1 Chapter 2 Chapter 3 Volume 3 Chapter 1 I'm trying to create a view ...
0
votes
0answers
14 views

Modify variables set in parent's theme template using preprocess functions

i am having this theme parent's template field--paragraph--field-accordion-items.html.twig : {% set block_classes = [ 'flex-container', 'flex-child-auto', ] %} {% if element['#object']....
0
votes
0answers
12 views

Search API autocomplete: How to get Node ID in suggestions?

I am using https://www.drupal.org/project/search_api_autocomplete for autocomplete search results is it possible to get Node ID with suggested results? Thanks
0
votes
1answer
24 views

Send email to Commerce customer after order status is changed to Completed

I am attempting to develop a module that will send an email to a customer in my Commerce 2 store when that customer's order's status is updated to "Completed". I am basing my module off of ...
1
vote
0answers
57 views

PHP Fatal error: Class 'Drush\Commands\DrushCommands' not found

I am trying to migrate data using csv source to Drupal 8 installation using Drush and Drupal Migrate Tools. I am able to execute all the drush commands including the one to check the migration status (...
0
votes
0answers
17 views

How to properly configure the Mega menu module?

first of all I would like to point out that I speak very poor English, sorry in advance for the poor quality of the translations... (Google Translate) I recently encountered several problems with the ...

1
3 4
5
6 7
301