Use klaro settings for excluded paths in block settings and add cache for render array

Issue information

From user: erik seifert

Related to !13 (merged)

Contribution record

Fork management

Problem/Motivation

As a site builder, i want to place a klaro block going side by side with klaro settings. If i set exclude_paths in klaro configuration, the block should also not displayed on these paths.

As you see in #3335246: Config schema incorrect name the test testExcludePaths will fail because it tests also the block visibility.

Caching seems also not respected. So if you change the title in klaro_settings and revisit the site with an anonymous user, title stays the same.

Steps to reproduce

Set klaro block in a region. Exclude a path in klaro settings. Go to the url and the block is still present and not functional.

Proposed resolution

Use klaro settings in Block::blockAccess . Add the cache dependencies on block and library rendering.

Remaining tasks

User interface changes

API changes

Data model changes

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information