Stevebenson223
Member
I've updated a J3 F3 PHP7 installation to J4.2.9 F4.0gamma3 PHP8.1 following the "Upgrading from Fabrik3.10 to Fabrik4" instructions. In general it's working but there are some problems.
I've got a problem with (I believe) a php form plugin which is throwing an error: 0 Class "Factory" not found and displaying a "the requested page can't be found" error which seems odd as there's no redirect. I believe this plugin is the problem as the form works fine when the plugin is disabled.
The form is to create a subscription for a member (user) and the purpose of the plugin is to unblock the user if they have been blocked. If they are not blocked then there should be no action.
The plugin process script is "OnAfterProcess" and the code is:
I've checked through the PHP manual comparing PHP7 to PHP8 but can't find anything that helps. I've also viewed the backward compatibility issues of J3 to J4 and searched this forum.
This works OK in J3 F3 PHP7, but couldn't check when it works in J3 F3 PHP8 as earlier errors appeared. So not sure whether this is a PHP8 or J4/F4 issue, hence I'm posting it here rather than Bugs and Issues.
Can anybody offer any suggestions please? Thanks.
I've got a problem with (I believe) a php form plugin which is throwing an error: 0 Class "Factory" not found and displaying a "the requested page can't be found" error which seems odd as there's no redirect. I believe this plugin is the problem as the form works fine when the plugin is disabled.
The form is to create a subscription for a member (user) and the purpose of the plugin is to unblock the user if they have been blocked. If they are not blocked then there should be no action.
The plugin process script is "OnAfterProcess" and the code is:
Code:
$mydb = version_compare(\Joomla\CMS\Version::MAJOR_VERSION, "4", ">=") ? Factory::getContainer()->get('DatabaseDriver') : Factory::getDbo();
$my_user_id = '{subscriptions___member_raw}';
$mydb->setQuery("UPDATE #__users SET block='0' WHERE id = ".$mydb->Quote($my_user_id));
$mydb->execute();
$mydb->setQuery("UPDATE members SET block_user = '0' WHERE id = ".$mydb->Quote($my_user_id));
$mydb->execute();
I've checked through the PHP manual comparing PHP7 to PHP8 but can't find anything that helps. I've also viewed the backward compatibility issues of J3 to J4 and searched this forum.
This works OK in J3 F3 PHP7, but couldn't check when it works in J3 F3 PHP8 as earlier errors appeared. So not sure whether this is a PHP8 or J4/F4 issue, hence I'm posting it here rather than Bugs and Issues.
Can anybody offer any suggestions please? Thanks.