You might want to switch from K2 to something like another, like EasyBlog ... Or just don't use K2. It seems like K2 defaults to executing a workflow that conflicts with yours.
Otherwise, you can change K2 according to your needs ... I really do not recommend changing extensions, because then you can no longer update them if you do not plan to make changes every time you update (which is a pain),
The problem is with the administrator / components / com _k2 / models / item.php. The following lines are the form of version 2.6.1, line 785.
if ($front) { if (!K2HelperPermissions::canPublishItem($row->catid) && $row->published) { $row->published = 0; $mainframe->enqueueMessage(JText::_('K2_YOU_DONT_HAVE_THE_PERMISSION_TO_PUBLISH_ITEMS'), 'notice'); } }
If I understand you correctly, you want something more:
if ($front) { $row->published = 1; if (!K2HelperPermissions::canPublishItem($row->catid) && $row->published && $isNew) { $row->published = 0; $mainframe->enqueueMessage(JText::_('K2_YOU_DONT_HAVE_THE_PERMISSION_TO_PUBLISH_ITEMS'), 'notice'); } }
If I understand their model correctly, adding a check for $ isNew to the if statement will apply only post = 0 to new entries. Which, if I understand you, are the only ones you want to influence. Thus, if an article already exists and is published, it will always be published, unless the administrator changes it to unpublished.
I'm not sure if this will work the way I expect, so let me know.
source share