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

Category Taxonomy (extended) fields missing when W3 Total Cache Object Caching Enabled #3215

Open calvingilbert opened 9 years ago

calvingilbert commented 9 years ago

When I turn on object cache (Disk Method) in the W3 Total Cache plugin, my site will not load extended data stored in the built-in WordPress categories taxonomy.

This is how I am retrieving the data:

        $mytax = pods( 'category' );
        $mytax->fetch( get_query_var( 'cat' ) ); // grabs current category
        $desc = $mytax->get_field( 'enhanced_description' ); // WYSIWYG text box

When I look at $mytax with object cache off, I can see all the additional fields in the array. When I turn object cache on, all the data is missing.

Object Cache ON:

Pods Object
(
    [iterator:Pods:private] => 
    [api] => PodsAPI Object
        (
            [display_errors] => 1
            [pod_data] => 
            [pod] => 
            [pod_id] => 
            [fields] => Array
                (
                )

            [format] => 
            [deprecated:PodsAPI:private] => 
            [fields_cache:PodsAPI:private] => Array
                (
                )

        )

    [data] => PodsData Object
        (
            [api] => PodsAPI Object
                (
                    [display_errors] => 1
                    [pod_data] => 
                    [pod] => 
                    [pod_id] => 
                    [fields] => Array
                        (
                        )

                    [format] => 
                    [deprecated:PodsAPI:private] => 
                    [fields_cache:PodsAPI:private] => Array
                        (
                        )

                )

            [select] => 
            [table] => 
            [pod] => 
            [pod_data] => 
            [id] => 0
            [field_id] => id
            [field_index] => name
            [field_slug] => 
            [join] => 
            [where] => Array
                (
                )

            [where_default] => Array
                (
                )

            [orderby] => 
            [fields] => Array
                (
                )

            [aliases] => Array
                (
                )

            [detail_page] => 
            [row_number] => -1
            [data] => 
            [row] => 
            [insert_id] => 
            [total] => 
            [total_found] => 
            [total_found_calculated] => 
            [page_var] => pg
            [page] => 1
            [limit] => 15
            [pagination] => 1
            [search] => 1
            [search_var] => search
            [search_mode] => int
            [search_query] => 
            [search_fields] => Array
                (
                )

            [search_where] => Array
                (
                )

            [filters] => Array
                (
                )

            [traversal] => Array
                (
                )

            [traverse] => Array
                (
                )

            [sql] => 
            [total_sql] => 
            [pod_id] => 
        )

    [alt_data] => 
    [rows] => 
    [row] => 
    [row_number:Pods:private] => -1
    [row_override] => Array
        (
        )

    [display_errors] => 1
    [pod_data] => 
    [params] => Array
        (
        )

    [pod] => 
    [pod_id] => 
    [fields] => Array
        (
        )

    [filters] => Array
        (
        )

    [detail_page] => 
    [id] => 0
    [limit] => 15
    [offset] => 0
    [page_var] => pg
    [page] => 1
    [pagination] => 1
    [search] => 1
    [search_var] => search
    [search_mode] => int
    [total] => 0
    [total_found] => 0
    [ui] => Array
        (
        )

    [page_template] => 
    [body_classes] => 
    [meta] => Array
        (
        )

    [meta_properties] => Array
        (
        )

    [meta_extra] => 
    [sql] => 
    [deprecated] => Pods_Deprecated Object
        (
            [obj:Pods_Deprecated:private] => Pods Object
 *RECURSION*
            [id] => 0
            [data] => PodsData Object
                (
                    [api] => PodsAPI Object
                        (
                            [display_errors] => 1
                            [pod_data] => 
                            [pod] => 
                            [pod_id] => 
                            [fields] => Array
                                (
                                )

                            [format] => 
                            [deprecated:PodsAPI:private] => 
                            [fields_cache:PodsAPI:private] => Array
                                (
                                )

                        )

                    [select] => 
                    [table] => 
                    [pod] => 
                    [pod_data] => 
                    [id] => 0
                    [field_id] => id
                    [field_index] => name
                    [field_slug] => 
                    [join] => 
                    [where] => Array
                        (
                        )

                    [where_default] => Array
                        (
                        )

                    [orderby] => 
                    [fields] => Array
                        (
                        )

                    [aliases] => Array
                        (
                        )

                    [detail_page] => 
                    [row_number] => -1
                    [data] => 
                    [row] => 
                    [insert_id] => 
                    [total] => 
                    [total_found] => 
                    [total_found_calculated] => 
                    [page_var] => pg
                    [page] => 1
                    [limit] => 15
                    [pagination] => 1
                    [search] => 1
                    [search_var] => search
                    [search_mode] => int
                    [search_query] => 
                    [search_fields] => Array
                        (
                        )

                    [search_where] => Array
                        (
                        )

                    [filters] => Array
                        (
                        )

                    [traversal] => Array
                        (
                        )

                    [traverse] => Array
                        (
                        )

                    [sql] => 
                    [total_sql] => 
                    [pod_id] => 
                )

            [datatype] => 
            [datatype_id] => 
            [api] => PodsAPI Object
                (
                    [display_errors] => 1
                    [pod_data] => 
                    [pod] => 
                    [pod_id] => 
                    [fields] => Array
                        (
                        )

                    [format] => 
                    [deprecated:PodsAPI:private] => 
                    [fields_cache:PodsAPI:private] => Array
                        (
                        )

                )

            [alt_data] => 
            [rows] => 
            [row] => 
            [row_override] => Array
                (
                )

            [display_errors] => 1
            [pod_data] => 
            [params] => Array
                (
                )

            [pod] => 
            [pod_id] => 
            [fields] => Array
                (
                )

            [filters] => Array
                (
                )

            [detail_page] => 
            [limit] => 15
            [offset] => 0
            [page_var] => pg
            [page] => 1
            [pagination] => 1
            [search] => 1
            [search_var] => search
            [search_mode] => int
            [total] => 0
            [total_found] => 0
            [ui] => Array
                (
                )

            [page_template] => 
            [body_classes] => 
            [meta] => Array
                (
                )

            [meta_properties] => Array
                (
                )

            [meta_extra] => 
            [sql] => 
            [deprecated] => 
        )

    [datatype] => 
    [datatype_id] => 
)

