JVERSION-RELEASE-001
JVersion::RELEASE
JVersion::RELEASE / DEV_LEVEL / BUILD
The old version constants were removed. JVERSION string still exists but RELEASE/DEV_LEVEL/BUILD do not.
JVersion::RELEASE → MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION
What you will see
- Undefined class constant RELEASE
- Undefined class constant DEV_LEVEL
Symptoms people search
version check always wrong · JVersion::RELEASE
Replace this code
Swap JVersion::RELEASE for MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION.
Joomla 3
Remove or stop calling this
if (JVERSION == '3.10') {}
echo JVersion::RELEASE . '.' . JVersion::DEV_LEVEL;Joomla 4 / 6
Use this instead
use Joomla\CMS\Version;
if (Version::MAJOR_VERSION === 4) {}
echo Version::MAJOR_VERSION . '.' . Version::MINOR_VERSION;How to fix it
- 1Use Version::MAJOR_VERSION / MINOR_VERSION / PATCH_VERSION.
- 2Do not parse JVERSION as a Joomla 3 string.
Also known as
JVersion::RELEASE · DEV_LEVEL · JVERSION
Related issues
- Joomla 3 → 4Joomla API
JRequest::getVar() and the whole JRequest API
JRequest::getVar() → $app->getInput()->get('id')
- Joomla 3 → 4Joomla API
JError / JException
JError::raiseError() → throw new RuntimeException() / try-catch
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Joomla API
Factory::getUri()
JFactory::getUri() → Uri::getInstance()
- Joomla 3 → 4Joomla API
Factory::getXml() / JXMLElement
JFactory::getXML() → SimpleXMLElement
- Joomla 3 → 4Joomla API
Factory::getEditor()
JFactory::getEditor() → Editor::getInstance()