Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Woo Commerce 2.2 Support and Theme Update Questions #338019

    Hi Peter,

    thanks – I see your proposed change in the latest enfold version, however, it does not fix the problem.
    Steps to reproduce:
    1) have woocommerce 2.2.6, enfold 2.9.2 or 3.0.1
    3) WP_DEBUG true (otherwise you see nothing)
    3) try to edit a page with a product slider on it. (or create one, save it, and then load it – everything is gone except for title, slug, and Publish box).

    In the ‘Publish’ box there will be these warnings and errors (if WP_DEBUG is true):

    Warning: extract() expects parameter 1 to be array, null given in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 203
    
    Notice: Undefined variable: autoplay in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 210
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 211
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 212
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 216
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 217
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 218
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 219
    
    Notice: Undefined variable: columns in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 220
    
    Notice: Undefined variable: interval in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 224
    
    Notice: Undefined variable: animation in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 224
    
    Fatal error: Call to undefined function woocommerce_product_subcategories() in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 274
    

    Regarding it not making sense to have the function ‘woocommerce_product_subcategories’ defined, it might make sense in so far as that the modal edit dialog of the Product Slider widget has a selection for which product categories to display. (Apparently avia_product_slider::html() is called in ‘the admin page’ given the Fatal Error above).

    in reply to: _aviaLayoutBuilderCleanData keeping data old #326171

    Hi,

    Are there any plans to at least keep the post_content synchronized to the _aviaLayoutBuilderCleanData meta value (which can easily be done on saving the post/page)?

    Also, it’s too bad that wp doesn’t take the post format into account when applying content filters; otherwise using a custom format would’ve solved it.

    Thanks,
    Kenney

    UPDATE: ‘Preview Changes’ on a page shows an empty page as it uses post_content; I added this to the child theme’s functions.php to fix this:

    // save the post content in post_content; enfold only stores it in postmeta _aviaLayoutBuilderCleanData.
    add_action( 'post_updated', function($post_id) {
      if ( !empty( $_REQUEST['_aviaLayoutBuilderCleanData'] ) && empty( $_REQUEST['content'] ) )
      {
        global $wpdb;
        $wpdb->query( $wpdb->prepare(
          "UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d",
          $_REQUEST['_aviaLayoutBuilderCleanData'],
          $post_id
        ) );
      }
    } );
    
    in reply to: Woo Commerce 2.2 Support and Theme Update Questions #324486

    Hi,

    first, thanks for adding the jQuery fix from https://kriesi.at/support/topic/wordpress-4-0/ to 2.9.2!

    There is however still a bug in 2.9.2, introduced by woocommerce 2.2, in regards to the product slider:
    woocommerce.php has changed this:

            public function include_template_functions() {
    -           include_once( 'includes/wc-template-functions.php' );
    +         if ( ! is_admin() || defined( 'DOING_AJAX' ) ) {
    +                 include_once( 'includes/wc-template-functions.php' );
    +         }
            }
    

    which means that the function woocommerce_product_subcategories in that included file is not available in is_admin() mode.
    It is used in enfold/config-templatebuilder/avia-shortcodes/productslider.php, which gets run when editing a page which contains the product slider, and will produce the following error in the ‘Publish’ metabox:
    Fatal error: Call to undefined function woocommerce_product_subcategories() in /path/to/site/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/productslider.php on line 274. Only that metabox, the page title, and permalink editor are shown – all the rest of the metaboxes isn’t.

    Until this gets fixed, here’s a (dirty) workaround, to be placed in the functions.php of the child theme:

    
    // fix for woocommerce 2.2+ and enfold 2.9.2: woocommerce_product_subcategories() not available in admin mode
    add_action('woocommerce_init', function() {
      if ( ! function_exists( 'woocommerce_product_subcategories' ) )
        include_once( __DIR__.'/../../plugins/woocommerce/includes/wc-template-functions.php' );
    } );
    
    in reply to: WordPress 4.0 #314193

    Hi, just to be clear: the final string as presented to jQuery should be a[rel="SOMETHING"],
    so, the code
    .filter('a[rel=' + hash + ']');
    must become
    .filter('a[rel="' + hash + '"]');

    (i.e. .filter('a[rel=X' + hash + 'X]'); where X = double quote; original single quotes must be left intact!)

    i know, it’s hard to see ;-)

    in reply to: WordPress 4.0 #313911

    Same here, but I found the cause:
    There is an earlier jQuery syntax error for the expression a[rel=] which causes the e undefined error later on.
    Apparently the jQuery version in 3.9.2 didn’t throw a fatal error for this.

    wp-content/themes/enfold/framework/js/avia_colorpicker.js line 948:

    /**
     *
     * layout.js
     *
     */
    (function($){
        var initLayout = function() {
            var hash = window.location.hash.replace('#', '');
            var currentTab = $('ul.navigationTabs a')
                                .bind('click', showTab)
                               .filter('a[rel=' + hash + ']');           // line 948, source of the bug
            if (currentTab.size() == 0) {
                currentTab = $('ul.navigationTabs a:first');
            }
    

    Change the bold line to:
    .filter('a[rel="' + hash + '"]');
    That is, add the double quotes around the hash value.

    • This reply was modified 10 years, 2 months ago by alengio.
Viewing 5 posts - 1 through 5 (of 5 total)