joomla/joomla-cms — pull request #4798 by joomdonation (2014-10-17 16:12:30+00:00)
Title: Fix "Save as copy" button of User Group #4778

## PR summary

This PR fixes the issue #4778 reported by @apurvaduduskar. Basically, when you are on Joomla group edit screen, if you press "Save as Copy" button to create a new group without changing title, the system will throws an error message and doesn't create a copy group as expected.

I also fixed two ridiculous blocks of code at https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_users/models/group.php#L163 and https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_users/models/group.php#L201

## How to test:

Testing this PR is simple. You just need to login to administrator area of your site, then go to Users -> Groups, click on a group to edit (don't change group title), then press "Save as Copy" button in the toolbar:

1. Before patch: The system doesn't create the new group and throw an error message

2. After patch: The new group is created without error message. The title of the new group is created based on title of the original group and append an increment number: Group (2), Group (3)...