Class 'FabrikView' not found

Status
Not open for further replies.

Bauer

Well-Known Member
I haven't been around for a while but this morning I got back to work on my project and the first thing that came up was a Joomla update (to v 3.4.5). Then I update all my NoNumber extensions (there must have been a half dozen updates). Then I updated the latest Fabrik code from github.

Now I get this - for any page that uses a Fabrik list...

Fatal error: Class 'FabrikView' not found in /home/public_html/components/com_fabrik/views/list/view.base.php on line 24

So what was my mistake - updating Joomla, updating NoNumber extensions, or updating Fabrik?
...And, what do I do now?
 
First thing to check is that you still have a ...

./components/com_fabrik/views/FabrikView.php

... which is what gets loaded by the J! legacy controller for views, which gets loaded via the getView() on line 58 of our main list controller.

-- hugh
 
And which NoNumber components do you have installed?

It's got to be something specific to your setup, as we'd be inundated with reports by now if this was a systemic issue. We (staff) have updated all our test sites to 3.4.5, as have a lot of users, and so far you're the only person reporting this.

So assuming you didn't somehow blow the FabrikView.php away, my first suspicion would be NoNumber, although I can't offhand think of how another extension could mess with the very basic legacy view loading, unless they overrode that class.

-- hugh
 
FabrikView.php is there - so I'm stumped.
I just re-did the usual fabrik process (re-downloaded the latest version from github) with the same results.
Then I went back to the fabrik-joomla3.zip file that I have from 10/18/2015 and all is well.
 
OK - Now here's what's really weird.
With the latest github update installed, if I disable ALL of the NoNumber plugins I get that error even on the site's home page.
But if I enable the NoNumber plugins the error only comes up on pages that contain a Fabrik list or form.
When I posted that last reply I was convinced it was a Fabrik problem - now, not so much.
Once again, my avatar is me - minus the age spots and wrinkles.:confused:
 
Well I'm stumped too.



I'll load up whatever you have, see if I can replicate this.

-- hugh
So many I can't fit them all on one screen snip. I'll try to figure out what it is too. There's only a few that aren't plugins.
THANKS!
 

Attachments

  • noNumber1.png
    noNumber1.png
    73.2 KB · Views: 248
  • noNumber2.png
    noNumber2.png
    52.2 KB · Views: 231
Moved it.

Before I start loading all that stuff up ...

Can you check your ./plugins/system/fabrik/defines.php, and make sure it's including FabrikView.php, at line 66.

And the only other likely explanation ... are you overriding defines.php with a user_defines.php?

-- hugh
 
Line 66 0f plugins/system/fabrik/defines.php is...
require_once COM_FABRIK_FRONTEND . '/views/FabrikView.php';

I went through all the NoNumber folders and found that about half of them had not been updated - so I used the 'Reinstall' button of the NoNumber Extension Manager to individually bring them all up to date.

I also noticed that in the Extensions 'Manage' list, when filtered to 'fabrik', everything had version 3.3.3 EXCEPT for 'Fabrik Package' - which was 3.3.1. So I reinstalled the entire package and everything then showed version 3.3.3.

I then updated from latest github. Same issue.
 
And you are sure there isn't a user_defines.php?

How about the execution order of the Fabrik system plugin? You'll have to look at the #_extensions table directly, find the row for plg_fabrik_system, and look at the 'ordering' value. It needs to be the lowest number of all system plugins, like -1.

I'm definitely getting baffled here. The defines.php includes FabrikView.php, which adds the FabrikView class, and defines.php is included from the main fabrik.php system plugin. Which should always be running before we attempt to render any views.

The only thing I can think of is one of the NoNumber extensions like Modules Anywhere is being kicked off by a system plugin running before ours, and attempting to render a Fabrik view.

-- hugh
 
Moved it.

Before I start loading all that stuff up ...

Can you check your ./plugins/system/fabrik/defines.php, and make sure it's including FabrikView.php, at line 66.

And the only other likely explanation ... are you overriding defines.php with a user_defines.php?

-- hugh

Don't bother. It is a fabrik problem after all.

See line 198 0f plugins/system/fabrik/fabrik.php

