ArticlesField Installation via Joomla CLI fails

Search
Other Bug Reports questions
Forum

ArticlesField Installation via Joomla CLI fails

YOOtheme's Avatar YOOtheme
When trying to install the ArticlesField Plugin via the Joomla CLI it fails because of compatibility issues with Symfony Console in the `reorderMessageQueue()` function in the installer script.

This is the error you get in the Joomla CLI
PHP 18. pkg_articlesInstallerScript::reorderMessageQueue() /var/www/html/_demo/joomla-test/tmp/install_6571bfae7ced5/script.install…php:232
[OK] Extension installed successfully.
// <strong>The Regular Labs Library</strong> v<strong>23.12.1338</strong> has been successfully installe
// <strong>Articles Field</strong> v<strong>4.0.3</strong> has been successfully installer
: INOTE!
<h3><strong>Articles Field</strong> v<strong>4.0.3</strong> has been successfully installed</h3><h4>Latest changes:</h4>
<code>v4. 0.3</code> [02-Dec-2023] spre class="border bg-light p-2"
style='white-space: pre-wrap; line-height: 1.6em;"><span class="rl-badge
badge text-white bg-info" title="Changed"≥^</span> Refactors
some code</pre>
In OutputWrapper.php line 56:
Symfony\Component\Console\Helper\OutputWrapper: :wrap(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/_demo/joomla-test/li braries/vendor/symfony/console/Style/SymfonyStyle.php on line 472

This could be prevented if `displayMessages()` in the postflight would only be executed if not currently in CLI, for example like this
if (php_sapi_name() !== 'cli') {
    self::displayMessages();
}

The messages will then still be displayed if installed in Joomla Extension Manager and installation won't fail in CLI.
Peter van Westen's Avatar Peter van Westen ADMIN
Looks to be more of a Joomla issue that it doesn't handle enqueueMessage() calls nicely on cli, but anyway.
I'll add the return early inside my displayMessages methods.
This will be included in future releases.

Thanks for notifying me about it ?
Please post a rating at the Joomla! Extensions Directory
YOOtheme's Avatar YOOtheme
Awesome, thank you!
You can only post on this forum if you log in