From 5fb1070d7e6f4a38232be79f16779eeb6a7b80c9 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 21 Nov 2019 16:54:12 -0500 Subject: [PATCH] Use PR number field as the "pr ID" --- modules/devshop/devshop_github/devshop_github.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/devshop/devshop_github/devshop_github.module b/modules/devshop/devshop_github/devshop_github.module index e0bb5fdca..de36c0f6a 100644 --- a/modules/devshop/devshop_github/devshop_github.module +++ b/modules/devshop/devshop_github/devshop_github.module @@ -1861,8 +1861,8 @@ function devshop_github_create_all_pr_environments($project_node) { $site_url = url("node/{$environment->site}", array('absolute' => true)); // Get PR ID, if it already has one. - if (!empty($environment->github_pull_request->pull_request_object->id)) { - $environment_pr_id = $environment->github_pull_request->pull_request_object->id; + if (!empty($environment->github_pull_request->number)) { + $environment_pr_id = $environment->github_pull_request->number; $environment_pr_slug = "pr{$environment_pr_id}"; } else { @@ -1900,7 +1900,7 @@ function devshop_github_create_all_pr_environments($project_node) { // If there IS PR data on this environment but the PR does NOT exist, queue the site for deletion. elseif ($environment_pr_id && empty($prs[$environment_pr_slug])) { - drush_log("PR environment $environment->name exists but PR has been closed. [$site_url]", "ok"); + drush_log("PR $environment_pr_id environment $environment->name exists but PR has been closed. [$site_url] [PR Slug $environment_pr_slug]", "ok"); if ($project->settings->github['pull_request_environments_delete'] && empty($environment->tasks['delete'])) { drush_log("PR environment scheduled for deletion: $environment->name [$site_url]", "ok"); hosting_add_task($environment->site, 'delete', array('force' => 1));