0 - Class 'FabrikWorker' not found

I make backups to an external HD, so I just created a new one that you can download with Akeeba Backup Manager.
You can log in at: see PM
 
I tried installing your Akeeba, but the Kickstart install errors out during database creation with:

Table 'v_mijn_documenten_leden' doesn't exist

... when it's trying to create a view called 'v_mijn_documenten'.

-- hugh
 
We've had this problem before, it is caused by views that use other views and the order in which the views are defined.
I removed a number views and created an new Akeeba backup.
You should be able to download it with the username and pw you have of my development environment.

Henk
 
IT WORKS FINE NOW !!!!!

thank you very very much
This fixes the problem.

Now, how do I proceed from here to update my production environment?
Do I do a regular update with the auto-installer of Joomla! and then overwrite the include.php file?
Or should I do an update from GitHub?
 
I'm afraid I was too optimistic again.

I installed a new Akeeba backup in my development environment, which uses PHP 7.2.7.
I updated Joomla from 3.8.10 to 3.9.0
I updated Fabrik from 3.7 to 3.9
And again I have the 'FabrikWorker not found' message.
Then I moved the above mentioned include.php to ./libraries/fabrik overwriting the one that came with 3.9 and everything works fine again.

So I think the new version 3.9 of Fabrik doesn't solve this problem.

I can now update my production environment safely in the order I did this in the development environment.
Thanks again for all the excellent support.

Henk
 
Being cautious as I am, I didn't update my production environment yet.
I found the next problem with PHP7.2.7, Joomla!3.9 and Fabrik 3.8.1:

"
Using $this when not in object context
D:\appdata\IIS\vhosts\3eenheidparochie.nl\ontw.3eenheidparochie.nl\libraries\src\Application\CMSApplication.php:370

Call stack
#
Function Location
1 () JROOT\libraries\src\Application\CMSApplication.php:370
2 Joomla\CMS\Application\CMSApplication::getMenu() JROOT\libraries\src\Application\SiteApplication.php:275
3 Joomla\CMS\Application\SiteApplication::getMenu() JROOT\plugins\fabrik_list\php_events\php_events.php(247) : eval()'d code:10
4 eval() JROOT\plugins\fabrik_list\php_events\php_events.php:247
5 PlgFabrik_ListPhp_Events->doEvaluate() JROOT\plugins\fabrik_list\php_events\php_events.php:93
6 PlgFabrik_ListPhp_Events->onPreLoadData() JROOT\components\com_fabrik\models\pluginmanager.php:676
7 FabrikFEModelPluginmanager->runPlugins() JROOT\components\com_fabrik\models\list.php:907
8 FabrikFEModelList->getData() JROOT\components\com_fabrik\models\list.php:699
9 FabrikFEModelList->render() JROOT\components\com_fabrik\views\list\view.base.php:418
10 FabrikViewListBase->display() JROOT\components\com_fabrik\views\list\view.html.php:41
11 FabrikViewList->display() JROOT\libraries\src\Cache\Controller\ViewController.php:102
12 Joomla\CMS\Cache\Controller\ViewController->get() JROOT\components\com_fabrik\controllers\list.php:109
13 FabrikControllerList->display() JROOT\plugins\content\fabrik\fabrik.php:602
14 PlgContentFabrik->replace()
15 preg_replace_callback() JROOT\plugins\content\fabrik\fabrik.php:76
16 PlgContentFabrik->onContentPrepare() JROOT\libraries\joomla\event\event.php:70
17 JEvent->update() JROOT\libraries\joomla\event\dispatcher.php:160
18 JEventDispatcher->trigger() JROOT\components\com_content\views\article\view.html.php:193
19 ContentViewArticle->display() JROOT\libraries\src\MVC\Controller\BaseController.php:672
20 Joomla\CMS\MVC\Controller\BaseController->display() JROOT\components\com_content\controller.php:118
21 ContentController->display() JROOT\libraries\src\MVC\Controller\BaseController.php:710
22 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\components\com_content\content.php:43
23 require_once() JROOT\libraries\src\Component\ComponentHelper.php:402
24 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT\libraries\src\Component\ComponentHelper.php:377
25 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\SiteApplication.php:194
26 Joomla\CMS\Application\SiteApplication->dispatch() JROOT\libraries\src\Application\SiteApplication.php:233
27 Joomla\CMS\Application\SiteApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:196
28 Joomla\CMS\Application\CMSApplication->execute() JROOT\index.php:49
"
Some lists are working fine, others cause this problem.
It looks like all the list causing this problem give me the same call stack.

