Search
Other Articles Anywhere questions
Forum

Articles Anywhere 15.0.4 fails on Joomla 5

Kay-Uwe Koalick's Avatar Kay-Uwe Koalick
Hallo,

I am currently testing my websites under Joomla 5 and have installed the latest RL extensions. Articles Anywhere Pro 15.0.4 unfortunately does not work (errors see below), with the direct predecessor version it still worked.

Errors:

# Function Location
1 () JROOT/plugins/system/articlesanywhere/src/DataGroups/Helpers/Text.php:487
2 array_keys() JROOT/plugins/system/articlesanywhere/src/DataGroups/Helpers/Text.php:487
3 RegularLabs\Plugin\System\ArticlesAnywhere\DataGroups\Helpers\Text::limitByWords() JROOT/plugins/system/articlesanywhere/src/DataGroups/Helpers/Text.php:378
4 RegularLabs\Plugin\System\ArticlesAnywhere\DataGroups\Helpers\Text::limit() JROOT/plugins/system/articlesanywhere/src/DataGroups/Helpers/Text.php:82
5 RegularLabs\Plugin\System\ArticlesAnywhere\DataGroups\Helpers\Text::process() JROOT/plugins/system/articlesanywhere/src/DataGroups/DataGroup.php:575
6 RegularLabs\Plugin\System\ArticlesAnywhere\DataGroups\DataGroup->postProcessText() JROOT/plugins/system/articlesanywhere/src/DataGroups/DataGroup.php:567
7 RegularLabs\Plugin\System\ArticlesAnywhere\DataGroups\DataGroup->postProcessOutput() JROOT/plugins/system/articlesanywhere/src/DataGroups/DataGroup.php:275
8 RegularLabs\Plugin\System\ArticlesAnywhere\DataGroups\DataGroup->getOutput() JROOT/plugins/system/articlesanywhere/src/DataTags/DataTag.php:92
9 RegularLabs\Plugin\System\ArticlesAnywhere\DataTags\DataTag->getOutput() JROOT/plugins/system/articlesanywhere/src/DataTags/DataTag.php:104
10 RegularLabs\Plugin\System\ArticlesAnywhere\DataTags\DataTag->replace() JROOT/plugins/system/articlesanywhere/src/DataTags/DataTags.php:98
11 RegularLabs\Plugin\System\ArticlesAnywhere\DataTags\DataTags->replace() JROOT/plugins/system/articlesanywhere/src/Article.php:71
12 RegularLabs\Plugin\System\ArticlesAnywhere\Article->render() JROOT/plugins/system/articlesanywhere/src/Articles.php:218
13 RegularLabs\Plugin\System\ArticlesAnywhere\Articles->render() JROOT/plugins/system/articlesanywhere/src/PluginTag.php:76
14 RegularLabs\Plugin\System\ArticlesAnywhere\PluginTag->render() JROOT/plugins/system/articlesanywhere/src/Replace.php:221
15 RegularLabs\Plugin\System\ArticlesAnywhere\Replace::replaceTagsInString() JROOT/plugins/system/articlesanywhere/src/Replace.php:208
16 RegularLabs\Plugin\System\ArticlesAnywhere\Replace::process() JROOT/plugins/system/articlesanywhere/src/Replace.php:93
17 RegularLabs\Plugin\System\ArticlesAnywhere\Replace::render() JROOT/plugins/system/articlesanywhere/articlesanywhere.php:197
18 PlgSystemArticlesAnywhere->changeFinalHtmlOutput() JROOT/libraries/regularlabs/src/SystemPlugin.php:155
19 RegularLabs\Library\SystemPlugin->onAfterRender() JROOT/libraries/src/Plugin/CMSPlugin.php:289
20 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454
21 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/vendor/joomla/application/src/AbstractApplication.php:99
Peter van Westen's Avatar Peter van Westen ADMIN
Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Confidential information' button in the forum editor to hide sensitive information.
Please post a rating at the Joomla! Extensions Directory
Kay-Uwe Koalick's Avatar Kay-Uwe Koalick
No, it is an internal XAMPP installation - just for testing Joomla 5. But I will see to install an instance on my public webserver. Not today - I will inform you ASAP. 🙂

Main error message: "0 array\_keys(): Argument #1 ($array) must be of type array, int given"
Kay-Uwe Koalick's Avatar Kay-Uwe Koalick
The errors also occur under Joomla 4.4.0 with PHP 8.2.4 when the RL extensions are updated to the newest versions.

Main error message: "0 array\_keys(): Argument #1 ($array) must be of type array, int given"

So I did some more tests:

In a new Joomla 4.4 instance with the latest Regular Labs extensions the error does NOT occur.

So I disabled all none-core extensions on the website in question, except for the latest Regular Labs extensions - the error occurs.

Then copied from my live website the directory: libraries > regularlabs to the test website - the error is gone.

Apparently there is a conflict with a library file that is important for Articles Anywhere. Which one? I haven't gotten that far yet. But maybe it is a hint.
Kay-Uwe Koalick's Avatar Kay-Uwe Koalick
With a trial and error test I found the file that causes this problem: StringHelper.php (version 23.10.17780)

A replacement with older version 23.8.22797 fix the problem for the moment.
Peter van Westen's Avatar Peter van Westen ADMIN
That doesn't help me track down what causes the error.

If you can reproduce this on an online environment to which I can get access, I am happy to look into this.
Please post a rating at the Joomla! Extensions Directory
Kay-Uwe Koalick's Avatar Kay-Uwe Koalick
Sorry, could not reproduce the error so far in a standard Joomla 4.4.0 installation. Looked at the error messages again instead.

The main error message was:
array\_keys(): Argument #1 ($array) must be of type array, int given

With system debugging enabled, there were lots of other error messages. The second one was:
array\_keys() | JROOT/plugins/system/articlesanywhere/src/DataGroups/Helpers/Text.php:487

Exactly in this file (Text.php) I made the following change in the given line 487, which was successful. 



I changed the code: $words = RL_String::countWords($string, 2);
to: $words[0] = RL_String::countWords($string, 2);

Perhaps this is more helpful for you.
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Kay-Uwe Koalick's Avatar Kay-Uwe Koalick
Works! Good job. 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
The new version has been released.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription