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
Skip activate task in fields system plugin #15308
Conversation
plugins/system/fields/fields.php
Outdated
@@ -118,6 +118,14 @@ public function onUserAfterSave($userData, $isNew, $success, $msg) | |||
|
|||
$user = JFactory::getUser($userData['id']); | |||
|
|||
$task = JFactory::getApplication()->input->get('task'); |
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.
get -> getCmd ? :)
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.
Change one line and 10 developers have a comment, change 1000 all say great :-)
cmd is the default.
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.
We don't read 1000 lines, we just hope you know what you're doing before you submit the PR 😝
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.
@rdeutz i know, but we are already mixing up between getCmd and get .. (most are getCmd, we should be more consistent :P)
I have tested this item ✅ successfully on 8e66e18 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15308. |
I have tested this item ✅ successfully on f6126d3 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15308. |
@AlexRed can you please retest? |
plugins/system/fields/fields.php
Outdated
$task = JFactory::getApplication()->input->getCmd('task'); | ||
|
||
// Skip fields save when we activate a user, because we will lose the saved data | ||
if ($task === 'activate') |
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.
can you add here || $task === 'block
as it also doesn't work when Enabling the user
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.
Yes, I can confirm, block the user empties custom fields
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.
added block and unblock to the skipped tasks
I guess for now, we are good to go. But this issue revealed a problem which I'm discussing right now with @Bakual to find a proper solution. The we will probably revert that change 🙊 |
I have tested this item ✅ successfully on e15aad7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15308. |
Never ever I will merge it ;-) |
I think for this case the fix is fine anyway. Regardless if we need some handling elsewhere as well. |
* skip active task * too make yves happy * added block and unblock to the skip actions
Pull Request for Issue #15194
Summary of Changes
When activating a account we don't need to process the field check/save procedure
Testing Instructions
Data get's lost
Apply patch and do the same process
Data will not get lost