I looked at my source code but I cannot find anything that seems to be the cause.
Some lists are based on MySQL tables and others are based on Views, that doesn't seem to be the cause.
Also: some database-join fields are based on Views including a WHERE clause, that also doesn't explain the error.

Please advise on how to continue.
regards, Henk
 
It looks like it's caused by a plugin I built.
What is wrong with the following code:
"
// PHP.013 Toevoegen van een record aan het AVG logboek
// de <lijstcode> en <lijstbenaming> zijn per lijst waar deze functie wordt aangeroepen verschillend.
//
// open de database en bepaal wie de gebruiker is, hoe hij/zij heet en welke menuregel is gekozen

$user = JFactory::getUser();
$user_id = $user->id;
$user_name = $user->name;
$app = JFactory::getApplication();
$menuItem = JSite::getMenu()->getActive()->id;
$menuregel = JSite::getMenu()->getActive()->title;
$mydb = JFactory::getDbo();
$query = $mydb->getQuery(true);
$query =
"
INSERT INTO `AVG_logboek`
(date_time,gebruiker_id,gebruiker,menu_item,menu_regelnaam,fabrik_lijstcode,lijst_benaming)
VALUES
(TIMESTAMP(now()),'$user_id','$user_name','$menuItem','$menuregel','7','Werkgroepen bijwerken')";
$result = $mydb->setQuery($query);
$result = $mydb->query();
return $result==NULL;
"
This code tracks access to privacy sensitive data as part of the GPDR regulation.

please advise, Henk
 
Which event is that running on?

I don't see any issues with that code, the error is deep inside J!'s guts, so I'll need to see if I can replicate it here.

-- hugh
 
OK, JSite's getMenu() is not declared as static, meaning you can't call it as JSite::getMenu(). I don't know if that's a recent change, as there seems to be a fair amount of code knocking around that calls it in a static context, but deep inside the guts it references $this ... hence the error, because when calling a function as static, there is no $this. You only get a $this if you instantiate the class, and call it non-static, like ...

Code:
$site = new JSite;
$menu = $site->getMenu();

But anyway, I think the best way is just to use our $this-app, and call getMenu() through that, rather than JSite. Pretty much anywhere you can run your own code within Fabrik, we will have injected most of the useful stuff you need into $this (be it a form model, plugin model, etc), so ...

Code:
// use $this->user and $this->app
$user_id = $this->user->id;
$user_name = $this->user->name;
$menuItem = $this->app->getMenu()->getActive()->id;
$menuregel = $this->app->getMenu()->getActive()->title;

Internally, CMSApplication grabs an instance of JMenu in the getMenu call, so it's functionally equivalent.

-- hugh
 
thanks again. I tested the new code and it all works now.

I cannot find anything in the wiki on the $this-app.
Should I replace all user, db and app data in my PHP code with $this-> to prevent problems in the future?

Henk
 
You don't need to. Usually using the JFactory or other factory methods are fine. That's all we do to set up $this->app, etc.

The problem in this case is that you were using JSite incorrectly, as JSite's getMenu() is not declared as static, and uses $this internally, so will blow up if you try and do JSite::getMenu() directly, rather than instantiating it first (using 'new JSite'). If it worked before, that was just a happy accident, and some change internally in the code brought the issue to light in 3.9.

Moving forward, you can bear in mind that in most cases, things like $this->app and $this->user will usually exist, so you don't need to grab your own with JFactory::getApplication(), etc. But getting your own won't hurt.

-- hugh
 
Oké, thanks for the explanation.

Yesterday I finally updated my production environment.
We are now running PHP 7.2.7, Joomla! 3.9.1 and Fabrik 3.9.

No error messages at all !!
However,

All lists that contain a NOW() in the WHERE clause, work oké, but disregard the NOW() clause.
Any ideas on this next challenge?

Henk
 
They are all in one table with the fieldname 'van' and field type 'date'.
All lists have a pre-filter that says: WHERE van GREATER THAN OR EQUAL (now() - interval 10 day) Type = Text.
Changing Type to 'No quotes' solves the problem !!
Again many thanks for the excellent support.

Henk
 
Yup. For type 'text', we wrap quotes around your value, so the actual query would have been ...

WHERE van GREATER THAN OR EQUAL '(now() - interval 10 day)'

... which won't work, as it's trying to compare against the literal string '(now() - interval 10 day)'.

The 'no quotes' type tells us not to wrap the value in quotes, so it actually winds up as a MySQL statement ...

WHERE van GREATER THAN OR EQUAL (now() - interval 10 day)

The reason it used to work with 'text' was actually a bug, which when fixed broke a few sites like yours that incorrectly had type 'text' for things that should have been 'no quotes'.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top