code:
use Joomla\CMS\Version;
$this->joomla_version = new Version();
if (version_compare($this->joomla_version->RELEASE, '3.4', '<'))
should return or check current version
Undefined property: Joomla\CMS\Version::$RELEASE in ...
pls. clarify how to do version (release) checking with joomla V4
Labels |
Added:
?
|
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', '<'))
Status | New | ⇒ | Expected Behaviour |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-08-01 14:08:24 |
Closed_By | ⇒ | richard67 |
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.
In your step 3 above, change code to:
if (version_compare($this->joomla_version->getShortVersion(), '3.4', '<'))
It should work.