Fatal Error— Plugin broken
-
Fatal error: Class ‘PicaticAPI’ not found in /…/wp/wp-content/plugins/picatic/picatic-lib.php on line 135
This is from a fresh install of wordpress and the Picatic plugin.
-
@andrewinsideout, are you working on this in a localhost environment?
The problem appears to be that the vendor library that communicates with our API is not loading. We use composer to load the vendor libraries and there are occasionally issues around doing this when working in localhost.
Which screen are you on (what are you doing) when you see this error.
I’m not working locally. This error is happening when I try to use the shortcode “[picatic-upcoming-events][/picatic-upcoming-events]”.
@andrewinsideout, we’re having difficulty reproducing the error. Would you be able to supply us with more details?
- What screen do you see the error on, the edit page, or the public page?
- What host are you using? What server environment are you running (LAMP?)? What version of PHP?
Running LAMP with WordPress 4.8. PHP 5.6.30. The backend of the plugin works well, I receive the fatal error on the front end of the site.
I’ve checked the file /plugins/picatic/vendor/picatic/php-api/src/PicaticAPI.php and the file is there with the correct permissions.
-
This reply was modified 8 years, 9 months ago by
andrewinsideout.
-
This reply was modified 8 years, 9 months ago by
andrewinsideout.
-
This reply was modified 8 years, 9 months ago by
andrewinsideout.
If it helps I hacked it to work by adding this code to the top of picatic-lib.php
if(!function_exists('http_build_url')) include_once(__DIR__.'/vendor/jakeasmith/http_build_url/src/http_build_url.php'); if(!class_exists('Picatic_Consumer_Interface')) include_once(__DIR__.'/vendor/picatic/php-api/src/Picatic_Consumer_Interface.php'); if(!class_exists('Picatic_Requestor_Interface')) include_once(__DIR__.'/vendor/picatic/php-api/src/Picatic_Requestor_Interface.php'); if(!class_exists('Picatic_Requestor')) include_once(__DIR__.'/vendor/picatic/php-api/src/Picatic_Requestor.php'); if(!class_exists('PicaticAPI')) include_once(__DIR__.'/vendor/picatic/php-api/src/PicaticAPI.php');-
This reply was modified 8 years, 9 months ago by
andrewinsideout.
-
This reply was modified 8 years, 9 months ago by
andrewinsideout.
Hey @andrewinsideout, sorry for the delay in replying.
The above makes sense that it would work. I’m thinking that the problem is that in the picatic.php file on line 42, we include “vendor/autoload.php”. I’m guessing that because of the lack of __DIR__ in front of the path, it is having difficulty finding the file to load vendor dependencies.Would it be possible for you to check to see if this fix would work instead of what you implemented?
So, remove the code you added above and try this instead in picatic.php line 42:
`include(plugin_dir_path( __FILE__ ) . ‘vendor/autoload.php’);Thanks
-
This reply was modified 8 years, 8 months ago by
picatic.
The topic ‘Fatal Error— Plugin broken’ is closed to new replies.