Questions tagged [drupal]

1

votes
2

answer
2.3k

Views

Radio button needs to be reset while refreshing

I am having two radio buttons namely users and groups. If is select groups and refresh the browser it stays in groups itself. When i give ctrl+f5 it's getting reset to users. My need is: While i click the refresh button in browser the radio button should be reset to users even it is selected as grou...
Fero
0

votes
0

answer
4

Views

Drutiny test module for Drupal failing with error: Drupal-8:PageCacheExpiry requires \Drutiny\Plugin\Drupal8\Audit\ConfigCheck

I am trying to run Drutiny like this from a Jenkins pipeline: + docker-compose exec -T cli ./vendor/bin/drutiny policy:audit Drupal-8:PageCacheExpiry @drupalvm.dev fatal: not a git repository (or any of the parent directories): .git In PolicySource.php line 24: Drupal-8:PageCacheExpiry requires \Dru...
Dennis
1

votes
1

answer
831

Views

Drupal 8 use display_form mode

I am trying to create a block / page with a form using the form display mode That looks awesome, even if permission field seems to be something good too for what I want to do, but the challenge is not there... I want to be able to create a block with a form using form_display mode and of course usin...
Cifren
0

votes
0

answer
5

Views

Behat test error after upgrade to Behat 3.3.1 - Too few arguments to function FeatureContext

I'm upgrading my Drupal 8 site to 8.4.8 which automatically upgrade behat to 3.3.1 I just found out my Behat test is no longer work and stuck on the following errors. Here's the error ArgumentCountError: Too few arguments to function Drupal\FeatureContext::__construct(), 0 passed and exactly 1 ex...
fkaufusi
1

votes
1

answer
49

Views

Re-use images in an image field with drupal 8

I have created an image field and I would like to be able to select an image already used in another content. Is there a module to do that from the 'Add new file' button of the field? Thank you for your help
Pascal Pivaty
1

votes
1

answer
793

Views

wkhtmltopdf style table of contents

I'm wondering how i can go about reducing the font size on the generated table of contents. I've read and reread their documentation here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt The bit i'm confused on is: The generated XML document can be viewed by dumping it to a file using the --dump-outli...
SoundCheese
1

votes
0

answer
244

Views

Can I run a python file on Drupal?

Ive had Drupal for quite a while and have only recently began to use it, I know how to insert new blocks and are familiar with the system. I know basic python programming and have created a WebScraping module that I want to input into the Drupal site, Ive researched for a while now but have no idea...
K.Blems
1

votes
1

answer
19

Views

Netbeans PHP Go to Declarations serves up functions from across several projects, not limited to just my current project

I work primarily in Drupal/PHP projects. For some reason, once in a while, when setting up a new project my code completion and Go to Declaration serves up results from other projects outside my Sources folder! Why is this?
texas-bronius
1

votes
1

answer
278

Views

Azure access token always returns 401

I have obtained an access token from https://login.microsoftonline.com/tenentid/oauth2/token - using the grant_type=client_credentials Now, when I try to get the embedded token from https://api.powerbi.com/v1.0/myorg/groups/gid/reports/rid/GenerateToken it always returns 401 unauthorized. Does anyon...
Sandeep Dhankhar
1

votes
2

answer
204

Views

calculate difference between dates with conditional in a computed field drupal 7

