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.

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

Entity query for distinct field

I have an entity line_item with the following fields: id uid (entity reference) product (entity reference) ... I would like to get all distinct products (product ids) for a specific user. I tried ...
0
votes
2answers
917 views

How to wrap another stream wrapper within stream wrapper service?

I am trying to integrate some stream wrappers from Gaufrette into Drupal. I was able to make an amazon S3 wrapper before by providing tagged service and extending the official Amazon S3 stream ...
0
votes
1answer
34 views

Access table form field's data from submitForm

I'm building a custom form and it display well. My form has a table type field which I can't manage to access from the submitForm method. public function buildForm(array $form, FormStateInterface $...
0
votes
1answer
27 views

Drupal.behaviors js code executes mutiple times (depends on active modules)

I have two almost similar websites (one was a test project) and second one is more like final version. On both of them i have quite simple custom module with js and on first web site it works fine, ...
0
votes
0answers
105 views

Instructions for custom panels content types

I want to port a website from D7 to D8 that is based on panopoly and makes heavy use of custom ctools content type plugins as well as dynamic argument handling. I didn't find much useful information ...
1
vote
0answers
28 views

Where to describe a State API variable?

We can describe the configuration variables in the *.schema.yml files but there is a place to describe the State API variables? I searched in the Core for some State variables and I don't find a ...
-1
votes
2answers
2k views

Show total search result count

I'm trying to display the number of total search results on my search results page, using the core search module. I've tried manipulating item-list.html.twig and item-list--search-results.html.twig by ...
0
votes
0answers
32 views

How can I create a patch for a contrib module or core which is not in version control?

Because we use a devOps system that installs packages on the server via Composer, my core drupal installation and contrib modules are not in version control (Git). I used to patch modules as follows:...
0
votes
0answers
26 views

How can I theme the login form?

I new in Drupal 8 and I have an a problem, i want to change de look of my user_login_form, reading about that i knew that i could use the hook_form_alter for my purpose but I can't access the form ...
-1
votes
1answer
45 views

Why would a page created by a custom module work in my DEV environment, but produce a 404 on the live server?

I have a custom module that's creating feeds of my content for me. It's been running fine up until now. Existing feeds work, and the new feed I just added works on my development site on my local mac. ...
0
votes
0answers
380 views

How come my view block is not loading using ajax?

We have a view, myview, that has an exposed filter title (text input). The view has Exposed form in block:Yes and so we load it onto the page under admin/structure/block. The block has a machine name ...
-2
votes
0answers
25 views

Documentation View

I am looking to create a document/node library on my Drupal 8 site that looks a bit like this: https://docs.devexpress.com/WindowsForms/114561/controls-and-libraries/forms-and-user-controls It is for ...
1
vote
3answers
244 views

How to unset the title of a custom form field

I'm trying to unset the label of a custom form called email. In which the value is in the #title key. I've tried {{ value|without('title', 'description', 'email.#title') }} But it is not working
0
votes
0answers
17 views

Views date range filter adds weird condition

I have a view for a content type. This content type has a date field (only date) and I have added and exposed a filter for this field ("date is between" option). I have added and exposed a filter for ...
1
vote
1answer
25 views

Looking for a Menu Module on Node Page [closed]

Out site has many, many nodes included in a number of menus. When creating a node, the Parent Item select box under Menu Settings is quite long. Is there a module that provides a better, more usable ...
0
votes
1answer
40 views

How to modify default login page using theme?

Version: Drupal 8.7.x Currently, I am using a subtheme of the Bootstrap theme and I want to override the default login page because the interface doesn't look good. I was hoping to override the ...
0
votes
4answers
2k views

Why is the index.php file missing?

I installed Drupal via the following command. composer create-project drupal-composer/drupal-project:8.x-dev projectfolder --stability dev --no-interaction As a result I'm getting this structure. ...
0
votes
1answer
44 views

Using REST to create user with CAS username

I would like my CAS server to POST an account to my client site when a new user registers. My CAS server is using D7, clients are using D8. Using the entity/user endpoint I can create a new user, ...
0
votes
1answer
427 views

Programmatically adding line items to Ubercart order

Can someone please suggest how do we add line items to an Ubercart order in Drupal 8? When I look at the references in Ubercart module, I get this: // Load line items... has to be last after ...
0
votes
1answer
1k views

Views breadcrumb

I need to have breadcrumb builder that will make all "News" nodes appear as breadcrumb children of a View we've created at /news I did follow this post : Add a breadcrumb to a view page? But it ...
3
votes
0answers
314 views

How to fix the core.extension.module list when the currently active profile has been added to it by the system?

Following the 8.6 upgrade, several of our sites have developed a strange problem. The currently active profile, let's call it foo_profile, is now also listed as a module in config (core.extension....
1
vote
1answer
32 views

How to install multiple modules with composer at once? [closed]

Let's say we need to install these 2 modules : composer require 'drupal/redirect:^1.4' composer require 'drupal/pathauto:^1.4' I couldn't find the correct syntax so I've tried this but it doesn't ...
0
votes
0answers
32 views

How can I get the metatag_config site name by consulting my db with php?

I want to obtain the metatag_config data through a mysql query with php from my db drupal, in order to obtain the site name, description, keywords and abtract. How can I do it? Or where they are ...
2
votes
1answer
999 views

Defining module.links.action.yml with route parameters

How can I pass dynamically route parameters to module.links.action.yml? My code of module.links.action.yml: module.group_apply: route_name: module.group_apply title: 'Subscribe to group' ...
0
votes
0answers
37 views

Reloading a block by Ajax

Version: Drupal 8.7.x I have created a sticky notes block, which takes notes and is also able to delete then asynchronously. The problem is that the block which displays the notes is static. I have ...
0
votes
2answers
714 views

Disable block caching

I just made a simlple block by using block > custom block, so I didn't make it programmatically. I am a Drupal 8 newbie, and I look for a simple and clear solution how to disable caching for that ...
-1
votes
1answer
36 views

Create a simple download link using twig

I want to create a simple download link on twig using Drupal8 but as easy as it can seems, I didn't find anything that was matching for me, it will always be the same file to download, it will be ...
0
votes
1answer
15 views

Sub tabs similar to Media library

I am trying to replicate the user interface Media library provides in 8.8. I've created a view with 2 displays: View 1: Menu tab where Parent is "Content" /admin/content/media-image View 2: /...
1
vote
1answer
28 views

Fetching node field values programmatically

I have figured out how to query the node table programmatically without using the deprecated db_query() function. However, I soon discovered that the actual content fields are not held in the node ...
0
votes
1answer
25 views

Programatically get the webform submission “sid” on submitForm

I am trying to programatically get the webform submission sid on submitting a webform but failed to get it ! On my customwebformhandler.php file i have the below: public function submitForm(array &...
0
votes
0answers
20 views

“Views Contextual Filters OR” only works for logged in users

I'm building a Drupal 8 commerce page and have a view to show content related to taxonomy terms of multiple vocabularies. Unfortunately there's no contextual filter "has taxonomy term id" like for ...
0
votes
1answer
924 views

Redirect to a page in a modal

I have follow this tutorial to make a modal: http://www.mediacurrent.com/blog/loading-and-rendering-modal-forms-drupal-8 But when the submitModalFormAjax method is called I want redirect the user to ...
0
votes
1answer
25 views

How to Determine a View Row's Content Type

I'm putting together a view with multiple content types. In my my_theme.theme file I want to set the template suggestion based on the item's content type (e.g. Content-Type-A gets Template-A.twig and ...
1
vote
1answer
353 views

Home Page rel=“canonical”

We created a home page as node/1850 which is specified in /admin/config/system/site-information. When I look at the generated code, I see: <link rel="canonical" href="/node/1850" /> This ...
0
votes
0answers
12 views

Override form field #value after ajax request sets it

First of all, here is the code: /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $form['join_newsletter'] = [ '#type' => '...
-2
votes
1answer
29 views

How to add custom php field views that returns my custom functions value?

I'm designing a form that creates a user on sign in. After that I'm displaying the data in a view for an admin to approve. I need to add custom PHP code that calls a function that performs approval of ...
0
votes
2answers
439 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 ...
-1
votes
2answers
46 views

How can I change the Webform module date picker calendar icon?

How to create a custom module? Which files should be there in the custom module? How to get the form_id and the exact location of the attribute for which the change is required?
2
votes
0answers
30 views

Add an existing node as a translation to another node [duplicate]

I am migrating contents from a multilingual website. I'm using Feed modules to import all the nodes so, in the end, I have multiple nodes that are in English and multiple nodes that are in French. ...
0
votes
0answers
17 views

D7 to D8 site migration and location of migration log

I'm using drush to migrate a D7 site to D8. I'm getting several errors in the drush migrate-import --all step. D8 site is installed using a bash script that executes: drush site-install standard -...
0
votes
1answer
20 views

Alternative #markup in a block's build function

Version: Drupal 8.7.x I am adding some canvas element to my page, and it gets ignored by Drupal. I can't even see it in the source page of browser. If I have something like this in my code: public ...
0
votes
1answer
42 views

Drupal 8 REST add custom error messages to existing core /entity/user/ resource

I am using drupal 8 rest and I want to be able to do a few computations and return custom json messages as per the defined condition when posting a user. I am using the already existing /entity/user/ ...
0
votes
0answers
42 views

How to use Paragraph components inside of Paragraph components

I have a component-based system using Paragraphs. I create the markup in Twig (Drupal 8), then pass the values of Paragraph fields to the component's properties. So for a super basic example: {# card....
-2
votes
2answers
39 views

Where might I place code to programmatically update nodes?

I want to update or set value of specific node/entity with one button that have function to update specific field on that node / entity? And put in on view tab on that specific node on a button? How ...
4
votes
1answer
1k views

Php Access User Data from external script

Currently my Drupal installation is at www.example.com/wiki/ I was wondering if it is possible in Drupal 8.2.4 to access the current user uid from an external php script. The script is located at ...
0
votes
1answer
36 views

Is there any PHP package that's very similar to the Plugin API? [closed]

I really like the Drupal 8 plugin system. I am now also working on a non-Drupal related project and am wondering if there's any similar solution to that on packagist.org? Was trying to find one but ...
0
votes
0answers
29 views

How can I define an offset when rendering a view with the renderRoot method?

In my app I'm calling an API to get the list of tasks as view(It has a complex html structure) and It is working correctly. But now I have to create a pagination for it. How can I pass the ...
2
votes
1answer
744 views

JSON format for creating users with custom fields using services

I am using Services module to register new users. My registration form has some custom fields like text field, radio buttons and select list. The following is the data I am sending: { "name" : "...
1
vote
2answers
154 views

Hide title if 404 error

I have a custom 404 error page, and I just want a quick module that hides the 404 page title, if the user arrives at a 404 error. I've found a D7 function that looks like it would work, checking for ...
3
votes
1answer
346 views

How do I prefill a paragraph field in a node form?

I have a content type with a paragraph entity reference field and every time a user is going to add a node of this type I want to have the paragraph field already open and prefilled. I've tried with ...