![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
February 6, 2025 at 10:32 pm #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! :)
February 6, 2025 at 11:23 pm #1476562I 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?February 6, 2025 at 11:53 pm #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.
February 7, 2025 at 12:11 am #1476568the other way round ? the first is your edited version – and the second the existing enfold one?
February 7, 2025 at 2:16 am #1476573The 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.
February 7, 2025 at 2:34 am #1476574Confirmed 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.
-
This reply was modified 3 hours, 3 minutes ago by
-
AuthorPosts
- You must be logged in to reply to this topic.