Bug #15883
closedCould not publish from draft [t3lib_TCEmain::doesRecordExist() and autoversioned content]
0%
Description
Hi,
I had a problem publish changes done by a user in draft workspace.
user A may only edit in draft workspace.
user B is admin.
user A modifies a content (in templavoila) adding an autoversioned content.
user B wants to publish the new content (from Web > Versioning) and gets the message "You cannot publish a record you do not have edit and show permissions for".
ACLs looks OK (and user is admin). Digging into the code I found in t3lib_TCEmain::version_swap() that it checks if record exists (line 3461 in RC1) :
if ($this->doesRecordExist($table,$swapWith,'show') && $this->checkRecordUpdateAccess($table,$swapWith)) {
The tests returns false because pid is -1.
So, what I've done is modify t3lib_TCEmain::doesRecordExist() this way :
if (is_array($pageRec) || (!$output['pid'] && $this->admin) || (($output['pid'] == -1))) {
But I don't know if the problem is that it should not have got a -1 pid or if the test was wrong.
Anyway, typo3 is THE REAL GREAT OPENSOURCE CMS. And 4.0 looks even greater than previous versions. Nice work.
(issue imported from #M2964)