All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

How to add a UNION to a query in hook_views_query_alter?

I have a custom multiple-value field (via plugin) in a bundle that needs to have an dynamic entry added prior to rendering in the view. I've tried render hooks. The problem is that if there are ...
1
vote
1answer
25 views

Updating without Composer

I've previously used Drush to update my Drupal-installations. They are installed without using Composer, and currently on version 8.7.3. However, when I try to use Drush (drush v8.1.15, using drush up)...
0
votes
1answer
16 views

CKEditor add custom class to table

I want to add a class to a table inserted in CKEditor. I have tried to add a custom style using the styles dropdown and add this line, table.my-custom-class|Table, but when clicking on the table the ...
1
vote
1answer
18 views

Remove Log in or Register to post comments

For some reason any time a new post is made at the top of the post a module shows up saying Log In or Register to post comments The problem is that it shows up way at the top of the post, instead of ...
1
vote
3answers
45 views

Set label of $entity programmatically in a custom form

I need to change the label of a custom content type programmatically. I've looked around but I couldn't find a solution. This is my custom form: class GroupContentForm extends ContentEntityForm { /...
1
vote
1answer
29 views

Add custom attribute to an external JS script

It's not really clear how to add custom attributes when adding an external JS script to the page. Currently I have this code: drupal_add_js('https://code.jquery.com/jquery-3.4.1.js', array('type' =&...
0
votes
0answers
10 views

How to show one variation of one product in a View Pane

I have a View Pane on my home page where I list all products that are in promotion. Each product variation that can be set to "show in promo banner 1" via a taxonomy term field with checkboxes. So the ...
-2
votes
0answers
22 views

How to get nearby zip codes of a particular zip code in D7? [on hold]

Zip code and radius fields are there in search form. After providing a particular zip code(eg - 12345) and radius(eg - 5 mile), how it will return some zip codes within the given radius? How google ...
0
votes
0answers
7 views

How to alter search api autocomplete to exact match?

I have installed search api autocomplete module. I have configured it also but the requirement is to it should search only 'starts with word'. now the result is searching if a word present in mid of a ...
1
vote
0answers
19 views

Rendering a multipage form from single function

Is it possible to create a multipage form from a single function? I looked at the MultistepForm.php script in the example module which uses a separate function to render each page of the multi-step ...
0
votes
0answers
10 views

How to only show current book on book navigation?

I have a list of books and I would only like to see the current book on the book navigation. How can I achieve that?
-3
votes
0answers
20 views

Block with Listing of custom links to redirect to pages

With Drupal 8 I want to have a block with a select list that I get programmatically from taxonomy terms and when the user clicks on Submit it redirects the user to the page I put in the list. What is ...
1
vote
0answers
21 views

How to add script on Drupal 8 site/app just above closing body tag?

How to add 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 above &...
1
vote
1answer
14 views

Default all entities to English

At some point we will be enabling translations on all entities in Drupal 8. However, we are not ready yet so in the meantime we would like to set all of the entities (content types, taxonomy terms, ...
1
vote
0answers
33 views

How to get rid of the “Ago” in a time format?

When translating to another language, a lot of things are in place, so much that most of translating goes with ease. However one thing seems very hard get done: getting rid of the "ago" in the format: ...
0
votes
0answers
9 views

Published checkbox only available for administrator

Only the administrator can publish a node of content type Report. It is not using content moderation or groups though other content types are. All permissions are set for the "site admin" to create/...
1
vote
1answer
14 views

Format for webform submission node tokens?

I have a field on my webform node which is an entity reference to a taxonomy term. I'm printing it in the webform using the token [webform_submission:node:field_sports], which prints the field output, ...
1
vote
1answer
22 views

Is there a way to list permissions for a given module?

Using Drush 9, I am trying to automate the creation of a role and I need to assign permissions to it. I see that I can use drush role-add-perm to do the assignment itself, but I can't find a command ...
1
vote
1answer
16 views

Token to get the last component of [node:url]

I'm using [node:url:relative] but my path has multiple parts /content-type/node-title . I would like to get only the node-title part. Alternatively, a token that give me the node title transliterate ...
0
votes
0answers
32 views

Programmatically creating paragraphs is extremely slow

I am adding paragraphs from xml file programmatically but it is extremely slow. for example I'm basically creating paragraphs like this: $row = ['field_title' => 'title', 'field_id' => 'id' .......
0
votes
0answers
11 views

How to safely delete a node reference value

I have a field in a content type, content_type_A, whose field type is Node reference. It references another content type, content_type_B, which has a field which i cannot edit of type Node module ...
0
votes
0answers
21 views

How to install Drupal 8 with composer on Apache server?

I want to install Drupal 8 with the drupal-composer/drupal-project on a server with apache in the public_html folder. The issue is that I want to maintain the folder structure /projectname/web. So, ...
0
votes
0answers
14 views

Unable to alter OEmbed remote video providers

I'm trying to add a remote video provider for OEmbed. I'm using the hook_media_source_info_alter to change the OEmbedDeriver class like this: use .../CustomOEmbedDeriver; /** * Implements ...
0
votes
0answers
30 views

503 Service Unavailable error in all pages except added to my route file

I have a D8 web with some views and pages. If I log in with administrator user, all works good. If I log in with a normal user, I get 503 service unavailable error after some seconds of load. It ...
2
votes
1answer
29 views

How do I return a Twig template inside the build method of a block class?

Am new to Drupal and this week I learned quite a bit about module development, and for today the case is: For my new module, I create a custom block that renders a markup, and from the folder ...
-3
votes
0answers
13 views

How to display external api data in drupal 8? [on hold]

I want use external api in drupal 8. I want to post parameter to external API and recieve the response and show the response on node.
-2
votes
0answers
23 views

fix-permissions.sh for Drupal 8

With Drupal 7, when I upload a project from local to server, I usually run fix-permisions shell script to change owner and permissions of folder/files. Is provided in : https://www.drupal.org/node/...
-1
votes
1answer
13 views

Can I add a menu link with a parameter? [duplicate]

I would like to add a menu link using the "Link"-Field with Autocomplete, but I would like to add a parameter afterwards. Pretty much like this: ...which is not working. Is that possible? Thanks!
0
votes
0answers
23 views

How can I theme a paragraph on admin edit pages?

I'm struggling to override the template on the admin interface for a content type. I'm going to need to do several modifications to the edit form to meet the editor's requirements, however, I seem to ...
0
votes
1answer
22 views

How can I run a Views SQL query in PhpMyAdmin?

i go to admin/structure/views/settings, check Show information and statistics about the view during live preview and then Show the SQL query checkbox that will appear below. I have a field which is ...
0
votes
0answers
23 views

How can I change the value of the og:image meta tag?

I want to change the value of og:image property for below tag programmatically. <meta property="og:image" content="https://example.com/sites/default/hotelier_in/styles/themes/hotelierindia/logo....
0
votes
0answers
22 views

Wrong path of Image for property = “og:image” of meta tag in content view source

I have uploaded an image in my content. When I checked view source of the page, it shows the wrong image path for og:image property of meta tag. After uploading the image in my content, image path ...
0
votes
0answers
26 views

Disable validation when previous button is pressed

I have a multistep webform with required fields. The problem is that when I press the "previous"button in order to go to the page before the validation triggers and does not allow me to change the ...
0
votes
0answers
18 views

How to save the webform data to custom table?

I designed a student registration form using webforms module. My requirement is to save data from the form to table student. How can i achieve this? Is there anyway to mention this in configuration ...
0
votes
1answer
19 views

Hook form alter to check date field is empty or not

First of all I'm new to custom modules, I'm using hook_form_alter to do some custom validation, in the middle I have to check if a date field is empty or not, if empty I will display an error message. ...
0
votes
0answers
9 views

How to Create a Form with Ajax Output External to the Form?

What I want to achieve is: A form with a number of selects / textfields A div external to the form that contains information pertinent to the form's current input (i.e. not contained in the form ...
0
votes
0answers
12 views

“Promoted to Front Page” option only showing for administrator

I am using the "Promoted to Front Page" option for a view that is displayed on a landing page. The option shows in the create/edit form for an administrator, but no other user for the article content ...
0
votes
1answer
12 views

Multi-page wizard webform that posts to external URL?

I've got a multi-page wizard webform whose results I need to post to a specific URL. I see in the webform settings that you can set a Custom POST url. However, this appears to break the muti-page ...
-2
votes
0answers
34 views

How to access individual form elements in theme?

I have overridden the default user login form in Drupal 8 using a different template in my sub theme, but it isn't of much use because when I access it in twig template, all I can do is <form {{...
3
votes
1answer
33 views

Where to programmatically enable a Feature module

I created a Drupal 7 feature and usually I would enable it with Drush, but someone suggested that I enable it with an update hook (which I assume means it gets enabled on updb or update.php). I saw ...
0
votes
0answers
15 views

How can I add an additional, custom profile to the checkout flow?

In Commerce 2 I have a custom Profile to collect additional contact information that may differ from the billing/payment profile information. I've created the new profile but cannot figure out how to ...
0
votes
1answer
19 views

How can we just apply the updates to a single module using composer without apply patches for other modules?

We have the following composer.json file. When we want to update a module such as Environment Indicator, we run the suggested composer command composer require drupal/environment_indicator:^3.7'. ...
1
vote
1answer
12 views

Remove an item from list of taxonomy terms prior to rendering

What is the correct way to remove an item from a list within hook_entity_view or hook_preprocess_node? I am trying to remove a taxonomy term from a list of terms EntityReferenceFieldItemList. I ...
2
votes
1answer
25 views

How do I delete files using the Content > Files interface?

I got a ticket from our stakeholders that certain outdated PDFs are googlable, and this is causing problems with people going on old information. Navigating to admin/content/files, I am able to find ...
2
votes
1answer
37 views

Migrate nodes with special characters in title

Given a source's title like This "cool" & "neat" article's title has HTML entities , is creating a title of This &quot;cool&quot; &amp; &quot;neat&quot; article&#39;s ...
0
votes
0answers
21 views

Commerce add to cart throws fatal error related to order_items

On a Drupal 8.7.7 site with Commerce, adding an item to the cart results in whitescreen "The website encountered an unexpected error. Please try again later." Checking the logs, there's an error ...
0
votes
1answer
24 views

Custom remote video thumbnail

I'm using the media entity from Drupal core together with the media library, to handle media on my site. I have Remote Video and Image with crop media types. I'm using the crop and image_widget_crop ...
0
votes
0answers
13 views

Custom Search API sort logic

I have content (multiple content types) which are tagged by a taxonomy that indicates the geographical region they're relevant in. The content is indexed using Search API and Solr. Each user is also ...
0
votes
0answers
14 views

Drupal fieldinfo error message

I'm getting the following error messages when I edit or add content in Drupal 7.67 Notice: Undefined index: module in FieldInfo->prepareInstanceWidget() (line 591 of C:\xampp\htdocs\drupal\...
0
votes
1answer
27 views

Make my view the default for content type

I am probably doing this the wrong way, so please correct me if I am wrong! I have created a new content type, called "Entities". My content type has many fields, and the default view when you visit "...

15 30 50 per page