Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I looked at core and could not find a typed data structure for log entries. I think we should invent one in Rules, which is far from ideal but we need the context data of what is in a watchdog entry to pass along with the event.
I'm thinking of:
class LogData extends TypedData implements \IteratorAggregate, ComplexDataInterface
You can look at EntityAdapter for example what you need to implement.
added todos referencing to task https://www.drupal.org/node/2625238
added context 'logger_entry' of type 'any'
added an integration-metadata-test that test if $event->logger_entry is of type 'any'
Comments
Comment #2
ndf CreditAttribution: ndf commented@see
hook_watchdog() and watchdog() removed
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
d7 implementation: http://cgit.drupalcode.org/rules/tree/modules/events.inc
Comment #3
ndf CreditAttribution: ndf commentedPR: https://github.com/fago/rules/pull/297
Comment #4
klausiI looked at core and could not find a typed data structure for log entries. I think we should invent one in Rules, which is far from ideal but we need the context data of what is in a watchdog entry to pass along with the event.
I'm thinking of:
class LogData extends TypedData implements \IteratorAggregate, ComplexDataInterface
You can look at EntityAdapter for example what you need to implement.
Comment #5
ndf CreditAttribution: ndf commentedTalked with Klausi, Xano and Fago.
The new TypedData "Logger Entry" can be developed separately in this ticket: https://www.drupal.org/node/2625238
For now we use context-type "Any" instead.
Comment #6
ndf CreditAttribution: ndf commentedPR: https://github.com/fago/rules/pull/297
added todos referencing to task https://www.drupal.org/node/2625238
added context 'logger_entry' of type 'any'
added an integration-metadata-test that test if $event->logger_entry is of type 'any'
Comment #7
klausileft a couple of minor comments in the pull request.
Comment #8
ndf CreditAttribution: ndf commentedHi klausi,
Just fixed your comments.
https://github.com/fago/rules/pull/297
Comment #9
klausiThe branch has conflicts, can you merge in 8.x-3.x?
Comment #10
ndf CreditAttribution: ndf commentedNew PR https://github.com/fago/rules/pull/314
replaces https://github.com/fago/rules/pull/297/files
Not sure why the merge/rebase failed. So opened a new branch and copy-pasted changes there.
Comment #11
klausijust a missing category on the event, otherwise looks good!
Comment #12
ndf CreditAttribution: ndf commentedNice, than this one should be the final PR:
https://github.com/fago/rules/pull/314
Comment #14
klausimerged, thanks!
Let's continue in #2625238: Create Typed Data "Logger Entry" type
Comment #15
ndf CreditAttribution: ndf commentedCool!