All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
31 views

How do I execute code when a module is installed or uninstalled?

Currently, I manually have to add terms one by one every time a module gets installed, and that's not efficient. I'm writing a simple module that needs to automatically install 2 terms every time the ...
0
votes
1answer
14 views

How to map Address field module sub fields (City, State, etc.) to specific (individual) fields in Salesforce?

Address module: https://www.drupal.org/project/address Usually Salesforce mapping doesn't allow to add Address module subfields in the mapping.
1
vote
0answers
31 views

When I clear cache, my menu ordering seems to go out of order

When I clear cache, especially on high traffic times, my menu seems to go out of ordering. Usually I don't see any log messages except for one time: Message Drupal\Core\Database\...
0
votes
0answers
20 views

How to optimize the Glyphicons font with font-display: swap? [closed]

I want to optimize the loading of the Glyphicons font for the Google PageSpeed Insights tool. I need to apply the CSS code below : font-display: swap Here is the location of my font : https://...
0
votes
0answers
11 views

Remove the first subdomain

I am building a custom module with Domain Access. When a user creates a domain, for example using myname.host.com, it will create newname.myname.host.com. I need only to get myname.host.com. This is ...
0
votes
0answers
20 views

Run AJAX cascaded

I am new here, just started to write a module. I am facing a issue to calculate a field and then calculate another field. Here in example, calculate amount in a line item, and on the field amount ...
0
votes
0answers
16 views

Failed opening required './sites/all/modules/ctools/includes/utility.inc'

Failed opening required './sites/all/modules/ctools/includes/utility.inc' But I find utility.inc file already exists in /sites/all/modules/ctools/includes/utility.inc This error always show up when ...
0
votes
0answers
17 views

Wordpress Migrate “unexpected error”

I am trying to import a Wordpress 5 XML export to a Drupal 8 site with Wordpress Migrate (version 8.x-3.0-alpha3). It seems to go well up to the "Execute" step, with the correct number of pages and ...
0
votes
1answer
30 views

Control Visibility of Paragraph Without Fields

I'm preprocessing a paragraph to add a custom form but I'm having trouble with the visibility. I don't need any fields on this paragraph. If I just add the form to the paragraph the whole paragraph ...
0
votes
1answer
16 views

How to get replacement pattern for Search API's fulltext search in global text area header

In Drupal 7, I'm currently using the default core search, and a view for node search results. I have a global text to pull in the replacement pattern for the term that were searched for. I get the ...
2
votes
1answer
59 views

Drupal in sub directory, still not clear

My drupal project is in directory /var/www/MY_ORGANIZATION/MY_PROJECT/current, and apache2 is configured to point the web subdirectory of the above location. When I access the site, it is of course ...
0
votes
0answers
32 views

Can I set form field disabled in Controller?

I can make form field disabled with hook_form_alter. But can I somehow set form field disabled in Controller? namespace Drupal\mymodule\Controller; use Drupal\Core\Controller\...
1
vote
2answers
58 views

How to change Taxonomy admin page title?

I simply need to change the title on the (Drupal 8.8.4) administrative page which lists the existing vocabularies. As far as I know/read, the routing.yml should be modified, shouldn't it? (Is only ...
0
votes
0answers
16 views

How can I populate and entity reference field/videos that have been previously migrated to the media library?

Upgrading from D7 to D8, we previously migrated D7 youtube and vimeo videos to the Drupal 8.8 core media library. We now are attempting to migrate the Video nodes and their media library video fields ...
0
votes
0answers
13 views

htaccess rule subdomain should load a specific page

Hi for a Drupal 7 i need to make a redirect only for a language www.website.com stays the same when accessing when accessing fr.website.com should load the www.website.com/fr/homepage can someone ...
1
vote
1answer
21 views

Views alter changes next row instead of current one

I have a view that is showing event content types. Users can apply for these events. I am using a hook to alter the 'view applicants' so I can show how many applications already excist. The ...
0
votes
0answers
25 views

High_contrast error after 8.4.4