Debug Information WordPress Version: 4.3.1 PHP Version: 5.5.14 MySQL Version: 5.5.38 Server Software: Apache/2.2.26 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.6 PHP/5.5.14 mod_ssl/2.2.26 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.18.2 Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:41.0) Gecko/20100101 Firefox/41.0 Session Save Path: /Applications/MAMP/tmp/php Session Save Path Exists: Yes Session Save Path Writeable: Yes Session Max Lifetime: 1440

Opcode Cache: Apc: No Memcached: No Redis: No

Object Cache: Apc: No Apcu: No Memcache: No Memcached: No Redis: No

WPDB Prefix: wp_ WP Multisite Mode: No WP Memory Limit: 64M Pods Network-Wide Activated: No Pods Install Location: /Applications/MAMP/htdocs/gw-local/wp-content/plugins/pods/ Pods Tableless Mode Activated: No Pods Light Mode Activated: No Currently Active Theme: 0.1 Build

Currently Active Plugins: Admin Columns: 2.4.7 Contextual Related Posts: 2.2.3 Error Log Monitor: 1.3.1 Force Regenerate Thumbnails: 2.0.5 Jetpack by WordPress.com: 3.7.2 Pods - Custom Content Types and Fields: 2.5.5 W3 Total Cache: 0.9.4.1 WordPress Importer: 0.6.1 WP-Paginate: 1.3.1 WP Page Load Stats: 1.0.1 Yoast SEO: 2.3.5

sc0ttkclark commented 9 years ago

Try using Pods Alternative Cache alongside that solution, it should solve it at least for now, until we figure out why this is happening (it shouldn't be).

sc0ttkclark commented 9 years ago

https://wordpress.org/plugins/pods-alternative-cache/

calvingilbert commented 9 years ago

Thanks. I will add more details if I find anything.

calvingilbert commented 8 years ago

I am able to replicate this issue without W3 object cache enabled.

If I alter the structure of any pod, the site does not display anything from the extended category as mentioned above. Once I go in and edit and save a category, the pods reappear on the site.

I tried the code in my previous comments to fetch data and this method below:

$desc = pods_field('category', get_query_var('cat'), 'enhanced_description', true);

Hope this helps.

quasel commented 6 years ago

@sc0ttkclark is this still an issue?