Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Composer
plugin
Drupal Environment
Commits
0f5af6c3
Commit
0f5af6c3
authored
9 months ago
by
richardpapp
Browse files
Options
Downloads
Patches
Plain Diff
Fix LogMessageEvent tokens not available
parent
2c912aa3
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!246
Merging develop into main
Pipeline
#1273923
passed
9 months ago
Stage: build
Stage: validate
Stage: release
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
patches/d10-3.json
+3
-0
3 additions, 0 deletions
patches/d10-3.json
patches/d10/3461808.diff
+81
-0
81 additions, 0 deletions
patches/d10/3461808.diff
with
84 additions
and
0 deletions
patches/d10-3.json
+
3
−
0
View file @
0f5af6c3
...
...
@@ -101,6 +101,9 @@
"drupal/dynamic_entity_reference"
:
{
"#3099176 Errors when new entity types are added"
:
"https://www.drupal.org/files/issues/2023-09-08/3099176-3.x-16.diff"
},
"drupal/eca"
:
{
"#3461808 LogMessageEvent tokens not available"
:
"https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3461808.diff"
},
"drupal/elasticsearch_connector"
:
{
"#2952301 Flatten keys"
:
"https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/elasticsearch_connector.patch"
},
...
...
This diff is collapsed.
Click to expand it.
patches/d10/3461808.diff
0 → 100644
+
81
−
0
View file @
0f5af6c3
diff --git a/modules/log/src/Event/LogMessageEvent.php b/modules/log/src/Event/LogMessageEvent.php
index 485a8f9f..875590cc 100644
--- a/modules/log/src/Event/LogMessageEvent.php
+++ b/modules/log/src/Event/LogMessageEvent.php
@@ -2,7 +2,6 @@
namespace Drupal\eca_log\Event;
-use Drupal\eca\Plugin\DataType\DataTransferObject;
use Symfony\Contracts\EventDispatcher\Event;
/**
@@ -37,13 +36,6 @@
class LogMessageEvent extends Event {
*/
protected array $context;
- /**
- * An instance holding log data accessible as token.
- *
- * @var \Drupal\eca\Plugin\DataType\DataTransferObject|null
- */
- protected ?DataTransferObject $logData = NULL;
-
/**
* Construct a LogMessageEvent.
*
@@ -90,14 +82,4 @@
class LogMessageEvent extends Event {
return $this->context;
}
- /**
- * Get the log data.
- *
- * @return \Drupal\eca\Plugin\DataType\DataTransferObject|null
- * The log data or NULL.
- */
- public function getLogData(): ?DataTransferObject {
- return $this->logData;
- }
-
}
diff --git a/modules/log/src/Plugin/ECA/Event/LogEvent.php b/modules/log/src/Plugin/ECA/Event/LogEvent.php
index 5f9cf751..e23ecb72 100644
--- a/modules/log/src/Plugin/ECA/Event/LogEvent.php
+++ b/modules/log/src/Plugin/ECA/Event/LogEvent.php
@@ -28,6 +28,13 @@
use Symfony\Contracts\EventDispatcher\Event;
*/
class LogEvent extends EventBase {
+ /**
+ * An instance holding log data accessible as token.
+ *
+ * @var \Drupal\eca\Plugin\DataType\DataTransferObject|null
+ */
+ protected ?DataTransferObject $logData = NULL;
+
/**
* {@inheritdoc}
*/
@@ -142,10 +149,10 @@
class LogEvent extends EventBase {
public function getData(string $key): mixed {
$event = $this->event;
if ($key === 'log' && $event instanceof LogMessageEvent) {
- if ($logData = $event->getLogData()) {
+ if ($this->logData === NULL) {
$message = str_replace('@backtrace_string', '', $event->getMessage());
$context = $this->cleanupIterableForDto($event->getContext());
- $logData = DataTransferObject::create([
+ $this->logData = DataTransferObject::create([
'severity' => DataTransferObject::create($event->getSeverity()),
'message' => [
'raw' => DataTransferObject::create($event->getMessage()),
@@ -154,7 +161,7 @@
class LogEvent extends EventBase {
'context' => DataTransferObject::create($context),
]);
}
- return $logData;
+ return $this->logData;
}
return parent::getData($key);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment