All Questions

2
votes
1answer
361 views

Create Ubercart Product Node - how do I set product image?

When creating a product node for Ubercart, how do I set the product image? In the code below you see the creation of a Ubercart product node: $node = new stdClass(); $node->name = "Title"; $...
0
votes
0answers
6 views

Creating menu tabs in a child page

I have a suite of modules that go together, and they are all ideally housed under one parent item on the 'management' menu. The normal pages of these modules are correctly being placed under this ...
1
vote
2answers
370 views

Uploaded images deleted on save in Drupal

A certain content-type in my installation does not save images in it's gallery anymore. The image is being uploaded, registered in file_managed with status 0, and stored in sites/default/files. On ...
0
votes
0answers
3 views

Using Webform on Taxonomy Page and using that Term's Values

Say I have a Vocabulary called Branches which has an email field. I wanted to attach a Contact webform to the pages of these Branches where an email will be sent directly to the email field value for ...
1
vote
1answer
417 views

Using computed field to calculate total hours for a datetime field but to exclude all weekend hours

Please please if can anyone help I would really appreciate it! I have managed to get total hours between value 1 and value 2 of my datetime field however I really want to exclude any hours which are ...
0
votes
0answers
6 views

Image alt tag not saving on save/edit

I have a content type for gallery photos which has a Image data type. When I create the content type Drupal ignores the alternate text I enter for any uploaded image. When I edit the content type ...
0
votes
0answers
16 views

How to update a uuid() programmatically for a Paragraph

I am trying to update the uuid for a paragraph that is referenced on a page. In my custom module I have loaded all nodes using entity query below and loaded the referenced paragraph. $nids = \Drupal:...
0
votes
0answers
7 views

Create a patch for Drupal core.libraries.yml

I noticed that core/jquery.cookie is referencing the jquery-cookie v1.4.1 library that is now no longer maintained. It is being superseded by js-cookie and so I would like to write a Drupal core patch ...
20
votes
5answers
20k views

Iterate through multiple value content field in Twig template

