-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "Save as copy" button of User Group #4798
Conversation
Notice when I click on a group : Strict standards: Declaration of UsersModelGroup::generateNewTitle() should be compatible with JModelAdmin::generateNewTitle($category_id, $alias, $title) in C:\UwAmp\www\pizzabug\administrator\components\com_users\models\group.php on line 18 Time Memory Function Location1 0.0000 142976 {main}( ) ..\index.php:0 |
Thanks @1apweb for testing. I updated the PR to solve that notice error. Please help testing it again :). |
test was successful after installing patch |
Hi, Great, is ok now ! Thanks De : Tuan Pham Ngoc [mailto:notifications@github.com] Thanks @1apweb https://github.com/1apweb for testing. I updated the PR to solve that notice error. Please help testing it again :). — |
Thanks for both of you for your help :). |
Setting to RTC - thanks |
I get a 400 bad request error when applying this patch. Browser message: Browser : Chrome Joomla version:3.3.6 |
@test patch works as described ( tested via patch tester ) |
@wingchunneil: That might be something related to patch tester component. @ALL : Thanks for help testing @committer : Travis Failed, however it is not related to this PR, so this one can be merged. |
} | ||
} | ||
} | ||
|
||
if (JFactory::getApplication()->input->get('task') == 'save2copy') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the idea of getting input data from models. This should be done in the controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same method is used everywhere. Which doesn't make it correct but...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like it, too. However, in this method, there is no way for us to getting the task variable. I think this is not correct but it is still used in many places in Joomla core
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: