PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Fatal error: Class 'RGForms' not found on preview

  1. Fatal error: Class 'RGForms' not found in C:\web\wpbeta\wp\wp-content\plugins\gravityforms\preview.php on line 8

    I suspect that this maybe because I have wp-content relocated (sideways! :) ). Disappointed that a plugin of gravity forms reputation would cope with that? (Many of my sites have such a structure and most plugins cope.

    Looking at preview.php it seems it is trying to include wp-load.php.

    Please see

    and further down in the comments there is discussion about better ways of doing what one wants to do where one needs wp_loaded, such as checking for a $_GET parameter on an early action.
    Maybe like suggested here:

    This would get around the difficulty in loading the code and still allow you to achieve the preview?

    In the meantime is there a fix around this ? or else I imagine I have to hardcode the wp-load for now (urg). I have resetup a plain dev wp site for now for testing.

    Posted 10 years ago on Monday November 21, 2011 | Permalink
  2. Me again - another idea would be to have a draft 'preview' page instead, so that the form could be previewed in the context of the site's theme (and of course WordPress would be fully loaded.

    Posted 10 years ago on Monday November 21, 2011 | Permalink
  3. The issue going to be wp-content being loaded from a custom location. There are a handful of features in Gravity Forms, the Preview being the primary one, that calls PHP directly and outside of the WordPress admin. Because wp-content is located in a custom location it is then unable to find the wp-load.php. Unfortunately when wp-content has been moved, you then can't execute code the same way when utilizing wp-load this way.

    The only fix for the preview when you encounter this right now is to edit the preview.php and hardcode the location of the wp-load function. It has to get to the wp-load.php in order to execute and it needs to know where it is.

    We will be fixing this in an upcoming release. Maybe not in the 1.6.2 release but before 1.7 is released this is something we will be updating. We have to change a variety of functionality to take into account this scenario, including how Preview works.

    Surprisingly in over 2 years this has only come up as an issue in the last 2 weeks or so.

    Posted 10 years ago on Monday November 21, 2011 | Permalink

This topic has been resolved and has been closed to new replies.