foreach() argument must be of type array|object, null given (View: /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/resources/views/page.blade.php) (500 Internal Server Error)

Symfony Exception

ErrorException ViewException

HTTP 500 Internal Server Error

foreach() argument must be of type array|object, null given (View: /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/resources/views/page.blade.php)

Exceptions 2

Illuminate\View\ ViewException

  1. <?php $__env->startSection('content'); ?>
  2.     <?php while(have_posts()): ?> <?php (the_post()); ?>
  3.         <?php $__currentLoopData get_field('flex_content'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $content): $__env->incrementLoopIndices(); $loop $__env->getLastLoop(); ?> 
  4.             <?php echo $__env->make('partials.'.$content['acf_fc_layout'], ['data' => $content], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data''__path']))->render(); ?>
  5.         <?php endforeach; $__env->popLoop(); $loop $__env->getLastLoop(); ?>
  6.         <?php echo $__env->first(['partials.content-page''partials.content'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data''__path']))->render(); ?>
  7.     <?php endwhile; ?>
  1.         // flush out any stray output that might get out before an error occurs or
  2.         // an exception is thrown. This prevents any partial views from leaking.
  3.         try {
  4.             $this->files->getRequire($path$data);
  5.         } catch (Throwable $e) {
  6.             $this->handleViewException($e$obLevel);
  7.         }
  8.         return ltrim(ob_get_clean());
  9.     }
  1.         // Once we have the path to the compiled file, we will evaluate the paths with
  2.         // typical PHP just like any other templates. We also keep a stack of views
  3.         // which have been rendered for right exception messages to be generated.
  4.         try {
  5.             $results $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6.         } catch (ViewException $e) {
  7.             if (! str($e->getMessage())->contains(['No such file or directory''File does not exist at path'])) {
  8.                 throw $e;
  9.             }
  1.      *
  2.      * @return string
  3.      */
  4.     protected function getContents()
  5.     {
  6.         return $this->engine->get($this->path$this->gatherData());
  7.     }
  8.     /**
  9.      * Get the data bound to the view instance.
  10.      *
  1.         // clear out the sections for any separate views that may be rendered.
  2.         $this->factory->incrementRender();
  3.         $this->factory->callComposer($this);
  4.         $contents $this->getContents();
  5.         // Once we've finished rendering the view, we'll decrement the render count
  6.         // so that each section gets flushed out next time a view is created and
  7.         // no old sections are staying around in the memory of an environment.
  8.         $this->factory->decrementRender();
  1.      * @throws \Throwable
  2.      */
  3.     public function render(callable $callback null)
  4.     {
  5.         try {
  6.             $contents $this->renderContents();
  7.             $response = isset($callback) ? $callback($this$contents) : null;
  8.             // Once we have the contents of the view, we will flush the sections if we are
  9.             // done rendering all views so that there is nothing left hanging over when
  1.   <body <?php body_class('font-open-sans text-brand-black'); ?>>
  2.     <?php wp_body_open(); ?>
  3.     <?php do_action('get_header'); ?>
  4.     <div id="app" class="wrap">
  5.       <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  6.     </div>
  7.     <?php do_action('get_footer'); ?>
  8.     <?php wp_footer(); ?>
  9.   </body>
include('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/index.php') in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php (line 106)
  1.      *
  2.      * @param string $template The path of the template to include.
  3.      */
  4.     $template apply_filters'template_include'$template );
  5.     if ( $template ) {
  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('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php') in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/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('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-blog-header.php') in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/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';

ErrorException

foreach() argument must be of type array|object, null given

  1. <?php $__env->startSection('content'); ?>
  2.     <?php while(have_posts()): ?> <?php (the_post()); ?>
  3.         <?php $__currentLoopData get_field('flex_content'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $content): $__env->incrementLoopIndices(); $loop $__env->getLastLoop(); ?> 
  4.             <?php echo $__env->make('partials.'.$content['acf_fc_layout'], ['data' => $content], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data''__path']))->render(); ?>
  5.         <?php endforeach; $__env->popLoop(); $loop $__env->getLastLoop(); ?>
  6.         <?php echo $__env->first(['partials.content-page''partials.content'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data''__path']))->render(); ?>
  7.     <?php endwhile; ?>
  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(2, 'foreach() argument must be of type array|object, null given', '/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php', 3) in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php (line 3)
  1. <?php $__env->startSection('content'); ?>
  2.     <?php while(have_posts()): ?> <?php (the_post()); ?>
  3.         <?php $__currentLoopData get_field('flex_content'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $content): $__env->incrementLoopIndices(); $loop $__env->getLastLoop(); ?> 
  4.             <?php echo $__env->make('partials.'.$content['acf_fc_layout'], ['data' => $content], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data''__path']))->render(); ?>
  5.         <?php endforeach; $__env->popLoop(); $loop $__env->getLastLoop(); ?>
  6.         <?php echo $__env->first(['partials.content-page''partials.content'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data''__path']))->render(); ?>
  7.     <?php endwhile; ?>
  1.             $__data $data;
  2.             return (static function () use ($__path$__data) {
  3.                 extract($__dataEXTR_SKIP);
  4.                 return require $__path;
  5.             })();
  6.         }
  7.         throw new FileNotFoundException("File does not exist at path {$path}.");
  8.     }
  1.             return (static function () use ($__path$__data) {
  2.                 extract($__dataEXTR_SKIP);
  3.                 return require $__path;
  4.             })();
  5.         }
  6.         throw new FileNotFoundException("File does not exist at path {$path}.");
  7.     }
  1.         // We'll evaluate the contents of the view inside a try/catch block so we can
  2.         // flush out any stray output that might get out before an error occurs or
  3.         // an exception is thrown. This prevents any partial views from leaking.
  4.         try {
  5.             $this->files->getRequire($path$data);
  6.         } catch (Throwable $e) {
  7.             $this->handleViewException($e$obLevel);
  8.         }
  9.         return ltrim(ob_get_clean());
  1.         // Once we have the path to the compiled file, we will evaluate the paths with
  2.         // typical PHP just like any other templates. We also keep a stack of views
  3.         // which have been rendered for right exception messages to be generated.
  4.         try {
  5.             $results $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6.         } catch (ViewException $e) {
  7.             if (! str($e->getMessage())->contains(['No such file or directory''File does not exist at path'])) {
  8.                 throw $e;
  9.             }
  1.      *
  2.      * @return string
  3.      */
  4.     protected function getContents()
  5.     {
  6.         return $this->engine->get($this->path$this->gatherData());
  7.     }
  8.     /**
  9.      * Get the data bound to the view instance.
  10.      *
  1.         // clear out the sections for any separate views that may be rendered.
  2.         $this->factory->incrementRender();
  3.         $this->factory->callComposer($this);
  4.         $contents $this->getContents();
  5.         // Once we've finished rendering the view, we'll decrement the render count
  6.         // so that each section gets flushed out next time a view is created and
  7.         // no old sections are staying around in the memory of an environment.
  8.         $this->factory->decrementRender();
  1.      * @throws \Throwable
  2.      */
  3.     public function render(callable $callback null)
  4.     {
  5.         try {
  6.             $contents $this->renderContents();
  7.             $response = isset($callback) ? $callback($this$contents) : null;
  8.             // Once we have the contents of the view, we will flush the sections if we are
  9.             // done rendering all views so that there is nothing left hanging over when
  1.   <body <?php body_class('font-open-sans text-brand-black'); ?>>
  2.     <?php wp_body_open(); ?>
  3.     <?php do_action('get_header'); ?>
  4.     <div id="app" class="wrap">
  5.       <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  6.     </div>
  7.     <?php do_action('get_footer'); ?>
  8.     <?php wp_footer(); ?>
  9.   </body>
include('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/index.php') in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php (line 106)
  1.      *
  2.      * @param string $template The path of the template to include.
  3.      */
  4.     $template apply_filters'template_include'$template );
  5.     if ( $template ) {
  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('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php') in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/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('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-blog-header.php') in /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/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 Traces 2

[2/2] ViewException
Illuminate\View\ViewException:
foreach() argument must be of type array|object, null given (View: /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/resources/views/page.blade.php)

  at /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php:3
  at Illuminate\View\Engines\CompilerEngine->handleViewException(object(ErrorException), 1)
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/Engines/PhpEngine.php:60)
  at Illuminate\View\Engines\PhpEngine->evaluatePath('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php', array('__env' => object(Factory), 'app' => object(Application), 'siteName' => 'Robertsons Charkuteri'))
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/Engines/CompilerEngine.php:70)
  at Illuminate\View\Engines\CompilerEngine->get('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/resources/views/page.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'siteName' => 'Robertsons Charkuteri'))
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/View.php:195)
  at Illuminate\View\View->getContents()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/View.php:178)
  at Illuminate\View\View->renderContents()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/View.php:147)
  at Illuminate\View\View->render()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/index.php:14)
  at include('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/index.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php:106)
  at require_once('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-blog-header.php:19)
  at require('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-blog-header.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/index.php:17)                
[1/2] ErrorException
ErrorException:
foreach() argument must be of type array|object, null given

  at /www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php:3
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'foreach() argument must be of type array|object, null given', '/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php', 3, array())
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:49)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError(2, 'foreach() argument must be of type array|object, null given', '/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php', 3)
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php:3)
  at require('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/filesystem/Filesystem.php:109)
  at Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/filesystem/Filesystem.php:110)
  at Illuminate\Filesystem\Filesystem->getRequire('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php', array('__env' => object(Factory), 'app' => object(Application), 'siteName' => 'Robertsons Charkuteri'))
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/Engines/PhpEngine.php:58)
  at Illuminate\View\Engines\PhpEngine->evaluatePath('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/cache/acorn/framework/views/51191f9fb7a3b39b0f3a0e57a15b9409ee709d16.php', array('__env' => object(Factory), 'app' => object(Application), 'siteName' => 'Robertsons Charkuteri'))
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/Engines/CompilerEngine.php:70)
  at Illuminate\View\Engines\CompilerEngine->get('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/resources/views/page.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'siteName' => 'Robertsons Charkuteri'))
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/View.php:195)
  at Illuminate\View\View->getContents()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/View.php:178)
  at Illuminate\View\View->renderContents()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/vendor/illuminate/view/View.php:147)
  at Illuminate\View\View->render()
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/index.php:14)
  at include('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-content/themes/robertsonscharkuteri/index.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php:106)
  at require_once('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-includes/template-loader.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-blog-header.php:19)
  at require('/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/wp-blog-header.php')
     (/www/webvol37/ie/7yr2t5kk5n4ya2u/robertsonscharkuteri.se/public_html/index.php:17)