All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
4 views

drush migrate:upgrade not behaving as expected

I'm working with the Migrate Tools modules for the first time. Specifically, I'm trying to use the Migrate Upgrade module to import users and roles from an old Drupal 7 site to a new, Drupal 8 rebuild ...
0
votes
2answers
54 views

Trigger a Drupal behavior from another module in Javascript?

The block_ajax module defines a behavior in its module: https://git.drupalcode.org/project/block_ajax/-/blob/8.x-1.x/js/refresh_ajax_block_command.js I want to initiate this call every 60 seconds so ...
0
votes
0answers
5 views

Modules page does not load

Running a setup on Ubuntu and WSL (Windows Subsystem for Linux) with Nginx and PHP7.4. Drupal 8 and Drupal 9 fresh installations loads every page no problem, except the Extend page at /admin/modules. ...
1
vote
0answers
7 views

How to render image as svg in drupal 8?

I want to display my svg image as svg code in html to easly change its color using css. I installed modules ( SVG image, SVG Formatter, SVG image field, SVG Image Responsive, SVG Sanitizer) Then in my ...
0
votes
0answers
5 views

Drupal 8 get alias of node on presave

I was trying to get the url alias using below for pages by using the following code: \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $nid); It works for pages that are already ...
0
votes
1answer
544 views

I need to reference a custom field I created in User Profile

I used Drupal 7 computed fields to calculate weight loss. This is what I current have. Which works in a sense but only where the user inputs their initial weight and subtracts their current weight to ...
1
vote
1answer
10 views

Failed asserting that two strings are equal in a patch

I have submit a patch on community but I am getting an error in result that Failed asserting that two strings are equal. This is the patch. index 31bf064..fa079cc 100644 --- a/advagg_css_minify/yui/...
0
votes
1answer
762 views

Multi step form [closed]

I am using Webform module, Can anyone help me to make a multistep form where suppose on front page i choose select service and select location and on submit a new form opens in pop up. Pls suggest ...
0
votes
1answer
513 views

How do I update the CKEditor text widget using CKEditor API

I am using Drupal 8's Ajax API to update form fields in a form depending on the input in another field. One of the fields I want to update is a text_format field that uses Drupal's ckeditor. If I ...
-1
votes
0answers
13 views

Is it possible to use a content type as data-entity-type?

I can use the following snippet to insert a media image into content: <drupal-media data-align="right" data-entity-type="media" data-entity-uuid="da0c27fd-211a-4f25-9318-dde2955635fc"></...
16
votes
4answers
28k views

Redirect after form submission

I create custom Form in Drupal 8 ,I remember we can redirect to custom path in Drupal 7 with set $form_state['redirect'] = 'mycustompath'; in custom submit handler, but how can redirect User after ...
2
votes
1answer
706 views

Run Drush command with Gulp

