Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [8]

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

0
votes
1answer
17 views

View listing page/block relationship configuration

I have a Part-Time Course content type that holds information about whatever course that needs to be added to the site. I then have a Part-Time Course Offerings content type that has two fields. ...
0
votes
1answer
43 views

Get the node ID value after submitting an attached Webform to that node

I have a Webform attached as a field to a specific content type. After the node is loaded and the Webform is submitted, I am using the below custom webform handler to get the $webform_submission ...
0
votes
0answers
39 views

Why is composer trying to install the Drupal 8.2.x-dev branch?

UPDATE: I am not going to continue to troubleshoot this. Composer is working OK in my local site, so I'm going to change my approach to deployment and stop running composer in my staging site. ...
1
vote
1answer
38 views

Why is file_managed not updated correctly?

In a custom module (amap), I have a custom content entity (contract) created with Drupal Console. There are standard CRUD functions on this entity. One of the fields of the entity is a file field: $...
-3
votes
0answers
44 views

Non-existent service causing fatal error [closed]

When drupal crash and try to display a fatal error, there is no indentation and there is a fatal PHP error displayed, making it really hard to read. for example I got this last day, on a white page :...
-3
votes
0answers
24 views

Webform as a job application

I have created a career page so that an applicant can view job opportunities. Now I want to when an applicant click apply button a webform should appear in the same page as a scroll up. How can I code ...
0
votes
2answers
49 views

Where can we store 3rd party application passwords?

I've written a Drupal 8 custom module that communicates with 3rd party APIs which need authentication. I have an application username and password for those APIs which I need to store somewhere. I can ...
0
votes
0answers
21 views

How to prevent running “updb” twice for upgrading Media

I'm upgrading my custom media modules to use the "core media" in Drupal 8.4.8 I have to run the command "drush [sitename] updb" twice in order to recognise my custom media modules code has been ...
1
vote
0answers
34 views

Running functional tests on a non-English site

When creating functional tests (extending BrowserTestBase) for a D8 site, how would I go about changing the default language of the site being temporarily created by BrowserTestBase? I'm trying to ...
0
votes
0answers
27 views

Grant file access to file downloads

I am able to sell a file using Ubercart Drupal 8 module. However, file download permissions are not granted to the user purchasing the file. Do we have a Rule in place for this? How can I achieve ...
0
votes
1answer
23 views

What do I need to pass to the Image class as the first parameter?

I'd like to use the Image API directly to perform few simple operations with images (I'm aware of image styles and for various reasons I would prefer to not use image styles for the application I'm ...
0
votes
1answer
31 views

Where do extra parameters come from?

Not a real issue but more of an informative question. Concrete case: system.routing.yml integrates system.entity_autocomplete that uses controller::method \Drupal\system\Controller\...
0
votes
1answer
20 views

How can I programmatically add CiviCRM contacts as Drupal users?

In the process of migrating a Drupal 6 and CiviCRM installation to Drupal 8, the decision was made to host the new D8 CiviCRM instance remotely. I'm now tasked with developing the functionality needed ...
0
votes
1answer
18 views

Installation ownership

I am starting my Drupal 8 website, using a LAMP stack and AWS. I had tested my server and made sure PHP and MySQL are working. When I install Drupal 8 through composer it is successful. However, when ...
-1
votes
1answer
38 views

How to alter response headers from module hook

I am puzzled how to alter the response headers from specific hook (hook_file_download)? /** * Implements hook_file_download(). */ function example_file_download($uri) { $scheme = FileSystem::...
0
votes
1answer
42 views

Programmatically using values from a loaded entity inside a message

I am using Firebase module to send push notifications to a specific mobile user when a webform is submitted. Below is my custom webform handler: <?php namespace Drupal\my_custom_module\Plugin\...
1
vote
0answers
21 views

Redirect Page on Change of Exposed Filter

We have an All Articles view that is added to the http://www.example.com/articles page that is supposed to display all pages where content type is Article. The content type has a taxonomy term, ...
0
votes
1answer
18 views

How do I index all the content with the search_api module?

I am using the Search API module with Search API Solr. When I visit my index page at http://example.com/admin/config/search/search-api/index/my-example-index, I see the "Index Now" button is disabled ...
-1
votes
0answers
19 views

Iterating with key in Class Name over Content

I'm attempting to iterate over 4 pieces of content in a content type in the Twig file. I've got as far as below but it's throwing an error saying Warning: A non-numeric value encountered in ...
0
votes
1answer
10 views

Issues with view preview

I'm having an issue when creating a new view. The preview pane, upon refreshing/updating" will, instead of updating in the preview section, force the window to navigate to "admin/structure/views/view/...
0
votes
0answers
9 views

Local task in user page to add content of specific type

i've a content type called job, i want to show a local task as a tab on user page to simply let him adding a content from there. I've created the MYMODULE.links.task.yml file in my module with this ...
0
votes
0answers
11 views

Geofield Map + Location search + Distance calculation

I'm having issues with Geofield Map module. I've created content-type view, which is displayed through Geofield Map as map. I need to add a ability to search on this map by entering location/ ...
0
votes
1answer
38 views

How do I enable and weight fields through .yml?

I have a custom module where I succesfully created a field for videos. But I want the field to be enabled and weighted on by default. I supposed active and widget->weigth and display->weight was the ...
0
votes
1answer
34 views

How to add query parameters in twig using path()?

I am following the code snippet provided here {# Link to frontpage view. #} <a href="{{ path('view.frontpage.page_1') }}">{{ 'View all content'|t }}</a> {# Link to user entity/profile ...
0
votes
0answers
36 views

Watchdog table growing out of control

I have seen similar questions to this before but they do not solve my problem. This is Drupal 8. Today the watchdog table on one of our sites exploded to 12GB in size. No other table in the DB is ...
0
votes
0answers
17 views

How to restrict dates in the form widget?

I am attempting an upgrade and I am looking for something that mirrors the functionality of the Date Restrictions module Basically, I used it to set relative limits,, something like no earlier than ...
1
vote
1answer
20 views

Print Preprocessed username Field Value in User Template

$account->getDisplayName() Bypasses "username" Field Preprocessing in User Template? I am trying to print the value of the username field of the user account in a user--custom.html.twig file. ...
1
vote
1answer
42 views

Set site URI for drush uli without 'default'

Versions discussed: Drupal 8.6.13, Drush 9.6.1. This is somewhat similar to How to have an environment specific drush.yml? except that the other thread is now four or five months out-of-date and ...
-1
votes
0answers
43 views

Why doesn't entity ID appears in hook_entity_insert?

In a custom module (amap), I have a custom content entity (contract) with standard CRUD functions. In the corresponding module, i have this code: function amap_entity_insert(EntityInterface $entity)...
0
votes
0answers
16 views

How do I put back de CKE image dialog box?

On Drupal 8, I can't find the image dialog box I used to have on Drupal 7. I read this is a core issue, but my contributors are used to it and have a different level of expertise. This little dialog ...
3
votes
1answer
48 views

Disabling Page Cache for Redirect Response

I've implemented a conditional redirect on my site via an event subscriber and returning a redirect response. It's working but, I believe due to the page_cache module is getting cached for anonymous ...
0
votes
1answer
25 views

Create Text Field Programmatically to Media Type

I want to create a text field to videos with code. I have the following in the .install file in a custom module: function video_update_8101() { $field_name = 'field_video_alternative_text'; // ...
4
votes
1answer
112 views

What is the difference between \Drupal::request()->getSession() and \Drupal::service('user.private_tempstore')?

As the title suggests, I'm a bit confused about those two methods of creating and accessing a session on Drupal 8. I'm not quite sure when to use the one over the other, could someone point me to the ...
0
votes
0answers
16 views

Custom user registration with entity relationships

I need to build a user data structure that includes child entities. I've got a custom module that defines a child entity to the user object. When i add the entity reference to the user in the CMS ...
1
vote
1answer
48 views

Revert back to the previous dev version of a module using composer

Current last dev release of the Field Group module for drupal 8 was out on (29 Mar 2019). However, I need to download the previous dev version before the dev version release mentioned above. The last ...
1
vote
1answer
64 views

Upgrade error: Attempt to create a field body that does not exist on entity type node

I am struggling with Drupal 8 upgrade for a months now. The Travis CI build is always failed with below errors. I'm upgrading from Drupal 8.3.7 to 8.4.8 with Lightning (2.2.9), BLT 8.9.7, Drush ...
1
vote
1answer
20 views

Problem in dependency injection in drupal custom module service

I face with a problem in defining service in drupal 8.0 my service is : services: tracking.middleware: class: Drupal\mkt_tracking_v2\Middleware\TrackingMiddleware arguments: ['@kernel','@...
0
votes
1answer
27 views

Cannot configure the site as SAML SP with simplesamlphp_auth

I have a functioning SAML IdP, implemented with LemonLDAP::NG. I know it functions because it works with Nextcloud as an SP. I've also successfully configured a DokuWiki SP in the past. The IdP, the ...
0
votes
1answer
19 views

Get paths of all open webforms

I have a project to QA all of our open webforms. We have about two screens (using the default pager) of open webforms. The simple-but-hard way is to copy each link, but I wonder if there is an ...
3
votes
1answer
40 views

how to prevent javascript from running again when an AJAX form is submitted

I have this code in a javascript file to hide some search filters... $('#views-exposed-form-faceted-search-page .form-type-select').once().hide(); The user can toggle the visibility of the filters ...
0
votes
0answers
34 views

Drupal Black Box of Death

Does anyone know what it means when drupal appears to fail but displays this black box in the browser?
0
votes
0answers
22 views

Replace select options

I have a form: public function buildForm(array $form, FormStateInterface $form_state) { // Disable caching on this form. $form_state->setCached(FALSE); $scheme_data; // code to ...
0
votes
0answers
28 views

Generating URLs with fromUri and the language prefix, base vs internal

What is the recommended way to generate non-route URLs that include the language prefix? Context: In CiviCRM, an open source third-party project that integrates with Drupal, we have a function that ...
0
votes
0answers
43 views

Sessions in twig with cache

I know this generally has been asked a few times before. I've gone through all those questions and answers multiple times and tried several suggested solutions. So I try to ask this again with my ...
0
votes
1answer
25 views

How do I access the configuration variables present in settings.php through my code? [duplicate]

I want to access the variables present in the settings.php in my custom module. For example, if the settings.php file contains the $config['test']['uid'] = 'ABC'; line, I want to access the content of ...
1
vote
2answers
17 views

How to print link text in twig?

I've attached file to a node with Media module. I have custom templates/file/file-link.html.twig file, which is rendering the download link with {{ link }} tag. {{ devel_dump(link) }} outputs this: ...
1
vote
1answer
27 views

How do I join across two different databases?

I have two databases, the normal drupal db and another db to another system. I want to join two tables from these two different dbs. I have already set up the second database using information from ...
-1
votes
0answers
29 views

How do I create a modal dialog which is draggable and resizable?

I have a simple dialog that comes up from a Drupal 8 link created as follows. I want it to be draggable and resizable. $content .= "<h4><a class='use-ajax' data-dialog-options='{&...
0
votes
1answer
21 views

add link to edit content in admin top bar

I'm theming a web site that I haven’t created and I‘ve noticed this useful link placed in admin top bar (see screen shot) : It provides link to edit / delete content. How can I place this link on ...
0
votes
0answers
42 views

How to disable browser autocomplete for the login form

I would like to remove auto fill user name and password while login or forgot password. I have tried this but its not working: if ($form_id == 'user-login-form') { $form['name']['#attributes']['...