Permalink
Browse files

Correctly trigger the "saveNewPassword" hook (see #5247)

  • Loading branch information...
leofeyer committed Jan 30, 2013
1 parent c680e7f commit 028b51a5f953de9c72cf199fa01ead4b4693c93d
View
@@ -4,6 +4,9 @@ Contao Open Source CMS Changelog
Version 2.11.9 (2013-XX-XX)
---------------------------
+### Fixed
+Correctly trigger the "saveNewPassword" hook (see #5247).
+
### Fixed
Consider the `save_callback` of the password field in `tl_user` when a back end
user is forced to change his password (see #5138).
@@ -436,7 +436,7 @@ protected function row($strPalette=null)
}
return '
-<div' . ($arrData['eval']['tl_class'] ? ' class="' . $arrData['eval']['tl_class'] . '"' : '') . '>' . $objWidget->parse() . $datepicker . $updateMode . (!$objWidget->hasErrors() ? $this->help($strHelpClass) : '') . '

This comment has been minimized.

Show comment Hide comment
@aschempp

aschempp Jan 30, 2013

Member

Why did you remove datepicker here/in this commit??

@aschempp

aschempp Jan 30, 2013

Member

Why did you remove datepicker here/in this commit??

This comment has been minimized.

Show comment Hide comment
@leofeyer

leofeyer Jan 30, 2013

Owner

Sorry, didn't notice it. The variable is not used anymore but its removal certainly has nothing to do with the callback fix :(

@leofeyer

leofeyer Jan 30, 2013

Owner

Sorry, didn't notice it. The variable is not used anymore but its removal certainly has nothing to do with the callback fix :(

+<div' . ($arrData['eval']['tl_class'] ? ' class="' . $arrData['eval']['tl_class'] . '"' : '') . '>' . $objWidget->parse() . $updateMode . (!$objWidget->hasErrors() ? $this->help($strHelpClass) : '') . '
</div>';
}
@@ -408,8 +408,8 @@ public function addIcon($row, $label, DataContainer $dc, $args)
*/
public function setNewPassword($strPassword, $user)
{
- // Return if there is no user (e.g. upon registration)
- if (!$user)
+ // Return if there is no user (e.g. upon registration) (see #5247)
+ if (TL_MODE != 'FE' || !$user)

This comment has been minimized.

Show comment Hide comment
@aschempp

aschempp Feb 7, 2013

Member

Damn, we just noticed this is wrong! It should be TL_MODE == 'FE' !

@aschempp

aschempp Feb 7, 2013

Member

Damn, we just noticed this is wrong! It should be TL_MODE == 'FE' !

This comment has been minimized.

Show comment Hide comment
@leofeyer

leofeyer Feb 8, 2013

Owner

This cannot be correct either, because the callback would never be triggered by the registration module then.

@leofeyer

leofeyer Feb 8, 2013

Owner

This cannot be correct either, because the callback would never be triggered by the registration module then.

This comment has been minimized.

Show comment Hide comment
@aschempp

aschempp Feb 8, 2013

Member

The registration module triggers the hook itself. The save_callback is only used to trigger the hook in the backend.

@aschempp

aschempp Feb 8, 2013

Member

The registration module triggers the hook itself. The save_callback is only used to trigger the hook in the backend.

This comment has been minimized.

Show comment Hide comment
@leofeyer

leofeyer Feb 8, 2013

Owner

No, it does not. It only triggers the save_callback. Please check the code.

@leofeyer

leofeyer Feb 8, 2013

Owner

No, it does not. It only triggers the save_callback. Please check the code.

This comment has been minimized.

Show comment Hide comment
@aschempp

aschempp Feb 8, 2013

Member

Uhm, is this Contao 2.11 or 3 branch?
Anyway, the save_callback is important in the backend, that is why it's here...

@aschempp

aschempp Feb 8, 2013

Member

Uhm, is this Contao 2.11 or 3 branch?
Anyway, the save_callback is important in the backend, that is why it's here...

{
return $strPassword;
}
@@ -184,8 +184,8 @@ protected function compile()
}
}
- // Save callback
- if (is_array($arrData['save_callback']))
+ // Save callback (see #5247)
+ if (!$objWidget->hasErrors() && is_array($arrData['save_callback']))
{
foreach ($arrData['save_callback'] as $callback)
{

0 comments on commit 028b51a

Please sign in to comment.