[BUGFIX] Invalid and deprecated calls
authorXavier Perseguers <xavier@typo3.org>
Mon, 24 Oct 2011 11:18:29 +0000 (13:18 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 24 Oct 2011 21:15:06 +0000 (23:15 +0200)
Method sentCollectionToStage() of the ExtDirect action handler contains
invalid and deprecated calls.

Change-Id: I2063fb3ee274fefa7884dc96b907402c83392051
Fixes: #31217
Reviewed-on: http://review.typo3.org/6222
Reviewed-by: Steffen Gebert
Reviewed-by: Wouter Wolters
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/workspaces/Classes/ExtDirect/ActionHandler.php

index ca776f7..b0fc4be 100644 (file)
@@ -317,15 +317,16 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                $cmdMapArray = array();
                $comment     = $parameters->comments;
                $stageId     = $parameters->stageId;
-               $recipients  = $this->getRecipientList($parameters->receipients, $parameters->additional);
 
-               if (t3lib_div::testInt($stageId) === FALSE) {
-                       throw new InvalidArgumentException('Missing "stageId" in $parameters array.');
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($stageId) === FALSE) {
+                       throw new InvalidArgumentException('Missing "stageId" in $parameters array.', 1319488194);
                }
-
-               if (! is_array($parameters->affects) && count($parameters->affects) == 0) {
-                       throw new InvalidArgumentException('Missing "affected items" in $parameters array.');
+               if (!is_array($parameters->affects) || count($parameters->affects) == 0) {
+                       throw new InvalidArgumentException('Missing "affected items" in $parameters array.', 1319488195);
                }
+
+               $recipients  = $this->getRecipientList($parameters->receipients, $parameters->additional, $stageId);
+
                foreach ($parameters->affects as $tableName => $items) {
                        foreach ($items as $item) {
                                if ($stageId == Tx_Workspaces_Service_Stages::STAGE_PUBLISH_EXECUTE_ID) {