Search
Other ReReplacer questions
Forum

Any update to version 4 causes Regular Labs classes to not load

Alex Chartier's Avatar Alex Chartier
I was testing my J5 upgrade and updated all of my Regular Lab components. As soon as I did so none of the RL components worked. When I say not working, my ReReplacer replacement was not processed. Using PHPStorm I found that the classes were not being found. For example RegularLabs\Plugin\System\ReReplacer\Replace is not found by the class loader. I see it in the administrator/cache/autoload_psr4.php file and it points to the correct place, but for some reason it isn't being found.

I have cleared J! cache, I have restarted Apache, I have deleted the autoloader_psr4 file all to no avail.

I started over restoring a fresh copy of the site and updated only ReReplacer. It immediately broke.

Prior to upgrade ReReplacer package was at 12.8.2Pro and the Regular Labs Library was at 23.7.2101. I installed ReReplacer 14.0.2Pro via the J! updater and the Library updated to version 23.10.1235.

If it matters the J! version I am currently running is 4.3.4 and php is 8.1.22

Any pointers on how I can figure out what is going on?
Peter van Westen's Avatar Peter van Westen ADMIN
Did you update the extensions before upgrading to Joomla 5?
Please post a rating at the Joomla! Extensions Directory
Alex Chartier's Avatar Alex Chartier
I tied both actually. First I updated to J5 and got the warning from your extensions so then updated them, got the issue. I then tried starting with J4 and updating to the latest release of ReReplacer and got the same problem. At that point I stopped and reported it.
Peter van Westen's Avatar Peter van Westen ADMIN
I recommend you uninstall ReReplacer and the Regular Labs Library package.
Then reinstall ReReplacer.
Please post a rating at the Joomla! Extensions Directory
Alex Chartier's Avatar Alex Chartier
Did that, no change. Uninstalled ReReplacer and Library packages, downloaded and installed latest 14.0.3Pro, both ReReplacer and package were updated to latest versions, cleared browser cache, cleared J! cache, restarted Apache. Same issue.

This is a restoration of a working J4 site. The only change was to install the latest ReReplacer and library.

I can give you access if you wish.
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
Alex Chartier's Avatar Alex Chartier
Details in confidential section.

I don't have an ftp server on this system but I have provided ssh access.
Confidential information:
(hidden)
Alex Chartier's Avatar Alex Chartier
Just remembered I had to disable my geoprotection.
Peter van Westen's Avatar Peter van Westen ADMIN
The credentials do not give me access to the administrator side...
Please post a rating at the Joomla! Extensions Directory
Alex Chartier's Avatar Alex Chartier
Strange. I have reset the credentials and verified I can log in with them. See below.

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
So how/where can I see the issue?

Please make sure you upgrade to Joomla 4.4.0 before trying to upgrade to Joomla 5.

If you still get the error, please give me access to the site I can see that error on.
Please post a rating at the Joomla! Extensions Directory
Alex Chartier's Avatar Alex Chartier
Just log into the front end. You will see the issue immediately when it shows {source 0}. That article includes a ReReplacer tag which is not getting processed.
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases

This should be fixed... however, I see you are using Sourcerer to execute PHP code in the replacement fields.
But ReReplacer Pro supports PHP code built in.

So instead of doing something like:
{source} 
<?php
require_once( JPATH_BASE . '/custom_scripts/sourcerer/makeblogtabs.php' );
echo call_user_func('make_blogtabs', array_map('trim',explode(",", trim("\1"))), "publish_up");
?>
{/source}
You can simply switch on the 'Replace with PHP' option and do:
<?php
require_once( JPATH_BASE . '/custom_scripts/sourcerer/makeblogtabs.php' );
echo call_user_func('make_blogtabs', array_map('trim',explode(",", trim("\1"))), "publish_up");
?>
Please post a rating at the Joomla! Extensions Directory
Alex Chartier's Avatar Alex Chartier
That fixed the problem. I assume then you did discover a bug?

I know I can use the PHP option of ReReplacer but I do not need any of the Pro Features of it at the moment. I upgraded it to Pro when I purchased a bundle for the J4 upgrade. At some future date when my Sub expires and I need to update ReReplacer I will be fine to use the non-Pro version. If I went ahead and made the change as suggested everything would break when I did that.

The joys of working for a non-profit.

Thanks for the help.
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription