Needs work
Project:
Typed Data API enhancements
Version:
2.1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Nov 2015 at 15:04 UTC
Updated:
24 Jun 2024 at 18:44 UTC
Jump to comment: Most recent
Comments
Comment #2
ndf commentedComment #3
klausiComment #4
ndf commentedReading in on d8 TypedData: https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!Plugin!...
The current array
Moving to
https://github.com/fago/rules/pull/315
Comment #5
klausiCool, left a couple of comments in the pull request.
Comment #6
ndf commentedI am still in a doubt.
There are 3 ways I've been investigation and I cannot make a decision about how
logger_entryshould be handled:\Drupal\Core\TypedData\Plugin\DataType\Mapconfig/schema/rules.schema.ymlNotes:
approach new DataType
Extend
\Drupal\Core\TypedData\Plugin\DataType\MapDoing
class LoggerEntry extends Mapwith annotationdefinition_class = "\Drupal\rules\TypedData\LoggerEntryDataDefinition"initiatingnew LoggerEntry()gives a runtime-error that the definition must be passed to the LoggerEntry __constructor.This is probably just wrongly implemented by me.
Have been looking through a lot of core-examples of
extends Map()and other TypedDate implementations. But I could not find one or more with this typical 'associative array with a couple of fixed keys and expected values' setup like logger_entry has.Via .yml
config/schema/rules.schema.ymlThis method seems to be used for config-entities only. The definition (via .yml) looks very clear and simple though.
see below for the .yml I made up for now.
Make it an entity
Make it an entity with all the bells and whistles
Seems a fine approach, all though I could imagine it might have performance impact.
I am not sure if this means that all logger_entries now should be saved to the db or not.
But it could be an attractive approach because of a lot of integrations we get for free.
Example *.schema.yml for logger entry
Comment #7
klausiLeft a couple of comments in the pull request.
Yes, you will need a data definition class for the logger entry data type. It should not be an entity, since such a log entry cannot be saved. It is just data. The config schema shoould also not be necessary.
Comment #8
amateescu commentedNote that the current Rules logger has a small bug: #2803823: Rules' logger needs to take care of its internal properties on serialization so we'll need to port that fix to this issue as well.
Comment #9
tr commented@ndf - this is still assigned to you. Are you going to work on it?
Comment #10
ndf commented@TR nope, I unassigned myself
Comment #11
tr commentedAdded #1349882: Action: Create a watchdog entry as a related issue - that issue is for D7, but both that and this require exposing the watchdog log entry data structure to Rules. The data structure produced by the event should be the same as the data structure produced by the action.
Comment #12
tr commentedMoving this to the Typed Data API module, as that is where I think we should be putting generally-useful data type definitions.
Comment #13
tr commentedComment #14
tr commented