Skip to content

Commit

Permalink
Merge pull request #892 from ezsystems/ezp-22372-edit_wf_removed_user
Browse files Browse the repository at this point in the history
Fix EZP-22372: Workflow cannot be edited if you remove a user and/or a group
  • Loading branch information
yannickroger committed Feb 26, 2014
2 parents c98e521 + 498083a commit 29e32da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kernel/classes/workflowtypes/event/ezapprove/ezapprovetype.php
Expand Up @@ -378,13 +378,30 @@ function validateGroupIDList( $userGroupIDList, &$reason )
return $returnState;
}

/**
* @param eZHTTPTool $http
* @param $base
* @param eZWorkflowEvent $workflowEvent
* @param $validation
*
* @return bool|int
*/
function validateHTTPInput( $http, $base, $workflowEvent, &$validation )
{
$returnState = eZInputValidator::STATE_ACCEPTED;
$reason = array();

if ( !$http->hasSessionVariable( 'BrowseParameters' ) )
{
// No validation when deleting to avoid blocking deletion of invalid items
if (
$http->hasPostVariable( 'DeleteApproveUserIDArray_' . $workflowEvent->attribute( 'id' ) ) ||
$http->hasPostVariable( 'DeleteApproveGroupIDArray_' . $workflowEvent->attribute( 'id' ) )
)
{
return eZInputValidator::STATE_ACCEPTED;
}

// check approve-users
$approversIDs = array_unique( $this->attributeDecoder( $workflowEvent, 'approve_users' ) );
if ( is_array( $approversIDs ) and
Expand Down

0 comments on commit 29e32da

Please sign in to comment.