dml73:
I updated to version 1.4.1-beta1 (includes/modules/shipping/upsoauth.php), but the message in admin -> Modules -> Shipping Modules still shows - NOTE: A NEW VERSION OF THIS PLUGIN IS AVAILABLE. [Details]
Am I missing something?
You're not missing anything. The notice comes from Zen Cart core, not the module. plugin_version_check_for_updates() compares the Plugins Library version to yours with strcmp(), which compares text instead of numbers. If the library listing is typed as "v1.4.0" (or anything else that doesn't sort like a plain number), it always looks "newer" than the installed version, so the notice never goes away.
Until it's fixed in an official release, you can patch includes/modules/shipping/upsoauth.php. Find this line:
$new_version_details = plugin_version_check_for_updates(self::ZEN_CART_PLUGIN_ID, $this->moduleVersion);
Right after it, add:
if ($new_version_details !== false) {
$listed_version = '';
if (preg_match('/\d+(?:\.\d+)*/', (string)($new_version_details['latest_plugin_version'] ?? ''), $matches) === 1) {
$listed_version = $matches[0];
}
if ($listed_version === '' || version_compare($listed_version, $this->moduleVersion, '<=')) {
$new_version_details = false;
}
}
This re-checks the listed version numerically and shows the notice only when the library version really is higher. A genuine future release will still trigger it.
If you'd rather not edit the file, setting the module's Update Check to "Never" hides the notice. You just won't get update alerts for this module.
The attached upsoauth.php is 1.4.0 with this fix applied. I haven't looked at 1.4.1-beta1, so if you're on the beta, add the snippet above to your file rather than replacing it with this one.
marcopolo
Zen Cart 2.2.2 | PHP 8.5.11 | MariaDB 10.11.14