Skip to content
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

Merged
merged 3 commits into from Apr 15, 2017
Merged

Conversation

rdeutz
Copy link
Contributor

@rdeutz rdeutz commented Apr 14, 2017

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

  • Add a text field to a user e.g. Company
  • Register a user (have set: New user account activation to administrator)
  • process the activation

Data get's lost

Apply patch and do the same process

Data will not get lost

@@ -118,6 +118,14 @@ public function onUserAfterSave($userData, $isNew, $success, $msg)

$user = JFactory::getUser($userData['id']);

$task = JFactory::getApplication()->input->get('task');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get -> getCmd ? :)

Copy link
Contributor Author

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.

Copy link
Contributor

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 😝

Copy link
Member

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)

@AlexRed
Copy link
Contributor

AlexRed commented Apr 14, 2017

I have tested this item ✅ successfully on 8e66e18

Patch ok for me


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15308.

@ghost
Copy link

ghost commented Apr 15, 2017

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.

@ghost
Copy link

ghost commented Apr 15, 2017

@AlexRed can you please retest?

$task = JFactory::getApplication()->input->getCmd('task');

// Skip fields save when we activate a user, because we will lose the saved data
if ($task === 'activate')
Copy link
Member

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

Copy link
Contributor

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

Copy link
Contributor Author

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

@laoneo
Copy link
Member

laoneo commented Apr 15, 2017

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 🙊

@laoneo
Copy link
Member

laoneo commented Apr 15, 2017

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.

@rdeutz
Copy link
Contributor Author

rdeutz commented Apr 15, 2017

we will probably revert that change

Never ever I will merge it ;-)

@Bakual Bakual merged commit cea4b85 into joomla:staging Apr 15, 2017
@Bakual
Copy link
Contributor

Bakual commented Apr 15, 2017

I think for this case the fix is fine anyway. Regardless if we need some handling elsewhere as well.

@rdeutz rdeutz deleted the fix_15194 branch April 15, 2017 16:38
rdeutz added a commit to joomlajenkins/joomla-cms that referenced this pull request May 1, 2017
* skip active task

* too make yves happy

* added block and unblock to the skip actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants