Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deprecation message for null value #479

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,12 @@ class="one-third" value="<?= $settings['smtp_port'] ?>" />

<?php
// Get latest version from admin table
$latestVersion = $settings['latest_version'];
$hasUpdate = version_compare($version, $latestVersion) == -1;
if (!is_null($settings['latest_version'])) {
$latestVersion = $settings['latest_version'];
$hasUpdate = version_compare($version, $latestVersion) == -1;
} else {
$hasUpdate = false;
}

// find unused upload logos

Expand Down
2 changes: 1 addition & 1 deletion includes/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
$version = "v2.21.0";
$version = "v2.21.1";
?>
20 changes: 13 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@

<section class="contain">
<?php
if ($isAdmin && $settings['update_notification'] && version_compare($version, $settings['latest_version']) == -1) {
?>
<div class="update-banner">
<?= translate('new_version_available', $i18n) ?>: <span><?= $settings['latest_version'] ?></span>
</div>
<?php
if ($isAdmin && $settings['update_notification']) {
if (!is_null($settings['latest_version'])) {
$latestVersion = $settings['latest_version'];
if (version_compare($version, $latestVersion) == -1) {
?>
<div class="update-banner">
<?= translate('new_version_available', $i18n) ?>: <span><?= $latestVersion ?></span>
</div>
<?php
}
}
}
?>

Expand Down Expand Up @@ -219,7 +224,8 @@
id="sort-category_id"><?= translate('category', $i18n) ?></li>
<li <?= $sortOrder == "payment_method_id" ? 'class="selected"' : "" ?>
onClick="setSortOption('payment_method_id')" id="sort-payment_method_id">
<?= translate('payment_method', $i18n) ?></li>
<?= translate('payment_method', $i18n) ?>
</li>
<?php
if (!isset($settings['hideDisabledSubscriptions']) || $settings['hideDisabledSubscriptions'] !== 'true') {
?>
Expand Down
2 changes: 1 addition & 1 deletion migrations/000025.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;

if ($columnRequired) {
$db->exec('ALTER TABLE admin ADD COLUMN latest_version TEXT');
$db->exec("ALTER TABLE admin ADD COLUMN latest_version TEXT DEFAULT 'v2.21.1'");
}

$columnQuery = $db->query("SELECT * FROM pragma_table_info('admin') where name='update_notification'");
Expand Down
3 changes: 3 additions & 0 deletions scripts/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ function toggleUpdateNotification() {
.then(data => {
if (data.success) {
showSuccessMessage(data.message);
if (notificationEnabled === 1) {
fetch('endpoints/cronjobs/checkforupdates.php');
}
} else {
showErrorMessage(data.message);
}
Expand Down