diff --git a/_build/test/Tests/Processors/Element/CategoryTest.php b/_build/test/Tests/Processors/Element/CategoryTest.php
index 7079c1a69bb..e9ad2eb4044 100644
--- a/_build/test/Tests/Processors/Element/CategoryTest.php
+++ b/_build/test/Tests/Processors/Element/CategoryTest.php
@@ -179,6 +179,25 @@ public function providerCategoryGetList() {
];
}
+ /**
+ * Tests that createdon is set when creating a Category and editedon remains null
+ */
+ public function testCategoryCreateSetsCreatedon() {
+ /** @var ProcessorResponse $result */
+ $result = $this->modx->runProcessor(Create::class, [
+ 'category' => 'UnitTestCatTimestamp',
+ ]);
+ $this->assertTrue($this->checkForSuccess($result), 'Could not create Category for timestamp test');
+
+ /** @var modCategory $category */
+ $category = $this->modx->getObject(modCategory::class, ['category' => 'UnitTestCatTimestamp']);
+ $this->assertNotNull($category, 'Category not found after creation');
+
+ $this->assertNotNull($category->get('createdon'), 'createdon should be set on new Category');
+ $this->assertNotEmpty($category->get('createdon'), 'createdon should not be empty on new Category');
+ $this->assertNull($category->get('editedon'), 'editedon should be null on new Category');
+ }
+
/**
* Tests the element/category/remove processor, which removes a Category
*
diff --git a/_build/test/Tests/Processors/Element/ChunkTest.php b/_build/test/Tests/Processors/Element/ChunkTest.php
index 7fb565cac39..8e54a24e0a9 100644
--- a/_build/test/Tests/Processors/Element/ChunkTest.php
+++ b/_build/test/Tests/Processors/Element/ChunkTest.php
@@ -326,6 +326,47 @@ public function providerChunkGetList() {
];
}
+ /**
+ * Tests that createdon is set when creating a Chunk and editedon remains null
+ */
+ public function testChunkCreateSetsCreatedon() {
+ $result = $this->modx->runProcessor(Create::class, [
+ 'name' => 'UnitTestChunkTimestamp',
+ ]);
+ $this->assertTrue($this->checkForSuccess($result), 'Could not create Chunk for timestamp test');
+
+ /** @var modChunk $chunk */
+ $chunk = $this->modx->getObject(modChunk::class, ['name' => 'UnitTestChunkTimestamp']);
+ $this->assertNotNull($chunk, 'Chunk not found after creation');
+
+ $this->assertNotNull($chunk->get('createdon'), 'createdon should be set on new Chunk');
+ $this->assertNotEmpty($chunk->get('createdon'), 'createdon should not be empty on new Chunk');
+ $this->assertNull($chunk->get('editedon'), 'editedon should be null on new Chunk');
+ }
+
+ /**
+ * Tests that createdon is preserved after updating a Chunk
+ */
+ public function testChunkUpdatePreservesCreatedon() {
+ /** @var modChunk $chunk */
+ $chunk = $this->modx->getObject(modChunk::class, ['name' => 'UnitTestChunk']);
+ $this->assertNotNull($chunk, 'UnitTestChunk not found');
+
+ $createdon = $chunk->get('createdon');
+ $this->assertNotNull($createdon, 'createdon should be set on fixture chunk');
+
+ $result = $this->modx->runProcessor(Update::class, [
+ 'id' => $chunk->get('id'),
+ 'name' => 'UnitTestChunk',
+ 'description' => 'Updated for timestamp test',
+ ]);
+ $this->assertTrue($this->checkForSuccess($result), 'Could not update Chunk for timestamp test');
+
+ // Re-fetch to get fresh data
+ $chunk = $this->modx->getObject(modChunk::class, ['name' => 'UnitTestChunk']);
+ $this->assertEquals($createdon, $chunk->get('createdon'), 'createdon should not change on update');
+ }
+
/**
* Tests the element/chunk/remove processor, which removes a Chunk
* @dataProvider providerChunkRemove
diff --git a/core/model/schema/modx.mysql.schema.xml b/core/model/schema/modx.mysql.schema.xml
index 1d4a75635fb..c5102c3ddc8 100644
--- a/core/model/schema/modx.mysql.schema.xml
+++ b/core/model/schema/modx.mysql.schema.xml
@@ -286,6 +286,8 @@
+
+
@@ -350,6 +352,8 @@
+
+
@@ -755,6 +759,8 @@
+
+
@@ -784,6 +790,8 @@
+
+
@@ -1011,6 +1019,8 @@
+
+
@@ -1068,6 +1078,8 @@
+
+
@@ -1113,6 +1125,8 @@
+
+
@@ -1151,6 +1165,8 @@
+
+
@@ -1170,6 +1186,8 @@