pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 265 forks source link

Fatal Error in Pages component when using Precode #3045

Open joernschellhaas opened 9 years ago

joernschellhaas commented 9 years ago

I had a fatal error in the Pages component when upgrading PHP to 5.6.9

However it occured in the Pods code itself, not in the Precode.

Changing line 891 from

if ( 0 < strlen( $slug ) && !$pods->exists() && apply_filters( 'pods_pages_auto_404', true, $slug, $pods, self::$exists ) ) {

to

if ( 0 < strlen( $slug ) && $pods && !$pods->exists() && apply_filters( 'pods_pages_auto_404', true, $slug, $pods, self::$exists ) ) {

fixed this for me.

sc0ttkclark commented 9 years ago

I'd accept a PR for that tweak in components/Pages.php, but the root of the problem is that somehow the pod for that pod page is not empty and doesn't exist. Do you know what pod name you have set there for the 'Associated Pod' in your pod page?

joernschellhaas commented 9 years ago

I'm quite sure I didn't have any pod selected as associated pod.