


How to add custom sort order to a taxonomy field list?
I am trying to sort the list of content according to the weight order given to taxonomy term. Terminology used: content type : contact-person-details taxonomy : company vocabulary which has list of company names like company A, company B, … session company :... read more
How to determine if view has translations and which ones
I have a view $view = DrupalviewsViews::getView($view_id); How to determine if it has been translated into other available languages and which ones read more
How to Customizing Webform Preview option drupal 7.5
I’m a bit new to Drupal. I’ve been doing some contract work in Drupal for a client, but generally work in Rails/Ember. I need to update the preview page for the webform in this Drupal 7 site and they want it to not only show the answers selected but all... read more
webform libraries dir location
The webform status report states several libraries are needed. After downloading the zip file.. and extracting it. Where does ‘/libraries/’ directory belong? ie: /modules/webform/libraries Or ??? read more
How to open file in new tab instead of download when submitting form?
The code below downloads the current file, I need it to open the file in a new tab, what needs to be added in order to do so? public function submitForm(array &$form, FormStateInterface $form_state) { $filename =... read more
Author image in comments twig
I succesfully get user name, surname and date to render in comment.html.twig like this function MYTHEMENAME_preprocess_comment(&$variables) { $comment = $variables[‘comment’]; $variables[‘user_name_comment’] =... read more
How to get parent node values on inline entity form hook alter?
I am using inline entity forms to create a paragraph in a node form. When I add a node I want the title of the node form to be copied to the paragraph when I click on “Add paragraph”. I use hook_inline_entity_form_entity_form_alter to prefill the title... read more
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 results in Google listing the url of the home page... read more
Do multi-level multi-value relationships work in a view?
In Drupal 8, I have a content type Story, with a multi-value entity reference to content type Project, which, in turn, has a multi-value reference to Team-Member, which has a single-value reference to Person. In my story node, I want to show a list of projects, and... read more
Access denied for all users, sessions table empty, access log shows NULL uid
My Drupal 7 site has been up and running for a couple years without issue. I went to log in as admin today to check for security updates and had the following experience: When I first browse to the page (as anonymous), the site works fine. Enter login information to... read more
composer install error
I can’t install anything because of this error: [RuntimeException] Could not scan for classes inside “/app/vendor/symfony/serializer/src/” which does not appear to be a file nor a folder and subsequently: Could not scan for classes inside... read more
#States required not working
I’m trying to use “#states”. When my checkbox is true, I want to make “required” another field. Drupal prints the “required” asterisk but not correctly. Here it’s the code: // Return origin.... read more
How do I disable/enable the Advanced Content Filtering (ACF) in CKEditor 4.8.0?
Please tolerate me for asking such a question. All the answers I found are for Drupal 7. There is barely any talk on this issue for Drupal 8. I am a beginner in Drupal and I am not a programming oriented person. However, I am determined to find the solution to make... read more
Pass data to hook_preprocess_html from custom module
I’m trying to create a custom Drupal 7 module where it renders a custom page template. I want the data on /animals and /animals/getanimal to be in a custom HTML template. After much searching and few successes, I’ve found that hook_preprocess_html works... read more
query to retrieve all translations and nodes of a language that has been removed from the system?
I am experiencing an issue after a language has been removed from the system. Every time I go on the admin/content page on a drupal 8 site I get: Error: Call to a member function getId() on null in DrupalCoreEntityEntityEntityViewDisplay->buildMultiple() (line 254... read more
How to get attachments out of a twig file
How do I get the attachments out a twig file and add them to a build array? If there is a twig file with {{ attach_library(‘mytheme/pullquote’) }} And because it’s in an ajax response, I need to get the attachments out without rendering the page, how... read more
Alter the user registration form
I’m trying to change the label and field instructions for the name field on the User Account Creation form. I’m new to coding, and thought this would be an easy task. My custom module is enabled and I’ve cleared caches, but none of my changes show... read more
How to make existing public files private?
Let’s say I have a node type “Article” which has a field “File” which is set to handle public files. A lot of articles and files get added. Now the specs suddenly change and the “Article” will move behind a login and therefore... read more