summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/system')
-rw-r--r--core/modules/system/system.install2
-rw-r--r--core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php2
-rw-r--r--core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.component.yml35
-rw-r--r--core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.twig10
-rw-r--r--core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.component.yml10
-rw-r--r--core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig4
-rw-r--r--core/modules/system/tests/themes/sdc_theme_test/components/my-card/my-card.component.yml5
7 files changed, 66 insertions, 2 deletions
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 35e682600b89..9b8c25c157ed 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -478,7 +478,7 @@ function system_requirements($phase): array {
'%exception_message' => $e->getMessage(),
];
if ($open_basedir_blocks_urandom) {
- $requirements['php_random_bytes']['description'] = t('Drupal is unable to generate highly randomized numbers, which means certain security features like password reset URLs are not as secure as they should be. Instead, only a slow, less-secure fallback generator is available. The most likely cause is that open_basedir restrictions are in effect and /dev/urandom is not on the whitelist. See the <a href=":drupal-php">system requirements</a> page for more information. %exception_message', $args);
+ $requirements['php_random_bytes']['description'] = t('Drupal is unable to generate highly randomized numbers, which means certain security features like password reset URLs are not as secure as they should be. Instead, only a slow, less-secure fallback generator is available. The most likely cause is that open_basedir restrictions are in effect and /dev/urandom is not on the allowed list. See the <a href=":drupal-php">system requirements</a> page for more information. %exception_message', $args);
}
else {
$requirements['php_random_bytes']['description'] = t('Drupal is unable to generate highly randomized numbers, which means certain security features like password reset URLs are not as secure as they should be. Instead, only a slow, less-secure fallback generator is available. See the <a href=":drupal-php">system requirements</a> page for more information. %exception_message', $args);
diff --git a/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php b/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php
index edc2b4114fcc..9cf86c005b85 100644
--- a/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php
+++ b/core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Drupal\lazy_route_provider_install_test;
-use Drupal\Component\Annotation\PluginID;
+use Drupal\Component\Plugin\Attribute\PluginID;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
diff --git a/core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.component.yml b/core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.component.yml
new file mode 100644
index 000000000000..d283c7c0feaf
--- /dev/null
+++ b/core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.component.yml
@@ -0,0 +1,35 @@
+$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json
+name: Call to Action With Existing Variant Prop
+description: Call to action link.
+props:
+ type: object
+ required:
+ - text
+ properties:
+ text:
+ type: string
+ title: Title
+ description: The title for the cta
+ examples:
+ - Press
+ - Submit now
+ href:
+ type: string
+ title: URL
+ format: uri
+ target:
+ type: string
+ title: Target
+ enum:
+ - ''
+ - _blank
+ variant:
+ type: string
+ title: Variant Prop
+ enum:
+ - primary
+ - secondary
+ - tertiary
+ attributes:
+ type: Drupal\Core\Template\Attribute
+ name: Attributes
diff --git a/core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.twig b/core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.twig
new file mode 100644
index 000000000000..e1a326ccf078
--- /dev/null
+++ b/core/modules/system/tests/modules/sdc_test/components/my-cta-with-variant-prop/my-cta-with-variant-prop.twig
@@ -0,0 +1,10 @@
+{% if target is not empty %}
+ {% set attributes = attributes.setAttribute('target', target) %}
+{% endif %}
+{% if variant is not empty %}
+ {% set attributes = attributes.addClass('my-cta-' ~ variant) %}
+{% endif %}
+
+<a {{ attributes }} href="{{ href }}">
+ {{ text }}
+</a>
diff --git a/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.component.yml b/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.component.yml
index 015b3e16319b..889dfe885205 100644
--- a/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.component.yml
+++ b/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.component.yml
@@ -26,3 +26,13 @@ props:
attributes:
type: Drupal\Core\Template\Attribute
name: Attributes
+variants:
+ primary:
+ title: Primary
+ description: My primary variant
+ secondary:
+ title: Secondary
+ description: My secondary variant
+ tertiary:
+ title: Tertiary
+ description: My tertiary variant
diff --git a/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig b/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig
index bf8b240b673c..e1a326ccf078 100644
--- a/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig
+++ b/core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig
@@ -1,6 +1,10 @@
{% if target is not empty %}
{% set attributes = attributes.setAttribute('target', target) %}
{% endif %}
+{% if variant is not empty %}
+ {% set attributes = attributes.addClass('my-cta-' ~ variant) %}
+{% endif %}
+
<a {{ attributes }} href="{{ href }}">
{{ text }}
</a>
diff --git a/core/modules/system/tests/themes/sdc_theme_test/components/my-card/my-card.component.yml b/core/modules/system/tests/themes/sdc_theme_test/components/my-card/my-card.component.yml
index 67d3a01657a8..4188362279bd 100644
--- a/core/modules/system/tests/themes/sdc_theme_test/components/my-card/my-card.component.yml
+++ b/core/modules/system/tests/themes/sdc_theme_test/components/my-card/my-card.component.yml
@@ -1,6 +1,11 @@
$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json
name: Card
status: experimental
+variants:
+ horizontal:
+ title: Horizontal
+ vertical:
+ title: Vertical
props:
type: object
required: