


How to make menu items of restricted pages visible to all user roles?
On a website I’m working on, logged in users can post their feedback about some functionalities which the website provides. While only logged in users should have access to fill the form, invisibility of the menu item “Share your experience” caused... read more
creation token rest post via postman Access Denied
I added drupal module “Oauth2” in order to test access by tokens. I created a consumer and got his uuid and client_secret by which I tested, using postman post method, the genretation of my first token,but it failed by 403 access forbidden(see the capture... read more
How to Logout user with Basic auth?
I can log in, perfectly fine, but can’t get logout to give me a JSON response. Currently, I can only do POST to d8.com/user/logout?csrf_token=123&?_format=json and that would log out, even though the token 123 is not the same as the given csrf-token at login... read more
View button that links to current node
I’m trying to create this button in my views with a custom text, that needs to link to the current node. I know you can use links and that works, but.. i need something like a variable that makes the link always go to the current node. read more
How to get the context node in a custom block inside a views list?
I have a view which displays all pictures of the content type photo. I’ve set some fields in this view for the display. This is how iIrender the list of pictures: views-view-fields–photo.html <figure class=”element-item {{... read more
custom field – How to get saved term selected for entity_autocomplete
I’ve looked all over, and for my level of understanding, I can’t figure out how to get the stored value of an entity autocomplete field targeting taxonomy term type. I thought I could do something similar to what I have for select field, but it breaks the... read more
Validate a file extension using getMimeType
I want to create a hook that will validate a file upload and only allow jpg extension or a multiple array jpg, gif. I am not sure how to do this. If this below can validate the length of the file title. if (strlen($file ->getFilename()) > 100) { $errors[] =... read more
Migrate Alt and Title text from a D6 image file field to D8
I’m trying to migrate a multi-value D6 image field to D8. I’ve already migrated the files with d6_file and it worked. When I do the node migration with the image field works and I get all the values but the alt and title text are not migrated. field_image:... read more
REST Basic Authentication not working
I configured my rest with services and installed the Basic authentication module. I used Postman and selected basic authentication gave username and password, I got “Missing required argument username” An important note is that If I change it to “no... read more
How to display a form in controller method
I have a form defined in mymodule/src/Form/myForm.php namespace DrupalmymoduleForm; use DrupalCoreFormFormBase; use DrupalCoreFormFormStateInterface; class myForm extends FormBase { /** * Specify the form ID. */ public function getFormId() { return... read more
Default 404 page not working
In a Drupal 8.5.3 installation I have set up the following configuration: I created a basic page, its node path is /node/42. Under Administration » Configuration » System » Basic site settings (/admin/config/system/site-information) I have set the Default 404 (not... read more
How to get query result in devel?
In Admin we have http://domain.com/devel/php I added query $result = db_query(“SELECT name FROM `users_field_data`”); print ($result); It’s not showing result. How to show that? read more
Moving the fields and data from one content type to another content type
I have created a content type called “ContentA” and in that content type I have two fields, “Summary” and “Title”. I have already created a new content type called “ContentB” and it is also having the same fields. What I... read more
Default front page not showing https
My website URL shows in browser https But on https://test.com/admin/config/system/site-information It’s showing http. What will be cause of this? Server configuration (apache)? Does it relate to Base URL? read more
OpenDialogCommand how to include Buttons in dialog_options
How can I inlcude buttons in OpenDialogCommand? $options = [ ‘dialogClass’ => ‘my-dialog-class’, ‘width’ => ‘700px’, ‘buttons’ => [ ‘text’ => ‘Continue’,... read more
Solr facets returning deleted TIDs
This seems to be a common issue when deleting terms linked to indexed content via term/entity reference, but no solution has worked so far. I am using the following: Drupal 7 Solr 5.5.3 Search API 7.x-1.22 Field reference delete 7.x-1.0-beta1 The terms are linked via... read more
InvalidArgumentException: Cannot redirect to an empty URL. in Symfony
Pages are not shwoing up. They display the follwoing error: InvalidArgumentException: Cannot redirect to an empty URL. in SymfonyComponentHttpFoundationRedirectResponse->setTargetUrl() (line 86 of... read more
Views field that links to fragment URL of comment on /node/ instead of /comment/
With Views, I want to output a list that links to each comment of the current node. But instead of linking to /comment/42#comment-42 I want to link to /node/23#comment-42 I tried these fields, but they all link to the URL in the /comment/ space: Comment: Title... read more