• About Us
    • Who We Are
    • Our Clients
    • The Lisi Difference
    • Capabilities
  • Projects
  • Contact Us
Attempt to read property "slug" on array (500 Internal Server Error)

Symfony Exception

Symfony Docs

ErrorException

HTTP 500 Internal Server Error

Attempt to read property "slug" on array

Exception

ErrorException

in /home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/app/setup.php (line 197)
  1.         $categories_array = wp_get_object_terms( $id, 'media_category' );
  2.         $categories       = [];
  3.         foreach ( $categories_array as $category ) {
  4.             //Add current category to list of ones to show before pictures
  5.             $category_selector[$category->slug] = $category;
  6.             $categories[] = $category->slug;
  7.         }
  8.         $categories = implode( ' ', $categories );
in /home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php -> handleError (line 49)
  1.      * @throws \ErrorException
  2.      */
  3.     public function handleError($level, $message, $file = '', $line = 0, $context = [])
  4.     {
  5.         try {
  6.             parent::handleError($level, $message, $file, $line, $context);
  7.         } catch (Throwable $e) {
  8.             if (! apply_filters('acorn/throw_error_exception', true, $e)) {
  9.                 return false;
  10.             }
HandleExceptions->handleError() in /home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/app/setup.php (line 197)
  1.         $categories_array = wp_get_object_terms( $id, 'media_category' );
  2.         $categories       = [];
  3.         foreach ( $categories_array as $category ) {
  4.             //Add current category to list of ones to show before pictures
  5.             $category_selector[$category->slug] = $category;
  6.             $categories[] = $category->slug;
  7.         }
  8.         $categories = implode( ' ', $categories );
App\{closure}() in /home/g9zbyhszuhko/public_html/wp-includes/class-wp-hook.php (line 324)
  1.                 // Avoid the array_slice() if possible.
  2.                 if ( 0 === $the_['accepted_args'] ) {
  3.                     $value = call_user_func( $the_['function'] );
  4.                 } elseif ( $the_['accepted_args'] >= $num_args ) {
  5.                     $value = call_user_func_array( $the_['function'], $args );
  6.                 } else {
  7.                     $value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
  8.                 }
  9.             }
  10.         } while ( false !== next( $this->iterations[ $nesting_level ] ) );
WP_Hook->apply_filters() in /home/g9zbyhszuhko/public_html/wp-includes/plugin.php (line 205)
  1.     }
  2.     // Pass the value to WP_Hook.
  3.     array_unshift( $args, $value );
  4.     $filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
  5.     array_pop( $wp_current_filter );
  6.     return $filtered;
  7. }
apply_filters() in /home/g9zbyhszuhko/public_html/wp-includes/class-wp-block.php (line 638)
  1.          *
  2.          * @param string   $block_content The block content.
  3.          * @param array    $block         The full block, including name and attributes.
  4.          * @param WP_Block $instance      The block instance.
  5.          */
  6.         $block_content = apply_filters( 'render_block', $block_content, $this->parsed_block, $this );
  7.         /**
  8.          * Filters the content of a single block.
  9.          *
  10.          * The dynamic portion of the hook name, `$name`, refers to
WP_Block->render() in /home/g9zbyhszuhko/public_html/wp-includes/class-wp-block.php (line 566)
  1.                             $inner_block->refresh_context_dependents();
  2.                         } elseif ( $inner_block->parsed_block !== $source_block ) {
  3.                             $inner_block->refresh_parsed_block_dependents();
  4.                         }
  5.                         $block_content .= $inner_block->render();
  6.                     }
  7.                     ++$index;
  8.                 }
  9.             }
WP_Block->render() in /home/g9zbyhszuhko/public_html/wp-includes/blocks.php (line 2359)
  1.      */
  2.     $context = apply_filters( 'render_block_context', $context, $parsed_block, $parent_block );
  3.     $block = new WP_Block( $parsed_block, $context );
  4.     return $block->render();
  5. }
  6. /**
  7.  * Parses blocks out of a content string.
  8.  *
render_block() in /home/g9zbyhszuhko/public_html/wp-includes/blocks.php (line 2431)
  1.      * allocated during the render will be freed and reused for the next block.
  2.      * Before making this change, that memory was retained and would lead to
  3.      * out-of-memory crashes for certain posts that now run with this change.
  4.      */
  5.     for ( $i = 0; $i < $top_level_block_count; $i++ ) {
  6.         $output      .= render_block( $blocks[ $i ] );
  7.         $blocks[ $i ] = null;
  8.     }
  9.     // If there are blocks in this content, we shouldn't run wpautop() on it later.
  10.     $priority = has_filter( 'the_content', 'wpautop' );