I need to take control over the rendering of a field_admin_tags field in a node.html.twig template. This WORKS: {{ content.field_admin_tags }} — Renders everything (label + all field values) {{ ...
0
votes
0answers
8 views

Where are the My Drafts and Needs Reviews tabs in Drupal 8?

I am experimenting in simplytest.me to see if Drupal will suit our needs. I have been testing the workbench moderation module to get the work flow that will be required (content editors and then ...
0
votes
1answer
359 views

Display blocked users to anonymous

How can I display blocked users in a template file? I have an Entity Reference field that I'd like to use to show anonymous users any blocked or active users added to the Entity Reference field. Is ...
0
votes
0answers
12 views

How to ignore opening quote in views sort

I use views to display a sorted list of book titles. Titles that begin with a quote are listed first. I want to ignore the quote for sorting purposes. So, instead of: "Once Upon a Time": Fairy Tales ...
1
vote
1answer
370 views

Security issues while using external javascript and php files to access mysql database in drupal nodes

I have created a search_interface node which asks for filters and onClick event of the submit button, I have called an external search.js script. My search_interface node is of a custom content type ...
0
votes
0answers
5 views

Drupal 8 webform translated. Block on page selected/listed not showing up

Drupal 8! Webform module! I have made a drupal webform and added it to my webpage with creating a block. The block is restricted to the page by url. Everything worked well with this method. With ...
0
votes
1answer
28 views

Core doesn't update with Composer

We use commands: composer outdated drupal/* drupal/core 8.6.10 8.6.13 Drupal is an open source content management platform powering millions of websites and applications. It does show 8.6.13. We ...
0
votes
0answers
11 views

Disable IP checking for development

wondering what the recommended method would be to disable IP checking on a Drupal 8 site with Commerce 2. This would be for development purposes only to allow different test scenarios for cart ...
-1
votes
0answers
21 views

Drupal Console vs. Drush for Drupal 9

Are there advantages to using Drupal Console instead of Drush because of Drupal 9?
0
votes
4answers
39 views

Master list of contrib modules?

Does there exist an updated master list of contrib modules in some easily parsed format (csv, json, xml ... whatever) that I can use for quick reference to see active full projects (not sandbox)? I'...
0
votes
0answers
14 views

Behat @javascript test can not login user - incorrect username or password message

I am running: Drupal 7 Behat 3.5.0 Selenium 3.5.0 Chrome Driver 73.x Using this test: Feature: User Profile Background: Given users: | name | status | roles | | incomplete | 1 | ...
0
votes
1answer
360 views

Setting up masonry and views

I am trying to get masonry https://drupal.org/project/masonry to work with views on Drupal 7 but I keep getting a list view instead of the expected mason grid. and no error on my status report page....
23
votes
1answer
24k views

Get the route name of the current page

The route name of the current page is available in page.html.twig? The page is generated by the default feedback form.
0
votes
1answer
371 views

How to get the parent comments (in a custom module)?

I'm writing a module that uses flag to handle notifications, and one of the options is to be notified of replies to a given comment. I can implement without problem hook_comment_publish($comment), ...
12
votes
5answers
10k views

Add Fields to Field Group programatically

I have used "Field Group" module and created some groups in backend. Now i want to programatically add a field to the group. How can I do that. I am using Hook_form_alter, I have noticed that every ...
-1
votes
0answers
5 views

How to add a class to #edit-sort-bef-combine-wrapper in better exposed filters?

I would like to add css classes for the wrapper for bootstrap theming (something like col-lg-3 col-md-3 col-sm-4). I prefer to do it in the server-side rather than using javascript. How can I ...
-1
votes
0answers
7 views

How to configure simplenews to send HTML newsletters by email?

I'm using Drupal 8, simplenews module, and would like to send newsletters monthly in HTML format. The problem is that i tried to configure mimemail, htmlmail, and swiftmailer, all to HTML format, but ...
-1
votes
0answers
15 views

Testing content types on a site without having to create nodes

I have a bunch of Drupal sites on Drupal 8. My task is to test as a support admin of the site to check if the creation of nodes is possible. And if possible to actually create the nodes to prove it by ...
2
votes
0answers
28 views

I cannot translate the action label

I'm using Umami profile and choose Spanish is default language. Almost of the interface has been translated into Spanish. But some places did not translate like user page. I'm going to admin/config/...
0
votes
0answers
12 views

View filter if field contains a value?

I'm trying to filter my view based on data in a single field. My field targetuser contains a string of numbers: 47, 505, 100, 20. I'm trying to setup the view so that if targetuser contains the ...
1
vote
1answer
377 views

On View Rewrite Results I don't see additional options like Add Read More button when checked “Trim this field to a maximum length”

Can anyone help me? Because earlier this options were displayed when I checked "Trim this field to a maximum length". May be it depends on some settings? I can't upload image to show you what I mean. ...
0
votes
1answer
9 views

View that shows all children content of parent

Been searching and cannot find this anywhere for Drupal 8. Very basic view request, can't figure out why it's not straightforward. I want a View that shows Parent content and under it all Children ...
2
votes
2answers
401 views

Using Zurb Foundation without installing the required dependencies: npm, gulp, bower, etc

I just created a sub theme for zurb foundation 6 on drupal 8, and reading the docs it tells me to do a npm install and a npm bower When doing a npm install I get the following errors: I fixed that ...
0
votes
1answer
367 views

Migration Issue: New Site won't open — server doesn't see file that is there

I am migrating a Drupal site from my localhost to the most current Bitnami Drupal AMI on Amazon: I uploaded the DB successfully. I moved the files correctly. I copied over the modules and libraries. ...
0
votes
1answer
59 views

Unlimited Custom Form Fields - Without Ajax

I have a simple form where users can set the number of fields they need. Users may need 100+ fields so I am not using ajax "add more" options. With the below code, everything works (Even though you ...
0
votes
2answers
373 views

How to hide field if blank

I have a view created which has a column 'Price'. I also I have another column 'Special Price' in the same view, but 'exclude from display' is selected. In views, click the price field > rewrite ...
0
votes
0answers
11 views

Redirect old URL to new URL via htaccess with path

I am using HTTPS and WWW only rules in Drupal 7's .htaccess like: RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # ensure https RewriteCond %{...
0
votes
0answers
14 views

Result should return a value greater than or equal to the selected facet

Here is the scenario. I have created a facet which list all GPA's (these are decimal numbers). e.g. 2.0, 2.5, 3, 3.5 etc. What I wanted is when say a user choose 2.5 GPA from the facet, the returned ...
0
votes
2answers
375 views

Is hook_node_view() invoked every time?

I wrote a custom module that records page views. So each time a user views a node, it creates an entry in a database table. Essentially I wanted my own custom statistics module. The problem is, it's ...
0
votes
1answer
46 views

Why does updating break my site?

I have a site running Drupal 8.6.10. I installed it with Composer: composer create-project drupal-composer/drupal-project:8.x-dev JdP8M7b --stability dev --no-interaction I tried to update it to 8.6....
0
votes
0answers
17 views

How do I retrieve media from a reference field?

Inside a node type, I have a reference field to target a media. With a db select, I need to load all related medias of the nodes. For this I use this code: $database = \Drupal::database(); $result = ...
0
votes
0answers
18 views

Custom handler isn't displayed in the handler list on the development server

Webform custom handler is not showing in DEV server but it works in local.It makes very difficult to save additional information. namespace Drupal\demo_module_dym\Plugin\WebFormHandler; use Drupal\...
0
votes
1answer
36 views

Get an Un-submitted/Active Form Field Value in $form_state?

I am unsure how to get unsubmitted/active form field values from a number/textfield into $form_state. field_count could be saved as 4, then is changed to 115, how do I pass that change to $form_state ...
-3
votes
0answers
23 views

How do I change header and footer based on URL?

I have a custom header and footer for the front page. I would like to change them for some pages. For example, initially I have the image a.png in the header; after clicking the entry form, the ...
0
votes
1answer
367 views

CKEditor adds inline nonsense

I'm hoping someone else has run into this and has a solution: I have the CKEditor module (v. 7.x-1.13) installed using ckeditor.js version 4.01 (due to compatibility with Media module). The problem I ...
2
votes
3answers
6k views

How can I get the URL to the public files directory?

I can get the path to the public files directory by using Filesystem::realpath: $path = $filesystem->realpath('public://'); But how can I get the URL of public://?
0
votes
2answers
3k views

How can I create a custom calculator on a drupal site? [on hold]

What I want to do is have a page that collects a few pieces of information from the user and then calculates a result of a formula. I do not want to store the information at all, and was thinking I ...
0
votes
0answers
15 views

Render search form data [duplicate]

I need to show type of search(article or search page, please refer screenshot) in breadcrumb on search results page. How to render type of search selected by user (article or basic page)?
10
votes
2answers
7k views

How to get the url of a file field of a given node?

$node->field_file gives me a FileFieldItemList while the first entry seems to be a FileItem. $node->field_file->getValue() gives me an integer (I guess the file id). How can I actually get ...
0
votes
1answer
96 views

Get a views results programatically

I have a page with a view on it and some exposed inputs. I need to get the results programatically. I can load a view programmatically no problem but setting the exposed input has not been working. $...
0
votes
1answer
372 views

How to change bean's block view mode programmatically?

I have created a block entity using bean module. It has three image fields. Image1, Image2 and Image3. I want to show only one image depending upon current time. I have three time values. For this I ...
2
votes
3answers
3k views

How to get one time login for all the users?

I want to send one time login for all the users, So I am using drush uli and getting link like: http://html/user/reset/1/1509979615/VBPx_FMfKeJUEt1moVcsSQGUMX_tFUSYEdEfRlmq7eA So if the user 5 ...

15 30 50 per page