PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in /home/pitaihgt/public_html/wp-content/plugins/give/src/Form/Templates.php:120
Stack trace:
#0 /home/pitaihgt/public_html/wp-content/plugins/give/src/Form/Templates.php(104): Give\Form\Templates->getTemplateObject(NULL)
#1 /home/pitaihgt/public_html/wp-content/plugins/give/src/Controller/Form.php(306): Give\Form\Templates->getTemplate()
#2 /home/pitaihgt/public_html/wp-includes/class-wp-hook.php(309): Give\Controller\Form->handleOffSiteCheckoutRedirect(‘ https://pitajpe…’)
#3 /home/pitaihgt/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters(‘ https://pitajpe…’, Array)
#4 /home/pitaihgt/public_html/wp-includes/pluggable.php(1316): apply_filters(‘wp_redirect’, ‘ https://pitajpe…’, 301)
#5 /home/pitaihgt/public_html/wp-includes/canonical.php(799): wp_redirect(‘ https://pitajpe…’, 301)
#6 /home/pitaihgt/public_html/wp-includes/class-wp-hook.php(307): redirect_canonical(‘ https://pitajpe…’)
#7 /home/pitaihgt/public_html/wp-includes/c in /home/pitaihgt/public_html/wp-content/plugins/give/src/Form/Templates.php on line 120
Hi @pitajpetru,
Glad you reached out here.
99% of the time that error is caused by caching.
In order to verify that my hypothesis is right here, we need to exclude any asset loaded by GiveWP from the cache.
Caching is handled differently on various sites and web hosts, and most of them allow for excluding specific URLs or parts of URLs from caching. At the very least, you should exclude the following slugs from caching:
/donations/
/donation-confirmation/
/donor-dashboard/
Also, the following query strings:
give-embed=donor-dashboard
giveDonationFormInIframe=1
Your host or the caching plugin/solution you are using can help with that. Some of them may require what’s called a “wildcard” like /donations/* to capture all subdirectories under the /donations/ folder.
You can also temporarily disable caching on the site to confirm that the uncached site isn’t showing the problem.
While fine-tuning cache falls outside the scope of the support we’re able to provide, your success with online donations is our number one priority, and we’re happy to provide any tips.
I guess you were right, error fixed itself couple of days after…
Classic form works correctly now!
Thanks