There are 2 fields in the database, "publishedon" and "publishedby". These fields are set correctly when a document is published using the right click/publish method, but they are incorrectly set when the document is saved with the ’publish’ box ticked. In this case they are reversed, i.e. "publishedon" get the user id and "publishedby" gets the time.
The culprit is the SQL INSERT in save_content_processor.php. 2 values are set up prior to this query
$publishedon = ($published ? time() : 0);
$publishedby = ($published ? $modx->getLoginUserID() : 0);
However, looking at the query -
"INSERT INTO $dbase.".$table_prefix."site_content
(introtext, ... cacheable, createdby, createdon, editedby, editedon, publishedon, publishedby, pub_date, unpub_date, ...
and the corresponding values
VALUES('".$introtext."',' ... $cacheable."', '".$modx->getLoginUserID()."', ".time().", ".$publishedon.",
".$publishedby.", '".$modx->getLoginUserID()."', ".time().", '$pub_date', '$unpub_date', ...
1. "publishedon" and "publishedby" are the wrong way round, and
2. The values previously calculated for them are actually assigned to "editedby" and "editedon" and they get new copies, regardless of the status of the "published" flag.
Are we still using the bugtracker? If so I will post this there.
PS I have now tracked it
here.