After the 8.8.4 update I am getting the following error when I try to clear caches: Circular reference detected for service "theme_handler", path: "twig -> twig.loader.filesystem -> theme_handler ->...
0
votes
1answer
11 views

Unable to add images to content “Image field is required”

Developing a new site with Drupal 8, I was attempting to add an image to a custom block. In the editor I clicked the image icon and got a dialog to upload an image. After specifying a file (making ...
0
votes
2answers
37 views

How do I load entities with Null values?

The following fails with an exception. \Drupal::entityTypeManager()->getStorage('foo_module_division')->loadByProperties(['enabled'=>TRUE, 'parent_code'=> NULL]). How else do I specify I ...
0
votes
1answer
38 views

Create a cron job to automatically clear cache

I'm trying to clear cache automatically with a cron job but it didn't work. I'm debugging simply on the browser at this link website-url/cronjob.php. I think it's a problem with the syntax, I have ...
-1
votes
1answer
15 views

Is it possible to import content from external API? [closed]

I'm working on a new website and i have an external API that provides some content. I wonder if it is possible to import that content from the API using Migrate or custom module ? Note : The content ...
0
votes
0answers
9 views

Views Data Export - Exporting a Referenced Media Item's URL

I need to create an Export to CSV from a series of pieces of content. Each piece of content uses a media field that I am trying to reference. The rest of the fields export fine, but I am unable to ...
0
votes
1answer
26 views

Filter nodes by today's date

Following what described in Views filter criteria date field is greater than current date, I have used operator >= today with some success. I would like to create "future" nodes and they should be ...
0
votes
0answers
23 views

Composer dependencies issue

When trying to install juicebox which requires libraries, the dependencies do not result in a working configuration. This is because juicebox defines a version requirement in the .info file which is ...
-3
votes
0answers
23 views

Entity type does not exist [closed]

I am not able to solve this error and have been trying for days now. Please help? Drupal\Component\Plugin\Exception\PluginNotFoundException: The "brick" entity type does not exist. in Drupal\Core\...
0
votes
1answer
20 views

Use drush to install a module on all of the sites of a multisite at once

I have a Drupal 8 multisite, setup with 6 different sites. I want to install Admin Toolbar on all of them on my local dev environment (mamp / terminal / drush). I have downloaded that module using ...
0
votes
0answers
11 views

How to separate the user profile picture upload from the base form in Pages?

I have enabled the user_edit form in Page Manager and added my account fields but the username, password, time zone, language and picture settings always stay in the base form. How can I separate ...
0
votes
1answer
16 views

PHP query in a view will cause website error

I'm using a global PHP query in a View to find out the count of membership users. The first query, that extracts the total number of users from the database works fine, but when I use the WHERE clause ...
0
votes
1answer
36 views

How to restrict access to view a block for a certain role? [duplicate]

I have some custom roles such as Premium Membership and I don't want to allow access to this category. The authenticated role is included to Premium Membership or Moderator users because every ...
1
vote
1answer
33 views

Date picker libraries are missing in specific page

I am adding jquery date picker feature using date field in profile edit page it is working fine . But when i am adding same jquery datepicker in custom module, datepicker function is not working. ...
0
votes
1answer
32 views

How do I resolve a unresolved dependency error after using Composer to install modules?

I'm going to pull my hair out if I stare at this problem any longer. I've seen the similar questions and tried everything but I can't fix this issue with module dependency versions. I'm using ...
0
votes
1answer
22 views

How do I programmatically “place” an order?

When making a payment through the Commerce admin interface; the Orders do not get completed. I can see a Place Order button when viewing a cart Order; which seems to do the trick. I need to do this in ...
-3
votes
1answer
143 views

How to implement markdown tables in Drupal? [closed]

In my GitHub account, I have this markdown file which is a table of at least two columns in which the first column is of a base language and the second (or later) is of a new language to which I ...
0
votes
0answers
17 views

unknown Ajax call on custom views_exposed_filters while changing dropdown list

I have two exposed filters as select fields (County and District) using Hook_form_ID_alter. I'd like to alter the #options of District base on the County I selected to display related options. But ...
0
votes
0answers
35 views

How can I limit access to the text format drop down in a paragraph? [duplicate]

I'm trying to limit the access for users to change the value of text format dropdown but I can't seem to find the correct dropdown to alter. Here's what I have so far but it seems to disable access to ...
0
votes
1answer
26 views

Impossible to html_entity_decode the button title in a render array

Here is the code that reside in my extended class of the RegisterForm: $title=$this->t("M'inscrire") // notice the apostrophe in French // the $element variable is the action sub array of the form ...
0
votes
0answers
37 views

I cannot configure the site during installation

I have installed MAMP and Drupal 8 into my windows 10 machine. I can successfully setup database and installed modules but while setting up site, i am getting below error. Call to a member ...
0
votes
1answer
34 views

Pre-populate an entity reference field (media image) when creating a node

I am trying to open a node creation form (for example, /node/add/article) and to have an Entity Reference field pre-populated. My field (field_image) is an Entity Reference to a Media of type Image ...
0
votes
0answers
34 views

Is a block render array built with EntityViewBuilderInterface::view supposed to render full block template or only inner fields?

After rendering custom blocks in templates, I got this js error: Quick Edit could not associate the rendered entity field markup. What I've done so far : In order to render repeatedly custom blocks ...
0
votes
1answer
38 views

Deactivate system path

I want to deactivate the system path which comes with Drupal. I've installed the pathauto, so when I create a new page, it automatically changes domain.com/node/12 to domain.com/books/jacks-journey ...
-1
votes
0answers
22 views

How to redirect 404 error to specific page?

How to redirect on website.com/articles/ when for example this url website.com/article/bla-bla-bla return error 404 ? Thank you.
0
votes
1answer
31 views

How to embed HTML and CSS in a custom form element?

This worked in Drupal 7 but isn't in Drupal 8. $form['covid-19'] = array( '#markup' => '<div style="border: 2px solid red;padding:10px;margin-bottom:10px;"><strong>Due to the COVID-...
0
votes
0answers
26 views

Getting site ID from module (vs theme)

I have the following code in my custom theme that works well and allows me to test against the multisite_id in my twig files: function mytheme_preprocess_page(&$variables) { $site_path = \...
0
votes
1answer
30 views

Sub-theme adding prefix to all block machine names

On my site, I have created a sub-theme of a sub-theme using this as a guide to set this up https://www.drupal.org/docs/8/theming-drupal-8/creating-a-drupal-8-sub-theme-or-sub-theme-of-sub-theme and it ...
0
votes
1answer
19 views

Upgrading to Drupal 8, custom theme not using referenced CSS file [closed]

I am upgrading a theme from Drupal 7 to Drupal 8. I reference .css files in mytheme.library.yml that do not seem to be getting pulled into the site. I've looked online and even copied sample coding ...
0
votes
0answers
34 views

Print a taxonomy term and url D8 views template

I am totally new to drupal 8. I have used d7 and i am migrating now. I have setup a view with 4 articles. I have managed to print out in a custom views theme my title image url {% for row in ...
0
votes
1answer
26 views

Alter a path alias depending on a node property

I use the Pathauto module and I'm trying to get, for the same content type, two different path aliases depending on a Boolean field that content type has. I would like to have a path alias like ...
0
votes
1answer
22 views

How to save values on each form submit without overriding saved datas?

i am having a form with 2 values to save on submit: public function submitForm(array &$form, FormStateInterface $form_state) { if ($_POST['op'] == 'Import Accounts') { $filter = $...
0
votes
0answers
11 views

How Advagg build their advagg_get_js and called the advagg_js_pre_render [duplicate]

I have done a bit of research in Advagg , I dont understand how they override the drupal_get_js and implemented their advagg_get_js and from there invoked advagg_pre_render_scripts which overrides ...
0
votes
0answers
11 views

Contextual filter for month and day

I have created a block that lists all the users () that are years old that same day. The problem is that when I want to add a contextual filter that compares the birth_date field with the current ...

15 30 50 per page