I would to know how I can run a drush command like drush @alias cc all with a gulp workflow ? This is my starting code: var plugins = require('gulp-load-plugins')(); gulp.task('drush:cc', ...
0
votes
1answer
421 views

How to add Table of Contents in a PDF?

I am using the Drupal Print module to create downloadable PDF from my site. This works very well indeed. But I would like to have a table of contents in the left region of the downloaded PDF. For ...
1
vote
1answer
2k views

“b.handleError is not a function” on image remove/upload

I was not able to upload/remove CCK field images from the UI; when I looked at the console in Firebug, it said, "b.handleError is not a function." When I look for this error on Internet, I keep ...
-1
votes
0answers
19 views

How do I trigger group membership was granted for a user - Group module [closed]

I try to use group module in d8. 1. I created a new group type named test 2. I added 2 group as demo with admin is default group_membership. 3. in group 1 (name okok) I edited and added new user to ...
1
vote
0answers
11 views

Custom redirect to an url with “+”

I use search api module and a view of products. If I put the search text block and I do a search, It redirect to an url like this: <my domain>?search_api_fulltext=word1+word2+word3&sort_by=...
0
votes
1answer
15 views

How to get taxonomy tree with path auto token?

I'm using Path auto module to automatically set url of articles. Last part of url is node title and [node:title] works just fine. But url part before node title should follow taxonomy structure (tree) ...
0
votes
1answer
21 views

Overriding 'user.login.http' method

I am trying to override the core login method in Drupal\user\Controller\UserAuthenticationController by extending the UserAuthenticationController class so that I can inject custom data into the ...
5
votes
1answer
9k views

Recommended file permissions

Similarly to what described in https://www.drupal.org/node/244924, which is for Drupal 7, is there any script to set the right permissions for Drupal 8? How can we take care of the file permissions ...
0
votes
1answer
913 views

Changing '#view_mode' in content type's render array

I have a content type in Drupal 8 project that has image, name, info and body field as a default display, and image,name and information as a teaser display. I am able to display this content type ...
0
votes
0answers
20 views

How do I display 11 element on a view's first page but 12 on the others?

I have been tasked to create a view that would display 11 elements on the first page, and 12 on the others. My main problem is that I found a way, however the 2nd page skips the first page's 12th ...
5
votes
4answers
11k views

Programmatically set a datetime field

I already asked a question like this (Set date field in D8). Ok duplicate entry? NO! Now i have also to set a time and i'm using a array. My code looks like this. $field_array = [ ##begin of ...
0
votes
1answer
398 views

Entity field value inherited from another entity programmatically?

I'd like to setup two content types in a parent -> child relationship. Node A of content type "parent" has custom field: (text) Description Node B of content type "child" has custom fields: (text) ...
-2
votes
0answers
13 views

Unused External Js - Google Insights [closed]

Hi tested my website on google insights. It displays remove unused javascript error. all are external scripts eg google,amp etc. Is there any solution for the same.I am already using Adv/Agg module.
0
votes
1answer
2k views

Progress bar advances, operations does nothing

I'm trying to create a batch to import users. I used this (http://pastebin.com/duTbxpgd) as an example, but somehow it's not working. I see the progress bar advancing and It's showing the right number ...
-1
votes
0answers
9 views

Displaying content in the same div while using a for loop in twig template and avoiding rendering multiple divs with each iteration of the for loop

I have the following code in my twig file to render audio: {% for item in items %} {# some code ... #} {% if item.audio %} <div class="col-md-6"> <div class = "source-box audio"&...
2
votes
2answers
1k views

watchdog truncate or delete

Watchdog table has become so big that, truncate cascade or delete command in the table is not working at all. The moment the server encounter a DELETE command in watchdog, it gets busy in executing ...
1
vote
1answer
668 views

How to prevent a node from being saved/updated by using the Rules module?

I've created a content type 'H'. The following rule (using the Rules module) has been built to prevent the node from being saved/updated if the field 'a' is larger than 5. Event: Before saving ...
-1
votes
0answers
14 views

Creating a link to download a file

I have observed that my uploaded pdf files are stored in this directory in my web server:- public_html/sites/default/files I want to create a download link to a pdf file say example.pdf. Can I assign ...
0
votes
2answers
565 views

Need to make Anonymous user create node through a Form but can't

I need to make anonymous user create a node through my site. The node which is create would be unpublished, which an admin can publish later. I wrote the following code which works perfectly but the ...
3
votes
2answers
2k views

Add javascript to returned form after ajax validation

I've built a form with the form API, and it's submitting via ajax via this type of thing: $form['submit'] = array( '#type' => 'submit', '#value' => 'submit', '#ajax' => array( '...
5
votes
4answers
5k views

Change default text (-Any-) of select option in Exposed View Filter

I am using views exposed filter. I want to change the text -Any- into something else. How can I do that (without using jquery/javascript) ?
3
votes
1answer
565 views

How do you use hook_query_alter to get inside a query's creation?

I'm getting no love from hook_query_alter. I have a simple query to which I want to add a tag, while also adding a node_access tag. Thus the whole query looks like this: $the_nodes = db_select('...
1
vote
1answer
14 views

Select order type and store with hook_form_alter()

In drupal commerce, I have 3 stores and 3 orders type When placing a manual order, i am first asked to choose the store and the order type ( which are entities), with radio buttons. With a select ...
0
votes
1answer
41 views

Count how many children have a reference to the parent

Explanations: 1) I have a node "parent" 2) I have 2 nodes "child" 3) Each child has a reference field (filled with a reference to the node "parent") Now, I'm trying to create a list with the ...
0
votes
1answer
14 views

Sort Views table field by alphabet

Table field 'Manufacturer' is set to sort by ascending or descending and when you sort it. At first it looks like it's sorting by alphabet, it starts with A, B, C etc. but eventually ends up with A ...
0
votes
0answers
11 views

How do I get the file path of a document?

I'm using views-view-fields.html.twig to display content. I can print the file name using fields.field_module_field_name.content, but the code below outputs not only the file name, but also the path ...
0
votes
1answer
28 views

Can not override template for specific view

I'm new to Drupal so this might be a noobish question. I have a view called 'Category' where all posts are listed that belongs to the chosen category. I would like to override the views-view-...
0
votes
2answers
3k views

How do I identify the version of Bootstrap?

There is a general solution on How do I identify the Bootstrap version? but I found it's not useful for Drupal, as I couldn't find the bootstrap.css file. I think I found a bug in it. I want to ...
1
vote
1answer
19 views

How can I hide search results until the user submits the exposed form?

I have a fairly straightforward view, which exposes a simple keyword filter to the user. Currently, when I first land on the page containing this view, all records are displayed (i.e., the search ...
1
vote
1answer
17 views

Hide/show a custom block in Drupal 8

I have created a custom block of id downloadourapp and I would like to show/hide it base on certain statements. I have create my custom module along with .module file where the code should be, ...
0
votes
2answers
872 views

add_where() causes the view not to be displayed

have a page that features a few views based on content types. Each content type includes a keyword field. This page is reached from a short quiz. I'm trying to limit the content in the views based on ...
2
votes
1answer
505 views

The following module is missing from the file system: (Theme name)

In D7, I'm getting many of these warnings: User warning: The following module is missing from the file system: bootstrap_barrio. For information about how to fix this, see the documentation page. ...
1
vote
1answer
16 views

Find if $view object is a block or page

I am unable to debug this because when I print the display object I get a memory error from the size. so with something like this I can get the display title. function mailnow_views_pre_render(\...
1
vote
1answer
808 views

Render Custom Menu Block from Menu Tree Array of Links Programmatically

Here's what I have: A custom menu (side nav) that mimics the main/secondary menu tree which shows the entire subtree of the root menu item (Dine, Play, Stay) you're under. This sidenav can be ...
2
votes
1answer
580 views

Add class in sub menu

I am trying to convert html to Drupal 7 theme. function theme_menu_tree($variables){ return '<ul class="my-class-1">' . $variables['tree'] . '</ul>'; } simply returns the entire menu ...
5
votes
2answers
5k views

How can I have admin language English and frontend language another?

I would like to create a site to display the frontend of the site in one language and still keep the backend in English (or another language). Is there a module like "Administration Language" or any ...
0
votes
0answers
14 views

Cache tag problem causing block to disappear

We have a Drupal 8 site with a few thousand pages which are all in a huge hierarchical menu. Many pages display this menu as a navigation sidebar and each page can be customized so the root of this ...
10
votes
10answers
4k views

Delete 13000 nodes

I have about 13000 nodes to delete in a Drupal 7 site. I have tried the Views Bulk Operations module to delete 500 nodes at a time, but it times out. I can only delete 50 nodes at time. How can I ...
0
votes
0answers
12 views

Back-office in English / Front office in other language [duplicate]

Is this possible the have the back-office of a drupal 8 website in English (for exemple) and the front office in one other language only ? I don't want my front office to be multilingual (with /fr ...

15 30 50 per page
1
2 3 4 5
1653