Support

Account

Home Forums ACF PRO Unknown column 'cwp_postmeta.meta_value'

Solved

Unknown column 'cwp_postmeta.meta_value'

  • After Upgrade from 4 to 5.2.8 certain flexible-content-fields disappear from the frontend.

    The Field field_51dfa4b0fdc3e is such a flexible field that contains multiple post_object-references.

    They are saved to a custom post form the Plugin “Custom Post Widget” and attached via Widgets.

    In the previous version a get_field(‘fv_teaser’) returned the corresponding array. But with version 5 it only returns something like that:

    array (
      0 => 'foto_partner_teaser',
    )

    That’s the corresponding error-message:
    [29-Jul-2015 14:38:43 UTC] WordPress-Datenbank-Fehler Unknown column 'cwp_postmeta.meta_value' in 'order clause' für Abfrage SELECT cwp_posts.ID FROM cwp_posts WHERE 1=1 AND cwp_posts.post_type = 'acf-field' AND ((cwp_posts.post_status = 'publish')) AND cwp_posts.post_name = 'field_51dfa4b0fdc3e' ORDER BY cwp_postmeta.meta_value ASC LIMIT 0, 1 von require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/XXXXX/page-templates/XXXXXX.php'), get_sidebar, locate_template, load_template, require_once('/themes/XXXXX/sidebar.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, apply_filters('widget_display_callback'), call_user_func_array, xxxxxWidgetsAVTeaser, get_field, get_field_object, acf_get_field, _acf_get_field_by_key, acf_get_field_id, get_posts, WP_Query->query, WP_Query->get_posts

  • I’m so sorry. The cause was an unremoved add_filter(‘posts_orderby’, …) in a previous widget.
    Strange though, that this did not occur in acf version 4 (and we did not upgrade WordPress – only ACF).

  • Hi @klausb

    Glad you worked it out.. It’s possible that the priorities or perhaps where ACF hookes into the widgets have changed in the newer versions and thus what was previously not an issue now became one 🙂

    Feel free to set your post as the answer so this topic is set as resolved.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Unknown column 'cwp_postmeta.meta_value'’ is closed to new replies.