1) Create multiple endpoints.
2) Create a plan leaving at least one endpoint unchecked.
3) Attempt to deploy a node with this plan and you'll receive the following thrown error:

DeployPlanException: The plan MYPLAN can't be deployed because the endpoint 0 is invalid. in DeployPlan->deploy() (line 145 of /.../modules/deploy/includes/DeployPlan.inc).

The condition which checks each endpoint, finds those which were unchecked set to 0, and throws the error unnecessarily. Patch adds a condition to avoid throwing the error when an endpoint is set to 0:

          if ((int)$endpoint !== 0) {
            ...
          }

This allows deployment to proceed when an endpoint is excluded in a plan.

Comments

travisc’s picture

Tested, this patch works.

aspilicious’s picture

I would rather use "empty" instead of the (int) var !== 0 check.
And we should throw a warning in the case it is zero:

throw new DeployPlanException(t("The plan @plan can't be deployed, no endpoint is selected.", array('@plan' => $this->name)));

Rory’s picture

New patch is attached. Now using empty() wherever possible instead of an (int) var !== 0 check.

Also added your error to the patch which is thrown when endpoint/s are found but not loaded, because none were selected for the plan.

tim.plunkett’s picture

Status: Needs review » Needs work

Coding style nitpick only, otherwise this fixed the problem and seems RTBC.

+++ b/includes/DeployPlan.incundefined
@@ -142,9 +142,19 @@ class DeployPlan {
+          elseif ((int)$endpoint == 0) {

There needs to be a space after (int) before $endpoint.

Rory’s picture

OK fixed, thanks. Here's the updated patch.

Rory’s picture

Status: Needs work » Needs review
aspilicious’s picture

Status: Needs review » Fixed

I gave you commit credit!

Thnx! Now deploy actually works it would be awesome if you guys could yell if deploy, uuid or services broke something again.

http://drupalcode.org/project/deploy.git/commit/1c75645f848de24c5f83e3d4...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.