Upfront and Ajax Upload for Gravity Forms Plugin Conflict

I have been trying to get Upfront based themes to work on my site and have found that a particular pairing of any Upfront-based theme produces a fatal error when the plugin "Ajax Upload for Gravity Forms" is enabled.

The exact error thrown is:
Fatal error: Access level to Upfront_UploadHandler::generate_response() must be public (as in class UploadHandler) in .../wp-content/themes/upfront/library/media/class_upfront_upload_handler.php on line 96

I know that Upfront has had plugin conflicts in the past, any suggestions for a work around? This is the only gravity form upload plugin I've been able to find that works well at all for large files, and seeing as how I'm in the printing business, that's kind of a big deal. So far, the easiest work-around is to just not use an Upfront based theme, however, I really do like the versatility of the Upfront architecture and would REALLY like to be able to implement it.

Also, worth noting for anyone else who might have similar issues and not know what to do. Sometimes an error in the theme shuts everything down and doesn't even allow login. If you go into your FTP and delete the theme (and the child theme that you've enabled if any) then it will let you back in. Alternatively, you can log into wpmudev and navigate to your "themes" tab in the hub and from there you can uninstall themes to the same effect (this is what I did). After deleting, navigating to the "themes" area in the wordpress admin will allow wordpress to recognize the theme is missing and disable it (so it doesn't immediately go back to it once you reinstall the theme).

  • Huberson

    Hello NATHANIEL,
    The problem is that the plugin "Ajax Upload for Gravity Forms" uses a class with the same name(UploadHandler ) as Upfront, creating the conflict.

    A temporary fix is to namespace the Upfront "UploadHandler" class and update any references to it accordingly.
    You need to make a few modifications in two files located in "wp-content\themes\upfront\library\media" directory.
    1. open "class_upload_handler.php" and add namespace Upfront; right after <?php.
    2. open "class_upfront_upload_handler.php" and replace line 3
    if (!class_exists('UploadHandler')) require_once('class_upload_handler.php');
    if (!class_exists('\Upfront\UploadHandler')) require_once('class_upload_handler.php');
    replace line 5
    class Upfront_UploadHandler extends UploadHandler {
    class Upfront_UploadHandler extends \Upfront\UploadHandler {

    Unless the class "UploadHandler" is used somewhere else by Upfront, you should not have any problem with this fix in the future. But if you do get issue related to that class, simply adding "Upfront" like so \Upfront\UploadHandler before the class wherever it is used will take care of the problem.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.