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
Comment #1
travisc commentedTested, this patch works.
Comment #2
aspilicious commentedI 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)));
Comment #3
Rory commentedNew 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.
Comment #4
tim.plunkettCoding style nitpick only, otherwise this fixed the problem and seems RTBC.
There needs to be a space after (int) before $endpoint.
Comment #5
Rory commentedOK fixed, thanks. Here's the updated patch.
Comment #6
Rory commentedComment #7
aspilicious commentedI 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...