Error when trying to use focus builder in 4.4.3

Your software
My Mautic version is: 4.4.3
My PHP version is: 7.4 and 8.0
My Database type and version is: 5.7.39

Your problem
My problem is: Focus item builder does not work. Getting the following error message when clicking on the “builder button”

These errors are showing in the log: mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: “Argument 1 passed to MauticPlugin\MauticFocusBundle\Helper\IframeAvailabilityChecker::check() must be of the type string, null given, called in /home/xxx/xxx.entice.cloud/plugins/MauticFocusBundle/Controller/AjaxController.php on line 24” at /home/xxx/xxx.entice.cloud/plugins/MauticFocusBundle/Helper/IframeAvailabilityChecker.php line 27 {“exception”:“[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Argument 1 passed to MauticPlugin\MauticFocusBundle\Helper\IframeAvailabilityChecker::check() must be of the type string, null given, called in /home/xxx/xxx.entice.cloud/plugins/MauticFocusBundle/Controller/AjaxController.php on line 24 at /home/xxx/xxx.entice.cloud/plugins/MauticFocusBundle/Helper/IframeAvailabilityChecker.php:27)”}

Steps I have tried to fix the problem:checked forum to see if any other errors are similar. We have INTL support turned on.

Hi @gary.harrison

I have just gone ahead and updated our demo version to 4.4.3 (thanks for notifying me this is out :slight_smile: ).

We are running the following environment:
OS: Ubuntu
Release: 22.04
PHP: 8.0
Mautic: 4.4.3
DB: mysql Ver 15.1 Distrib 10.6.7-MariaDB

Unfortunately (or fortunately for us) we did not encounter similar errors as above. Are you seeing any console errors ?

Hi Mike,

I appreciate the response. Just a bit odd as we have instances using 4.3 that works just fine. Might be a conflict with a plugin as we have quite a few of those installed. Anyway - we will roll back to 4.3 for now…

Just a quick note - rebuilt my Mautic instance in 4.4.2 and it’s all working properly. Something definitely funny in 4.4.3. Could be related to custom plugins. Just need to reimport in all the contacts now :frowning:

1 Like

Hey @gary.harrison - not sure if you are making backups of files and DB before updating, if not here is a little script that we wrote to take care of this.
It makes a backup of mautic directory and of the DB, saves it and then runs the update.

If things fail as in your case above it is pretty simple to put back. We could probably extend the script to do this as well but don’t really have the need as of yet.

#!/bin/bash
# Date Created: 25 February 2022
# Author: Surge.Media

echo "Please input the full path of where your installation of Mautic is residing. Example /var/www/mautic"
read mautdir
echo "Creating a Backup Directory where the files will be stored" 
mkdir MAUTIC-BACKUP
currentdir=`pwd`
echo "Going ahead and making a tar backup of your mautic files"
cd $mautdir
tar -czvf mautic-backup-files.tar.gz *
echo "Moving backup files to the backup directory"
mv mautic-backup-files.tar.gz $currentdir/MAUTIC-BACKUP/

cd $currentdir/MAUTIC-BACKUP/

echo "What is the database name of your database?"
read mauticdb

echo "What is the username to access your mautic database?"
read mauticusername

echo "Does your DB have a password? (yes/no)"
read answer

if [[ $answer == "yes" ]]
then
        echo "What is the passord to the db"
        read password

        echo "Creating a backup of your DB"
        mysqldump -u $mauticusername $mauticdb -p$password | gzip > mautic-db-backup.sql.gz
else
        echo "Creating a backup of your DB"
        mysqldump -u $mauticusername $mauticdb | gzip > mautic-db-backup.sql.gz
fi

echo "Going ahead and running the Mautic update to the latest version"
php $mautdir/bin/console mautic:update:apply

echo "Finishing the installation"
php $mautdir/bin/console mautic:update:apply --finish

echo "Clering Mautic Cache"
rm -rf $mautdir/var/cache/*

echo "Updating File Permissions"
chown www-data:www-data $mautdir

echo "Your Mautic should be updated to the latest version. Good Luck"
1 Like

Awesome - thank you!

I’ve checked the issue. It seems there is a typo in the code.
Change in Plugins/MauticFocusBundle/Controller/AjaxController.php on line 24:
instead of $url = $request->request->get('website'); set $url = $request->get('website');

For me it has solved the problem.

1 Like

Nice. I check this thread every so often to see if anyone else was experiencing the same thing. Thanks for updating the thread!

Hi everyone,

Thanks @rw4lll !
I’ve had the same issue, and your answer allowed me to solve it.

Did anyone of you reported the bug already ?

Seems to be added now: Focus Item: 500 internal error -> A typo in Plugins/MauticFocusBundle/Controller/AjaxController.php · Issue #11706 · mautic/mautic · GitHub