Joomla issueshttps://lab.civicrm.org/dev/joomla/-/issues2024-02-12T17:51:40Zhttps://lab.civicrm.org/dev/joomla/-/issues/54Joomla 5 compatibility2024-02-12T17:51:40Zchrisgaraffachris@aghstrategies.comJoomla 5 compatibilityWe started a small discussion about J5 compatibility on Mattermost recently in the context of people still doing J4 upgrades: https://chat.civicrm.org/civicrm/pl/t9sywefr1jrainqbww9x7etb7y
With a fresh installation of J5 in a supported ...We started a small discussion about J5 compatibility on Mattermost recently in the context of people still doing J4 upgrades: https://chat.civicrm.org/civicrm/pl/t9sywefr1jrainqbww9x7etb7y
With a fresh installation of J5 in a supported environment (PHP 8.1.2, Ubuntu 22.04, MariaDB 10.6), CiviCRM requires one patch to properly finish installation in com_civicrm/admin/civicrm/vendor/psr/log/Psr/Log/NullLogger.php, changing the method signature of log to specify a void return type and the type for $message:
``` diff
diff --git a/NullLogger.php b/NullLogger.php
index c8f7293..39c3969 100644
--- a/NullLogger.php
+++ b/NullLogger.php
@@ -23,7 +23,7 @@ class NullLogger extends AbstractLogger
*
* @throws \Psr\Log\InvalidArgumentException
*/
- public function log($level, $message, array $context = array())
+ public function log($level, \Stringable|string $message, array $context = array()) : void
{
// noop
}
```
This is from the [psr/log library](https://packagist.org/packages/psr/log). Joomla 5 is using version 3, Civi seems to be on 1.x.
After that update and manually repackaging the nightly installer for Joomla, the installation finishes and basic functionality seems to work.
However, union types (`\Stringable|string`) are [not supported before PHP 8.0](https://www.php.net/manual/en/language.types.declarations.php). We're supporting PHP 7.3 for just a little while longer and I imagine 7.4 for quite some time after that. [Joomla 5 requires PHP 8.1](https://docs.joomla.org/Portal:Joomla_5) so this puts Civi in a difficult position for J5 compatibility as we can't just upgrade psr/log.Joomla 5 integrationseamusleeseamuslee