In the resource editor, the field labeled "Publish Date" / "Дата публикації" is empty for published resources even when the resource already has a valid publication timestamp in the database.
I verified this both on migrated resources and on a newly created resource in the manager. The issue is reproducible on a fresh resource as well.
Observed behavior
The resource edit form renders the publish date input from pub_date, not from publishedon.
Relevant code in the manager form:
manager/actions/mutate_content.dynamic.php
<input type="text" id="pub_date" ... value="<?= ((int)get_by_key($content, 'pub_date', 0, 'is_scalar') === 0 || !isset($content['pub_date']) ? '' : $modx->toDateFormat($content['pub_date'])) ?>" ... />
So the UI reads pub_date.
However, when a new resource is created or saved, the actual publication timestamp is stored in publishedon.
Relevant save logic:
manager/processors/save_content.processor.php
$publishedon = ($published ? $currentdate : 0);
if ((!empty($pub_date)) && ($published)) {
$publishedon = $pub_date;
}
$resourceArray['pub_date'] = $pub_date;
$resourceArray['publishedon'] = $publishedon;
This means:
publishedon is filled for published resources
pub_date remains 0 unless an explicit publish date is entered
- the manager displays the field as empty even for already published resources
Reproducible example
I created a new resource in the manager:
id = 290
published = 1
publishedon = 1779718556
pub_date = 0
So the resource is published and has a timestamp, but the "Publish Date" field in the editor remains empty.
Database evidence
For id = 290:
{
"id": 290,
"pagetitle": "тайтл",
"published": 1,
"pub_date": 0,
"publishedon": 1779718556
}
Actual result
- The resource is published
publishedon is populated
- The manager shows an empty "Publish Date" field
- This looks like the date was not saved, even though it was
Expected result
The manager should either:
- display
publishedon if the field is intended to show the actual publication timestamp, or
- clearly label
pub_date as a scheduled publication date, not the publication timestamp
Ideally, both values should be visible:
pub_date = scheduled publish date
publishedon = actual publication timestamp
Why this is confusing
The current label strongly suggests the field represents the publication date of the resource, but in practice it is bound to pub_date, which is only used for scheduling.
For imported content and for newly created published resources, publishedon is the meaningful value. Because the form ignores it, the field appears broken.
Environment
- EvolutionCMS 3.5.x-dev
- PHP 8.4.16
- MySQL
- Manager resource editor
- sGallery
Screenshot
Suggested fix
A possible fix would be one of the following:
- show
publishedon in the editor if the intent is to display the actual publish timestamp
- rename the current field to something like
Scheduled Publish Date
- keep both fields separate in the UI:
pub_date for scheduling
publishedon as read-only metadata
Additional note
I confirmed this is not limited to migrated data. It also happens when creating a fresh resource through the admin panel.
In the resource editor, the field labeled "Publish Date" / "Дата публикації" is empty for published resources even when the resource already has a valid publication timestamp in the database.
I verified this both on migrated resources and on a newly created resource in the manager. The issue is reproducible on a fresh resource as well.
Observed behavior
The resource edit form renders the publish date input from
pub_date, not frompublishedon.Relevant code in the manager form:
manager/actions/mutate_content.dynamic.phpSo the UI reads
pub_date.However, when a new resource is created or saved, the actual publication timestamp is stored in
publishedon.Relevant save logic:
manager/processors/save_content.processor.phpThis means:
publishedonis filled for published resourcespub_dateremains0unless an explicit publish date is enteredReproducible example
I created a new resource in the manager:
id = 290published = 1publishedon = 1779718556pub_date = 0So the resource is published and has a timestamp, but the "Publish Date" field in the editor remains empty.
Database evidence
For
id = 290:{ "id": 290, "pagetitle": "тайтл", "published": 1, "pub_date": 0, "publishedon": 1779718556 }Actual result
publishedonis populatedExpected result
The manager should either:
publishedonif the field is intended to show the actual publication timestamp, orpub_dateas a scheduled publication date, not the publication timestampIdeally, both values should be visible:
pub_date= scheduled publish datepublishedon= actual publication timestampWhy this is confusing
The current label strongly suggests the field represents the publication date of the resource, but in practice it is bound to
pub_date, which is only used for scheduling.For imported content and for newly created published resources,
publishedonis the meaningful value. Because the form ignores it, the field appears broken.Environment
Screenshot
Suggested fix
A possible fix would be one of the following:
publishedonin the editor if the intent is to display the actual publish timestampScheduled Publish Datepub_datefor schedulingpublishedonas read-only metadataAdditional note
I confirmed this is not limited to migrated data. It also happens when creating a fresh resource through the admin panel.