-1

Actually I am stuck in a big problem . i am using input.html.twig file and i remove all the content from that and then when i see my default registration form and user login form which is prebuild in drupal 8 . i didn't see any input fields and so that due to this i don't login in drupal site. so anyone please help me what can i do All fields was dissapear there is no buttoon no input fields. someone please give me some idea about this. i am working on my local. enter image description here I use drush command in terminal but it says that drush command not found. so how i clear the cache . And also i put the original file in the folder and replace previous file but not working.

4
  • 2
    Put the code back in the input template, clear the cache, you should be able to login
    – Clive
    Commented Jul 21, 2020 at 19:07
  • 1
    Why did you remove all content from the input.html.twig in the first place? What Drush command did you run from where exactly? Is your site built from a Composer template?
    – leymannx
    Commented Jul 21, 2020 at 21:20
  • without login in durpal 8 I didn't clear the cache. Is there any chances to clear the cache of the site ? because without clearing the cache the changes will not appear and without log in i didn't clear the cache. so due to this i use terminal for clearing the cache but when i enter the comman "sudo apt install drush" it always shows that enable to locate package drush Commented Jul 21, 2020 at 21:50
  • Drush now only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency. If you don't get Drush running you alternatively can simply disable Drupal 8 caching during development or follow @EugeneBocharov's suggestion in their answer.
    – leymannx
    Commented Jul 22, 2020 at 8:33

1 Answer 1

2

Why does the login form become unusable

Because input.html.twig is "Default theme implementation for an 'input' #type form element". If it's empty, there will be empty string in place of all <input> tags.

If you have cleared content form input.html.twig placed in your custom theme, just completely remove input.html.twig file and clear the cache. In that case Drupal will use corresponing core template file, so functionallity will be restored.

If you have cleared content of input.html.twig in core or contrib theme folder (which is strongly not recommended), you should restore it's original content. Which can be taken at corresponding project page at Drupal.org from archive or found at repository git.drupalcode.org. For example here https://git.drupalcode.org/project/bootstrap if you use Bootstrap theme.

To clear the cache in your case without access to admin interface or drush there is one extra method:

Add to sites/default/settings.php

$settings['rebuild_access'] = TRUE;

Open in browser http://yoursite.com/core/rebuild.php

More info here https://www.drupal.org/docs/user_guide/en/prevent-cache-clear.html#s-using-the-rebuild-script

Don't forget to remove $settings['rebuild_access'] = TRUE; from settings.php after clearing the cache.

1
  • Thankx For Everyone Who Reply my Question. I want to tell you One thing that my problem is solve now. i simply go to the phpmyadmin database and select all cache related files in table and truncate them it solve my problem. Commented Jul 23, 2020 at 15:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.