6

The "Authors" group doesn't have any publish rights. This is ok. So an Editor/Administrator does an initial approve of any article.

Problem comes if the Author decides to edit the already published article. When he hit "save" from the frontend, the item immediately becomes unpublished.(Because authors group doesn't have the right to publish items). So, this a huge problem at least for my case.

I want articles to remain published after the initial approval of the admin, even if the author makes adjustments. Any idea how to do something like this?

This logic comes as the default way of doing things in the Joomla Core.

ktharsis
  • 3,160
  • 1
  • 19
  • 30
George D.
  • 1,630
  • 4
  • 23
  • 41
  • In the admin backend, go to the K2 component, then Parameters, then click the Permissions tab, and under Author, try setting "Edit State" to "Allowed". Not 100% sure if this will work but worth giving it a shot. – Lodder Nov 10 '12 at 13:43
  • Noop, I already played around with all of these settings. My Authors setup is everything set to "YES" except the last 2 options of "EDIT ANY ITEM","PUBLISH ITEMS". I believe its a logic issue, one more option is mission here, something like "EDIT ITEMS AND KEEP THEM PUBLISHED" – George D. Nov 10 '12 at 16:34
  • Hmmm.... it seems like your workflow is counter intuitive... if an author writes an article then it gets approved by the admin it gets published. But then if the author comes back they can change anything they want, do things to break template, add inappropriate information or whatever but you don't want to have to re-approve their changes? I believe the system was designed this way for a good reason. You may want to consider that it's a good idea for an admin to have to approve changes.If you don't want to re-approve changes why approve at all? You might as well give them author privs.... – Cleanshooter Nov 20 '12 at 21:03
  • Its simple. My site is a magazine of a non profit organization, so Authors are simple people and simple people can make a lot of syntax mistakes/vocabulary/typo mistakes. I agree with you that its logical to don't allow an author to publish things at all times. So the most professional approach would be to allow them to make changes but never publish ( the changes) until the admin approves them. All this time the article must stay only though. This is my problem. Its not cool to have publish/unpublished items because of minor adjustments. – George D. Nov 20 '12 at 22:24
  • I have 30 Authors and the really important thing here is the initial approval and publish.I repeat that this is a DEFAULT way the Joomla core handles articles. If something is published and an author edit it, it remains published. I want exactly that but most probably I have to custom code it. – George D. Nov 20 '12 at 22:27

4 Answers4

2

You may want to consider switching from K2 to something like else like EasyBlog then... Or just don't use K2. It seems like the default for K2 is to follow a workflow that conflicts with yours.

Otherwise you can modify K2 to suit your needs... I really don't recommend modifying extensions because then you can no longer make updates to them unless you plan to make the modifications every time you update (which is a pain).

You problem resides in the administrator/components/com_k2/models/item.php The following lines are form 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 like:

    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 right by adding a check for $isNew to the if statement it will only apply published = 0 to new entries. Which, if I understand you, are the only ones you want to affect. This way if if the article already exists and it's published it will always stay published unless an admin changes it to unpublished.

I'm not sure if this will work the way I expect so let me know.

Cleanshooter
  • 2,314
  • 4
  • 19
  • 29
1

You should either allow Authors to edit any item or disable option for editing articles for authors.

Nutic
  • 1,407
  • 4
  • 16
  • 31
  • You are telling me things that I already know and want to avoid. I don't want to make my Authors => Editors and I want them to have the ability to edit their own items at any time. – George D. Nov 18 '12 at 08:52
1

Go to your joomla administration, go to k2 menu and in User Groups tabs create a group called editors and give it access to Publish item, then go back to Users tab and put those users that you want to make them editor in editors group.

Make sure your editor group users have access to Front-end item editing and Edit any item.

Your problem is because your editors have Edit any item access but they don't access to Publish item.

Farid Rn
  • 3,167
  • 5
  • 39
  • 66
  • if this is the case, why to create a new user group and don't alter the "authors" group permissions? Doesn't seem logical but I'll try it anyway. – George D. Nov 25 '12 at 16:52
  • Also I am talking about Authors here. Authors Should not edit or publish other Authors articles. Just their own. Authors are not Editors or Admins. – George D. Nov 25 '12 at 16:59
  • @GeorgeD. go to K2 user groups, create as much groups as you need, you can limit them to specific categories and manage their access levels (only add, edit own, edit any item, publish, etc.) – Farid Rn Nov 26 '12 at 17:21
0

The permission that you want to set is actually in the k2 user group settings. Look for Allow editing of already published items and set it to yes.

At least this is true for k2 v. 2.6.7, although I don't think any of the permission settings have changed since v.2.6.0 or earlier.

eglescout
  • 31
  • 2