Comments (6)
Edit 4
i think im now pretty sure that we should use the timestamp of the date when the node was first created.
For example its otherwise not possible to pass relative dates into a node property:
PropertyValuesToWrite::fromArray(['myDate' => 'now'])
results in
Property "myDate" cannot be set to a value of type "string", must be of type "DateTimeImmutable"
from neos-development-collection.
At least i dindt saw the feature being used in any of the starships i came across. Maybe @ahaeslich can confirm this as well?
Uh couldn't find it in our Neos 9 project if that is what you are asking. Not sure if anyone tryed it and didn't raise that it doesn't work. In Neos 8 projects I could find the usage of defaultValue: now
.
from neos-development-collection.
The cause of this is trusting user input to hard :D We effectively do SerializedPropertyValues::defaultFromNodeType($nodeType)
which we merge onto the initialPropertyValues
.
That explains why the initialPropertyValues
in the commandPayload
dont have them, as this modification is not kept for rebases.
We should probably read the properties and let them first be deserialised to ensure all constraints are met. For example an image object should never be written "foo"
into.
EDIT 3
we seem to check the default properties here
EDIT 4
so in the end it seems everything does kinda work and there are tests for it :D
but as far as i can tell is now
always the current time as its deserialised from symphony not taken the event timestamp into account. Is that correct behaviour?
The serialised properties come back from the projection like this:
string "now" (3) => Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValue object
value => string "now" (3)
type => string "DateTimeImmutable" (17)
and will be unserialized on the fly in PropertyConverter::deserializePropertyValue
without further context.
from neos-development-collection.
Edit 5
well i think this was an accidental regression from #4251
previously NodeType::getDefaultValuesForProperties
also returned actual date time instances but now it returns only raw properties.
That would also explain all the now obsolete instanceof DateTime
checks when getDefaultValuesForProperties
is used, that i could not explain til now.
from neos-development-collection.
We could even provide a migration, but as far as i can see was no one hopefully foolish enough to use this feature. So i would propose to only write a migration if deemed necessary. You can check if your project might be affected by just checking all DateTime
properties and see if they have a relative property value.
At least i dindt saw the feature being used in any of the starships i came across. Maybe @ahaeslich can confirm this as well?
from neos-development-collection.
Thanks for your insight. That confirms what we thought in our weekly. No migration for this.
from neos-development-collection.
Related Issues (20)
- BUG? Fusion `value` not accessible in `@if` for `@process` HOT 2
- BUG: 9.0 `Neos.Fusion:Template`'s `attributes` now an array
- BUG: NodeTypeManager can crash in cli context
- TASK: Deprecate `Neos.Fusion:Plugin` HOT 2
- Migrating old cr data with additional root nodes and their children
- Adjust docs regarding 9.0 `Neos.Neos:Plugin`
- Ensure exceptions during CatchUpHook are properly handled HOT 1
- Neos 9.0 Sub-request on Neos.Neos Frontend page broken
- Feature refine php api for php fusion object implementations
- 9.0 `Node::hasProperty` might lie in combination with entity privileges where property will be null still
- BUG: 9.0 `cr:export` doesnt work with resource stream wrapper
- BUG: 9.0 `cr:prune` is a noop if projections are empty already or not up to date HOT 1
- Regression: 4838 Fusion `ParsePartials` cache broken in latest `8.3.10` release
- FEATURE: "Connect" new site entity to site node
- Flow Query Replacement HOT 1
- AssetUsage Interface
- TASK: Remove obsolete i18 label `content.inspector.editors.dateTimeEditor.apply` HOT 2
- BUG: Fusion translations not working in Neos 9 HOT 4
- 9.0 Test, (Refactor) and rename Neos' Fusion View
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neos-development-collection.