Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1476557

    I’m surprised I couldn’t find anything else about this on the forum as it’s happening to me on all my sites that use the portfolio… and it takes down the site completely.

    In /themes/enfold/config-templatebuilder/avia-shortcodes/portfolio/portfolio.php on line 1312 inside the function sort_cat_string, the WordPress function get_the_terms() is called. get_the_terms returns OBJECTS (See: https://developer.wordpress.org/reference/functions/get_the_terms/) But the code in this function assumes it’s returning arrays, leading to Fatal errors.

    I’d love to see a fix to this get integrated so I can stop manually patching it! :)

    #1476562

    I run many portfolios – and I have never seen such a fatal error on my websites. As you mentioned, there are no other messages about this on the forum.
    What exactly are you changing manually? – Do you have any custom post types running?

    #1476565
    $item_categories = get_the_terms( $the_id, $params['taxonomy'] );
    
    			if( is_object( $item_categories ) || is_array( $item_categories ) )
    			{
    				foreach( $item_categories as $cat )
    				{
    					//fix for cyrillic, etc. characters - isotope does not support the % char
    					$cat['slug'] = str_replace('%', '', $cat['slug'] );
    
    					$sort_classes .= $cat['slug'] . '_sort ';
    				}
    			}

    becomes

    $item_categories = get_the_terms( $the_id, $params['taxonomy'] );
    
    			if( is_object( $item_categories ) || is_array( $item_categories ) )
    			{
    				foreach( $item_categories as $cat )
    				{
    					//fix for cyrillic, etc. characters - isotope does not support the % char
    					$cat->slug = str_replace('%', '', $cat->slug );
    
    					$sort_classes .= $cat->slug . '_sort ';
    				}
    			}

    Since they are objects, not arrays. I usually have custom post types and custom taxonomies. These are going through custom taxonomies in my current example.

    • This reply was modified 3 hours, 3 minutes ago by christiemade.
    • This reply was modified 3 hours, 2 minutes ago by christiemade.
    #1476568

    the other way round ? the first is your edited version – and the second the existing enfold one?

    #1476573

    The second one is what I’m changing it to – but I see what you mean, a fresh copy has these changes in them! But I have clients who when they auto-update are getting the old version of this code, and the site crashes, so I guess that’s where the investigation needs to go…. Let me check and see how they’re updating.

    #1476574

    Confirmed that in this most recent case it occurred when she updated the theme automatically through the Theme Updates feature. But if it’s not in the actual Enfold files incorrectly then I’d like to keep this open and monitor it after the next update in case there is something wrong with the sync for some reason.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.