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

Improve hasUpdate checks and make sure we don't offer updates to outdated versions #25810

Merged
merged 7 commits into from Aug 23, 2019

Conversation

@zero-24
Copy link
Contributor

commented Aug 10, 2019

Summary of Changes

Improve hasUpdate checks and make sure we don't offer downgrades to outdated versions

Testing Instructions

  • check for updates
  • go to the database table #__updates
  • manually change the core update versions collum to a lower version than the current.
  • go to the updater page (don't hit refresh)
  • see the message to update to an lower version than installed

Expected result

When we have an old version in the cache joomla says it runs the latest version

Actual result

When we have an older version in the cache Joomla wants to update to that version.

Documentation Changes Required

none

Additional info

The behavior we build by manually changing the database table can happen in case there is some caching of the old version of the update for some reason. one of many examples (german): https://forum.joomla.de/thread/8109-joomla-update-wird-nicht-angeboten-bzw-falsches-update-3-9-10/

zero-24 added 3 commits Aug 10, 2019
@zero-24 zero-24 changed the title [4.0] Improve hasUpdate checks and make sure we don't offer updates to outdated versions [3.9] Improve hasUpdate checks and make sure we don't offer updates to outdated versions Aug 10, 2019
@franz-wohlkoenig franz-wohlkoenig changed the title [3.9] Improve hasUpdate checks and make sure we don't offer updates to outdated versions Improve hasUpdate checks and make sure we don't offer updates to outdated versions Aug 11, 2019
$ret['latest'] = $updateObject->version;
$ret['hasUpdate'] = $updateObject->version != JVERSION;
// Check whether this is an valid update or not
if (version_compare($updateObject->version, JVERSION) === -1)

This comment has been minimized.

Copy link
@mbabker

mbabker Aug 11, 2019

Member

Use version_compare() with three arguments, i.e. version_compare($updateObject->version, JVERSION, '<='). I've been writing PHP for 10 years and I couldn't tell you a thing about any of the return values of version_compare(), whereas specifying the comparison as the third parameter makes it crystal clear what you're intending here.

This comment has been minimized.

Copy link
@zero-24

zero-24 Aug 11, 2019

Author Contributor

has been patched thanks 👍

zero-24 added 2 commits Aug 11, 2019
@richard67

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2019

I have tested this item successfully on a5f0ef2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810.

1 similar comment
@alikon

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

I have tested this item successfully on a5f0ef2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810.

@alikon

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810.

@joomla-cms-bot joomla-cms-bot added the RTC label Aug 12, 2019
@wilsonge wilsonge added this to the Joomla! 3.9.12 milestone Aug 12, 2019
zero-24 and others added 2 commits Aug 12, 2019
Co-Authored-By: Richard Fath <richard67@users.noreply.github.com>
@richard67

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

I have tested this item successfully on dcf8c97


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25810.

@richard67

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

Last change was only a code comment correction so @alikon 's test result is still valid.

@HLeithner

This comment has been minimized.

Copy link
Member

commented Aug 23, 2019

Thank you for stop downgrading offers.

@HLeithner HLeithner merged commit b89a64c into joomla:staging Aug 23, 2019
4 of 5 checks passed
4 of 5 checks passed
JTracker/HumanTestResults Human Test Results: 1 Successful 0 Failed.
Details
Hound No violations found. Woof!
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/drone/pr Build is passing
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@joomla-cms-bot joomla-cms-bot removed the RTC label Aug 23, 2019
@zero-24 zero-24 deleted the zero-24:improveHasUpdate branch Aug 23, 2019
alikon added a commit to alikon/joomla-cms that referenced this pull request Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.