Disable all caches on Drupal 8
When I was porting Mollom to drupal 8 I noticed that when I did a hook_form_alter, it wasn't showing the comment form ID as debug information. An important detail is that the page was viewed by an anonymous user.
mollom.module
function mollom_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
print_r($form_id);
Luckily the solution was quite easy:
settings.php
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
$settings['cache']['bins']['render'] = 'cache.backend.null';
drush
drush cr
And done! Now we do see all the debug information. It's due to the render cache that caches certain forms. Now enjoy porting your Drupal 8 module!
Comments
Thanks!
Thanks!
This partially works... my
This partially works... my twig files aren't refreshing though... is there a different process / cache for twig files?
Dawno nie czytałem już tak
Dawno nie czytałem już tak rzetelnego posta. Jestem zdania, że z sukcesem możesz rywalizować z najlepszymi autorami blogów w tym kraju. Z swojej strony zapraszam każdego, kto chce rozbudować swoją wiedzę na powyższy temat do odwiedzenia mojej strony .
Looks like it does not work
Looks like it does not work for anonymous users
Add new comment