do_blocks() in /home/g9zbyhszuhko/public_html/wp-includes/class-wp-hook.php (line 324)
  1.                 // Avoid the array_slice() if possible.
  2.                 if ( 0 === $the_['accepted_args'] ) {
  3.                     $value = call_user_func( $the_['function'] );
  4.                 } elseif ( $the_['accepted_args'] >= $num_args ) {
  5.                     $value = call_user_func_array( $the_['function'], $args );
  6.                 } else {
  7.                     $value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
  8.                 }
  9.             }
  10.         } while ( false !== next( $this->iterations[ $nesting_level ] ) );
WP_Hook->apply_filters() in /home/g9zbyhszuhko/public_html/wp-includes/plugin.php (line 205)
  1.     }
  2.     // Pass the value to WP_Hook.
  3.     array_unshift( $args, $value );
  4.     $filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
  5.     array_pop( $wp_current_filter );
  6.     return $filtered;
  7. }
apply_filters() in /home/g9zbyhszuhko/public_html/wp-includes/post-template.php (line 256)
  1.      *
  2.      * @since 0.71
  3.      *
  4.      * @param string $content Content of the current post.
  5.      */
  6.     $content = apply_filters( 'the_content', $content );
  7.     $content = str_replace( ']]>', ']]&gt;', $content );
  8.     echo $content;
  9. }
  10. /**
the_content() in /home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/index.php (line 37)
  1. }?>
  2.     </div></nav>
  3. </header>
  4.     <main id="main" class="main">
  5.       <?php //echo view(app('sage.view'), app('sage.data'))->render(); ?>
  6.       <?php the_content()?>
  7.     </main></div>
  8.     <footer id="colophon" class="content-info"><div class="container">
  9.   <div>©<?php echo date( 'Y' ) ?>   <span class="uppercase"><?php echo get_bloginfo( 'name' ) ?></span></div>
  10. </div></footer>
  11.     <?php
include('/home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/index.php') in /home/g9zbyhszuhko/public_html/wp-includes/template-loader.php (line 113)
  1.         is_string( $template ) &&
  2.         ( str_ends_with( $template, '.php' ) || str_ends_with( $template, '.html' ) ) &&
  3.         is_file( $template ) &&
  4.         is_readable( $template )
  5.     ) {
  6.         include $template;
  7.     } elseif ( current_user_can( 'switch_themes' ) ) {
  8.         $theme = wp_get_theme();
  9.         if ( $theme->errors() ) {
  10.             wp_die( $theme->errors() );
  11.         }
require_once('/home/g9zbyhszuhko/public_html/wp-includes/template-loader.php') in /home/g9zbyhszuhko/public_html/wp-blog-header.php (line 19)
  1.     // Set up the WordPress query.
  2.     wp();
  3.     // Load the theme template.
  4.     require_once ABSPATH . WPINC . '/template-loader.php';
  5. }
require('/home/g9zbyhszuhko/public_html/wp-blog-header.php') in /home/g9zbyhszuhko/public_html/index.php (line 17)
  1.  * @var bool
  2.  */
  3. define( 'WP_USE_THEMES', true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ . '/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Attempt to read property "slug" on array

  at /home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/app/setup.php:197
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
     (/home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:49)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError()
     (/home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/app/setup.php:197)
  at App\{closure}()
     (/home/g9zbyhszuhko/public_html/wp-includes/class-wp-hook.php:324)
  at WP_Hook->apply_filters()
     (/home/g9zbyhszuhko/public_html/wp-includes/plugin.php:205)
  at apply_filters()
     (/home/g9zbyhszuhko/public_html/wp-includes/class-wp-block.php:638)
  at WP_Block->render()
     (/home/g9zbyhszuhko/public_html/wp-includes/class-wp-block.php:566)
  at WP_Block->render()
     (/home/g9zbyhszuhko/public_html/wp-includes/blocks.php:2359)
  at render_block()
     (/home/g9zbyhszuhko/public_html/wp-includes/blocks.php:2431)
  at do_blocks()
     (/home/g9zbyhszuhko/public_html/wp-includes/class-wp-hook.php:324)
  at WP_Hook->apply_filters()
     (/home/g9zbyhszuhko/public_html/wp-includes/plugin.php:205)
  at apply_filters()
     (/home/g9zbyhszuhko/public_html/wp-includes/post-template.php:256)
  at the_content()
     (/home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/index.php:37)
  at include('/home/g9zbyhszuhko/public_html/wp-content/themes/lisi-theme/index.php')
     (/home/g9zbyhszuhko/public_html/wp-includes/template-loader.php:113)
  at require_once('/home/g9zbyhszuhko/public_html/wp-includes/template-loader.php')
     (/home/g9zbyhszuhko/public_html/wp-blog-header.php:19)
  at require('/home/g9zbyhszuhko/public_html/wp-blog-header.php')
     (/home/g9zbyhszuhko/public_html/index.php:17)