I'm trying to style the title field from a view. So I create this template
views-view-field--frontpage--title.html.twig
And when I was trying to see what variables are avaiable in this template level. I decide to add
{{ kint() }}
And for some reason it showing me this huge error.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: CREATE TABLE {cache_render} ( `cid` VARCHAR(255) BINARY CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.', `data` LONGBLOB NULL DEFAULT NULL COMMENT 'A collection of data to cache.', `expire` INT NOT NULL DEFAULT 0 COMMENT 'A Unix timestamp indicating when the cache entry should expire, or -1 for never.', `created` DECIMAL(14, 3) NOT NULL DEFAULT 0 COMMENT 'A timestamp with millisecond precision indicating when the cache entry was created.', `serialized` SMALLINT NOT NULL DEFAULT 0 COMMENT 'A flag to indicate whether content is serialized (1) or not (0).', `tags` LONGTEXT NULL DEFAULT NULL COMMENT 'Space-separated list of cache tags for this entry.', `checksum` VARCHAR(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The tag invalidation checksum when this entry was saved.', PRIMARY KEY (`cid`), INDEX `expire` (`expire`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Storage for the cache API.'; Array ( ) in Drupal\Core\Render\RenderCache->set() (line 275 of core/lib/Drupal/Core/Render/RenderCache.php).The website encountered an unexpected error. Please try again later.
I think this might be a Drupal 8 bug, but I'm not sure.
So my question are..
How can I get the variables ? Or at least the field value so I can added wrapper around it.
In Drupal 8, do you think I went to deep on this template ? I notice that using the theme_debug functionality I could not see this template suggestion.
MAX_ALLOWED_PACKET
set at? It think it's more likely to be a config issue than a bug at first glance. e.g. you're inadvertently trying to force too much data into cache by invokingkint()
with any arguments on a page that has some deeply nested/complicated vars in it{{ kint() }}
, see this answer