I just upgraded a site to Joomla 4 on PHP 8.1. All extensions were up-to-date before the process started. I'm now getting an error message on a page that relies heavily on ReReplacer that says "RegularLabs\Library\RegEx::replace(): Return value must be of type string, null returned". Since I didn't change anything on the page, I wasn't sure why I was getting this error.
I cannot access the frontend. It keeps saying my account is pending approval. And I get an email (after changing it to mine) without an activation url.
I added you as a temp super user through Akeeba AdminTools. Apparently, Community Builder didn't sync causing the login issue. I created a new user for you and tested it this time to make sure it worked. Sorry about that! Login and FTP credentials below...
It looks like this is due to php memory limits (for Regular Expressions) on your server.
You have a LOT of content inside the {source} tags, which the Sourcerer needs to grab (via Regular Expressions).
I recommend you make the content part smaller and/or increase the php memory limit in the server settings for php.
Split very long parts of content you want Sourcerer to control in shorter parts. So using multiple {source} blocks.
Also, the majority of the content seems to be pretty standard html. Why use Sourcerer to output that at all? You could just place that in the html view of the editor.
Only surround the parts of the content with {source} tags for which you actually need Sourcerer.
Thanks for your insight. I minimized the {source} tags to only encapsulate code where it was needed. I also moved CSS and JS to external files and use the linked method to add to my page. This has removed the initial error, but that has created an ordering problem (I think). I get a jQuery error (not defined) on the page. When I look at the page source, I see my linked script at the top of all the scripts, and jQuery (handled by jQuery Easy Profiles) is loaded several below it. Also the Email Protector is mishandling the email link outputs (look for an envelope icon).
The reason I decided to use ReReplacer for all of this was because this was a massive copy/paste project and I wanted to remove as much clutter from the page as possible. My plan for the future is to take all of that data, store it in the database, and just use a loop to output everything.
The jQuery error has nothing to do with Sourcerer (or ReReplacer).
Sourcerer doesn't control how or if scripts work. It just makes sure they are placed/loaded.