Error 0: Argument 2 passed to Joomla\Crypt\Crypt..., after migrating from Joomla 3.10.11 to 4.2.7

Need help upgrading your Joomla! website or converting to Joomla! 4.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
tlernout
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Nov 26, 2015 12:25 am

Error 0: Argument 2 passed to Joomla\Crypt\Crypt..., after migrating from Joomla 3.10.11 to 4.2.7

Post by tlernout » Fri Feb 03, 2023 12:07 am

Hello,

I just completed all the steps for the migration to Joomla 4 from the version 3.10.11.

The migration worked (I have the new Admin backend working well), but the front end of my site shows the following error:

Argument 2 passed to Joomla\Crypt\Crypt::__construct() must be an instance of Joomla\Crypt\Key or null, instance of __PHP_Incomplete_Class given, called in /homepages/32/d23056728/htdocs/Dragons/Duesseldorf-Dragons-Joomla/libraries/quixnxt/src/Renderers/TwigEngine.php on line 1280

I have tried to change the template, thinking it was linked to it, but the same error shows with any template selected.

I located the file mentionned in the error message (Twigengine.php), as well as the mentionned line, but since I am not a developer/programmer, I have no idea what would need to be changed on the line 1280 mentioned in the error message.

Here is the extract of the Twigengine.php file:

1265 /**
1266 * @return TwigFunction
1267 * @since 3.0.0
1268 * @since 3.0.0
1269 */
1270 protected function getFormFooterFunction(): TwigFunction
1271 {
1272 $session = \QuixAppHelper::getSession();
1273 if ($session->get('quix_form_secret')) {
1274 $key = $session->get('quix_form_secret');
1275 } else {
1276 $encCrypt = new Crypt(null, null);
1277 $key = $encCrypt->generateKey();
1278 $session->set('quix_form_secret', $key);
1279 }
1280 $enc = new Crypt(null, $key);
1281
1282 return new TwigFunction('formFooter', function ($element, $config = []) use ($enc) {
1283 return new Markup('
1284 <input type="hidden" name="option" value="com_quix" />
1285 <input type="hidden" name="task" value="ajax" />
1286 <input type="hidden" name="element" value="'.$element.'" />
1287 <input type="hidden" name="builder" value="frontend" />
1288 <input type="hidden" name="jform[info]" value="'.$enc->encrypt(json_encode($config)).'" />', 'UTF-8');
1289 });
1290 }
1291
1292 /**
1293 * Get fields group function.
1294 *
1295 * @return TwigFunction
1296 * @since 3.0.0
1297 * @since 3.0.0
1298 */

I would appreciate any help on this one.

Thank you in advance
Last edited by tlernout on Fri Feb 03, 2023 12:10 am, edited 1 time in total.

tlernout
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Nov 26, 2015 12:25 am

Re: Error 0: Argument 2 passed to Joomla\Crypt\Crypt..., after migrating from Joomla 3.10.11 to 4.2.7

Post by tlernout » Fri Feb 03, 2023 12:09 am

I confirm that my site is designed entirely with Joomla


Post Reply

Return to “Migrating and Upgrading to Joomla! 4.x”