I have a computed field (field:length_of_stay) for calculate the difference between a starting date (field:date_of_admission) and the current date for content type 'Patient'. My Computed Code (PHP) in field settings is: `$field_date_of_admission = array_pop(field_get_items($entity_type, $entity,...
MS21
1

votes
1

answer
94

Views

Smart IP module - how to check what every country sees

Unfortunately i don't have too much experience with drupal so please feel free to ask for more information if needed and i will provide. I am using Drupal 7.34 and i have a module installed called Smart IP. I have different blocks which are shown depending on the users IP/Location/Language. For exa...
Antonios Tsimourtos
1

votes
4

answer
1.6k

Views

Drupal-8, Adding CSS to a custom Module

Updated I fixed the preprocess_html hook as adviced, and added a pic of the structure of the module, maybe is something wrong there?? I just created a custom module for drupal-8 that ad a customizable block. Very simple, is currently working but now i want to add some look to the content of the bloc...
Hawk
1

votes
0

answer
394

Views

Drupal 8 custom migration with source csv

How can I import fields into Drupal 8 user profile from a csv file that has identical values in the key row? I'm using Migrate Tools, Migrate Plus and Migrate Source CSV. My CSV file looks like that: 'Stg';'Color';'Fruit' 'user1';'red';'apple' 'user1';'blue';'pear' 'user2';'green';'banana' 'user2';...
Markus Zerres
1

votes
2

answer
98

Views

I'm needing some guidance on using OpenAPI (Swagger) with Drupal

I am new to Drupal but need to implement the OpenAPI (formally Swagger) to have it describe endpoints of the Drupal RESTful API. drupal/openapi has been installed with Composer but I can't find out how to load it in the browser as I can't find what the URL should be. Beyond that I was hoping to have...
Dubby
1

votes
1

answer
247

Views

Drupal 6 site migration issue in PHP 7.2

We have a web server with Ubuntu 12.04. we are running a drupal website in this server and we used PHP 5.3 on this server. As part of server migration, I am planning to up a new Ubuntu 16.04 server with latest PHP 7.2, After migrating above specified Drupal application into it, We are getting a whit...
Roni Baby
1

votes
0

answer
352

Views

Drupal 7 creating rest service through services module

Inspiring from http://valuebound.com/resources/blog/how-to-create-custom-web-services-for-drupal-7-0, I'm creating a rest api / webservice in D7. I installed required modules e.g. ctools, services, libraries, entity etc and created the content type 'Housing Scheme' as mentioned in the valuebound.com...
1

votes
1

answer
273

Views

How to create a button to start “Bootstrap Tour”?

I installed my next module 'D8: Bootstrap Tour' on my site 'Drupal 8' which uses the theme 'Bootstrap 3'. https://www.drupal.org/project/bs_tour http://bootstraptour.com/api/ Here is the contents of the file bs-tour.js of the module : (function ($, _, Drupal, drupalSettings) { 'use strict'; Drupal.b...
3cfe5693
1

votes
1

answer
498

Views

How to use multiple paragraph custom fields in twig field template in Drupal 8?

I have two fields in a custom paragraph type that I want to use together in a twig field template. I was able to access these properties from the page template, but from my understanding this is bad practice. {{ content.field_button_text[0] }} I was able to achieve this by using a pre-processor, bu...
dalper5
1

votes
1

answer
41

Views

drupal switch from 2 different menu

I have a drupal website with amp module. How i can make to switch 2 different menu, one for AMP version and one for normal version? I'm trying to put this expression: /*?amp but dosent work
Corallino
1

votes
4

answer
243

Views

As a beginner how should I start to learn and become an expert in Drupal development?

I am a PHP programmer. I am new to Drupal. I want to become a Drupal developer. Should I start learning version 7 or 8.
Deepa
0

votes
0

answer
3

Views

Need help adding sales tax to Drupal 8 ubercart. Module is not ready

The Drupal 8 Ubercart sales tax module is not working yet. I have a D8 site that is in desperate need of twig coding for this, even hard coding in the interim until the module is fully developed (it's been 3 years?). The sales tax would only apply if the order is delivered to one state (selected by...
user3038672
1

votes
0

answer
45

Views

How to navigate to last <input> tag in fieldset using Jquery in a Drupal View form

I am not a front-end developer and I have very limited exposure to JQuery JS etc. So any help is appreciated, thanks. Objective : - I want to put the sum of all fields (except last ) of a fieldset into last field of that fieldset. The form is rather complicated, in this form, there are multiple...
BhargavSushant
1

votes
1

answer
290

Views

Can't get custom block module to appear in “Place blocks” screen in Drupal 8

I am trying to write a custom block module in drupal 8 that will allow me to place this block into my drupal pages using the block layout screen. I'm very new to drupal - so this is very much a 'hello world' project (initially) to figure out how this works. To this end, I have been following youtub...
David Buddrige
1

votes
0

answer
26

Views

Draggable table: drupal_render, render, both yield an empty string for “#weight” types

I am attempting to implement a draggable table in a Drupal 7 module. Whenever I invoke either render() or drupal_render on my element of type #weight, an empty string is returned. The table does render and I am able to drag the rows, but cannot see the weights. I cannot figure out what I am doing wr...
David S.
1

votes
1

answer
403

Views

How can we access the fields of a paragraph in views which is referred by a field of a content type in Drupal 8

I have a content type whose one field refers to a paragraph. This paragraph is having title and description. I have given the option of adding as many paragraphs as they want in a content type. I am looking for an option to get all the titles of the created paragraphs in views in Drupal 8
user3651844
1

votes
0

answer
50

Views

Publicly expose a directory on Pantheon (Drupal 7)

I have a D7 site on Pantheon with a dir in sites/default/files that I want to make publicly accessible and navigable (you should be able to navigate the folder structure and files from within a web browser - no styling necessary). I've tried creating a module that displays the contents of the dir o...
kettultim
1

votes
0

answer
23

Views

Git Push Folder that was cloned from another site

Hi so I have a folder root, that has its own .git file in root, that pushes to my repository. This works when I git push, but it omits the sub-folder bootstrap that I have cloned from another site. I have tried to set the folder's remote to my repo, but to no avail git remote set-url origin MYURL. I...
ARMANDO SILVA
1

votes
0

answer
232

Views

cmder SSL verification - how to add to local store?

I am trying to install Drupal Vm via Cmder. When I run 'Vagrant up;' command I get the following error: Installing plugin vagrant-vbguest **ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR: You must add /C=US/ST=California/L=San Jose/O=Zscaler Inc./OU=Zsc...
Ramesh
1

votes
0

answer
95

Views

Map custom form fields to Contact form fields and submit programmatically

Drupal 8: I have created a custom form and a contact form with the same fields. I would like to map custom form fields to contact form fields and submit the contact form manually from the custom form submit handler. I am able to get the contact form entity in the custom form submit handler but not s...
Anurag
1

votes
1

answer
200

Views

Drupal forbidden 403

hye. I'm currently having some problem with drupal. Everything that I want to update/save is forbidden such as new content and update system settings. This message will appeared 'Forbidden. You don't have permission to access/on this server. Additionally, a forbidden error was encountered while tryi...
faeiz jaafar
1

votes
0

answer
587

Views

Drupal 8 custom module “theme hook not found”

I am building a custom module for Drupal 8.4.4 and is not detecting the hook_theme from a block. I get an error message saying 'Theme hook gardentheme not found'. If I uninstall the module and install it again, it works fine, but as soon as I clear the cache, it doesn't find the theme_hook anymore....
VictorCL
1

votes
1

answer
68

Views

I would like to ask about PHPUnit of Drupal 8

I created Block in Drupal 8 with a custom module. Is it possible to implement this with PHPUnit? If you can implement it please tell me how. I want to realize the test with PHPUnit below. I would be pleased if you could reply just whether it was possible or not. moduleNameBlock.php /** * @file * cre...
ピクルス芸人
1

votes
1

answer
466

Views

Uncaught Reference Error : JQuery is not Defined at drupal.js

When clearing the Drupal Cache it automatically enable/ checks the Compressed the cache pages options and breaks many drupal functionality. when i inspect i found that JQuery is not Defined at drupal.js at line 5 [jQuery.noconflict() ]. i find this error on all the pages of drupal. I am not sure wh...
1

votes
0

answer
31

Views

Issues submitting form on Drupal with docker

I have setup a Drupal website locally using Docker. The website loads correctly but I can't seem to pass the login form. I am redirected to the login screen without any error message. My local URL is http://127.0.0.1:8000 and I tried to set the base url and cookie domain values in my settings files...
victor cresson
1

votes
1

answer
394

Views

Override item-list.html.twig & time.html.twig inside a view

I've created a view that outputs a with a element in each . I need to convert the HTML list to a select. So I did 2 things: Copied item-list.html.twig and changed to a Copied time.html.twig and changed to Although this works I need those 2 templates to be scoped to my view named: 'vcon-selecti...
kevinius
1

votes
1

answer
509

Views

How to create notifications on the desktop web browser (chrome, firefox, …)?

NodeJS is installed on my server. I installed and configured the 4 modules below on my Drupal 8 site. When I see messages with 'Private Message Messenger', I receive 'jGrowl' notifications. https://www.drupal.org/project/private_message https://github.com/jez500/Private-Message-Messenger https://git...
8a05cfd0
1

votes
2

answer
98

Views

CSS/JavaScript/HTML Menu list with nested links

I have menu list in my page with following structure. When I click any link in the menu the system automatically add class='is-active' to the link. I set display of nested links to none so they will be visible only by clicking on parent link (see css). However, when I click on one of the child links...
Jakub89
1

votes
0

answer
26

Views

How to customize the menu collapse?

I have 2 menu collapse (one on the right and one on the left). In the following file it is recommended that: if collapse-first is open, collapse-second is closed if collapse-second is open, collapse-first is closed if form-sumit is clicked, collapse-first is closed if form-sumit is clicked, collapse...
8eb8a07c
1

votes
1

answer
404

Views

How to render two theme tables in single controller drupal 8

I want to render two tables on the same routing in Drupal 8. I tried to merge them but it always display the last table. I am trying to merge both the tables by array_merge. controller file: class AdminController extends ControllerBase { public function List() { $DefaultList = $this->DeafultList();...
user2527847
1

votes
1

answer
31

Views

theme_settings.php drupal default settings

Im trying to do a theme-settings.php and i have it as far as i can tell exactly the same as everything i have ever seen on any page tutorial about this... but some reason its not working.... which means im missing somethign stupid.. thinkrium.info name = Thinkrium description = Thinkrium theme. core...
thomedy

View additional questions