Skip to content

Commit

Permalink
GFCV-72 1.10.3-beta - Upgrader test
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-iris committed Nov 18, 2024
1 parent bbef435 commit 40947d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gf-civicrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Requires plugins: civicrm, gravityforms
* Author: Agileware
* Author URI: https://agileware.com.au
* Version: 1.10.2
* Version: 1.10.3-beta
* Text Domain: gf-civicrm
*
* Copyright (c) Agileware Pty Ltd (email : [email protected])
Expand Down
9 changes: 8 additions & 1 deletion includes/class-gf-civicrm-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct( $plugin_file ) {
] );

$this->plugin_uri = $plugin_data['PluginURI'];
$this->plugin_update_uri = 'https://api.github.com/repos/' . GF_CIVICRM_PLUGIN_GITHUB_REPO . '/releases/latest';
$this->plugin_update_uri = 'https://api.github.com/repos/' . GF_CIVICRM_PLUGIN_GITHUB_REPO . '/releases?per_page=5'; // GFCV-72 Temp. Allow prereleases for upgrader.
$this->plugin = plugin_basename( $plugin_file );
$this->name = $plugin_data['PluginName'];
$this->slug = basename( dirname( $plugin_file ) );
Expand Down Expand Up @@ -242,6 +242,13 @@ private function get_update_info_from_remote() {
return false;
}

// Run through the returned releases (including prereleases) and get the latest release by semantic tag
foreach ( $data as $release ) {
if ( $release->prerelease && version_compare( $this->version, $release->tag_name, '<' ) ) {
return $release;
}
}

return $data;
}

Expand Down

0 comments on commit 40947d3

Please sign in to comment.