I don't even know what the user_defines thing is about
But on line 198 of fabrik.php shouldn't you be checking for components/com_fabrik/user_defines.php - and NOT plugins/system/fabrik/user_defines.php?

At least that is what is suggested in the comment at the top of the plugins/system/fabrik/user_defines.php file.
/**
* Any of these defines can be overwritten by copying this file to
* components/com_fabrik/user_defines.php

That is where/why user_defines.php is being loaded. I have no idea why - but I do see (by echoing $defines) that on line 198 $defines is being initialized as...
/home/public_html/plugins/system/fabrik/user_defines.php

And plugins/system/fabrik/user_defines.php (in that same folder) does not include the line...
require_once COM_FABRIK_FRONTEND . '/views/FabrikView.php';
Hence the error.

For now, I just renamed ./plugins/system/fabrik/user_defines.php to user_defines.php.sav and all is well.

I'm just the messenger - you're the fixer.:)
 
Last edited:
There is not, and to the best of my knowledge never has been, a user_defines.php in github.

https://github.com/Fabrik/fabrik/tree/joomla3/plugins/system/fabrik

It's a way of allowing users to override certain aspects of Fabrik, and rather like a custom_css.php, we never include it in a distribution or github.

I guess it's possible one crept in to github and then got removed, and you just happened to pick it up.

Anyway, just delete it.

And no, if it exists, it should be in plugins/system/fabrik, that comment is just out of date, as we moved the defines.php from the main ./com_fabrik folder a while back, in to the plugin folder, and just never updated that comment.

-- hugh
 
Git has no memory of a user_defines.php ever existing in either location:

[vagrant@vagrant-centos65 joomla30]$ git log --all -- ./plugins/system/fabrik/user_defines.php
[vagrant@vagrant-centos65 joomla30]$ git log --all -- ./components/com_fabrik/user_defines.php
[vagrant@vagrant-centos65 joomla30]$

I also checked the 3.3 install ZIP, and it's not in there either.

So I'm relatively confident it didn't come from us, unless it was in a ZIP from a previous version. But if that was the case, we'd be seeing this issue from anyone who had installed that, and has since updated.

I'm obviously concerned about whether it did come from us, because as you discovered, it would cause very bizarre problems as soon as we make any changes to the main defines.php. And I'm not saying it didn't, just that I can't work out how, if it did.

-- hugh
 
So sorry for all the trouble.
Why do these things always only happen to me?
It looks like I've got some weird stuff going on and not sure what's causing it.

But over the weekend I did a clean 'update' to Windows 10 and reinstalled a lot of programs including my ftp client.
Just now I notice that that user_defines.php in the plugins/system/fabrik folder on the server is dated 4/30/2014. No idea how it got there or when. But if it was there before today it would have caused the error before today too - right? Yet why not today's date like the rest of the files?

One thing I did differently with that github update today was use the built-in Windows unzip feature - which has caused me similar 'weirdness' in the past. But I didn't realize until then that I forgot to re-install 7-Zip which I normally use - so installed it after I extracted the file but before I re-created the zip to upload to the server. (But that doesn't explain the fact that half the NoNumber updates didn't take either.)

This has been one hell of a week or two for me - If I get some time I'll cry on your shoulder via email.

For all your troubles you finally get a subscription from Phil. (Wish I could do more.) Mea culpa. I'm so embarassed.:oops:
 
Last edited:
S'OK, poop happens.

As it's obviously a copy of defines.php, it wouldn't have caused any problems till now, because we haven't changed defines.php since Jan 2014. This isn't a file which changes very often.

https://github.com/Fabrik/fabrik/commits/joomla3/plugins/system/fabrik/defines.php

And the reason things just went wrong now is, we just added that new FabrikView.php include to defines.php, as part of the DI (dependency injection) changes I mentioned last week. So your user_defines.php didn't have it, so ... kablammo.

-- hugh
 
At least you can make some sense out of the insanity. Thanks again. Do me a favor and remove this embarrassing thread?:p:eek::oops:
 
It's not embarrassing! And it might help someone in the future. But if you really, really want me to, I will.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top