?
avatar jschmi102
jschmi102
1 Aug 2020

Steps to reproduce the issue

code:

  1. use Joomla\CMS\Version;

  2. $this->joomla_version = new Version();

  3. if (version_compare($this->joomla_version->RELEASE, '3.4', '<'))

Expected result

should return or check current version

Actual result

Undefined property: Joomla\CMS\Version::$RELEASE in ...

System information (as much as possible)

Additional comments

pls. clarify how to do version (release) checking with joomla V4

avatar jschmi102 jschmi102 - open - 1 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 1 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Aug 2020
avatar joomdonation
joomdonation - comment - 1 Aug 2020

In your step 3 above, change code to:

if (version_compare($this->joomla_version->getShortVersion(), '3.4', '<'))

It should work.

avatar SharkyKZ
SharkyKZ - comment - 1 Aug 2020

https://api.joomla.org/cms-3/classes/Joomla.CMS.Version.html

RELEASE constant has been removed. You can get the same value using MAJOR_VERSION and MINOR_VERSION constants. Magic __get() method for accessing constants as properties also removed. Use constants directly. Exact replacement for your code is:

if (version_compare($this->joomla_version::MAJOR_VERSION . '.' . $this->joomla_version::MINOR_VERSION, '3.4', '<'))
avatar richard67 richard67 - change - 1 Aug 2020
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2020-08-01 14:08:24
Closed_By richard67
avatar richard67 richard67 - close - 1 Aug 2020
avatar richard67
richard67 - comment - 1 Aug 2020

Closing as expected behavior. Check previous comments for the reasons.

But thanks for reporting it, better one false report than one report missing for a real bug.


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

Add a Comment

Login with GitHub to post a comment