ErrorException: Invalid argument supplied for foreach()

Debugger::handle_error (2, "Invalid argument supplied for foreach()", "/home/x11alto/public_html/apps/blog/handlers/tag.php", 33, array(13))

33/home/x11alto/public_html/apps/blog/handlers/tag.php

31. }
32.
33. foreach ($posts as $post) {
34.     $post->url '/blog/post/' $post->id '/' URLify::filter ($post->title);
35.     $post->tag_list = (strlen ($post->tags) > 0) ? explode (','$post->tags) : array ();

require ("/home/x11alto/public_html/apps/blog/handlers/tag.php")

471/home/x11alto/public_html/lib/Controller.php

469.         // Run the handler and get its output
470.         ob_start ();
471.         $res = require ($handler);
472.         $out ob_get_clean ();
473.         if (is_string ($res) && strlen ($res) > 0) {

Controller->handle ("apps/blog/handlers/tag.php", false)

175/home/x11alto/public_html/lib/FrontController.php

173.             $handler $controller->route ($_SERVER['REQUEST_URI']);
174.         }
175.         $page->body $controller->handle ($handlerfalse);
176.
177.         /**

FrontController::run ()

34/home/x11alto/public_html/index.php

32. $argc = isset ($argc) ? $argc null;
33. $argv = isset ($argv) ? $argv null;
34. return FrontController::run ($argv$argc);

Error Context

$_COOKIE = array ();

$_SERVER = array (
    
"LSPHP_ENABLE_USER_INI" => "on"
    "PATH" 
=> "/usr/local/bin:/usr/bin:/bin"
    "TEMP" 
=> "/tmp"
    "TMP" 
=> "/tmp"
    "TMPDIR" 
=> "/tmp"
    "PWD" 
=> "/"
    "HTTP_ACCEPT" 
=> "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
    "HTTP_ACCEPT_ENCODING" 
=> "br,gzip"
    "HTTP_ACCEPT_LANGUAGE" 
=> "en-US,en;q=0.5"
    "HTTP_CONNECTION" 
=> "Keep-Alive"
    "CONTENT_LENGTH" 
=> 0
    
"HTTP_HOST" => "altonarchers.co.uk"
    "HTTP_USER_AGENT" 
=> "CCBot/2.0 (https://commoncrawl.org/faq/)"
    "HTTP_X_HTTPS" 
=> 1
    
"REDIRECT_UNIQUE_ID" => "X5hl3w94JvfXpSrMnIv7ygAAAJQ"
    "REDIRECT_SCRIPT_URL" 
=> "/blog/tag/diary"
    "REDIRECT_SCRIPT_URI" 
=> "https://altonarchers.co.uk/blog/tag/diary"
    "REDIRECT_HTTPS" 
=> "on"
    "REDIRECT_SSL_TLS_SNI" 
=> "altonarchers.co.uk"
    "REDIRECT_STATUS" 
=> 200
    
"UNIQUE_ID" => "X5hl3w94JvfXpSrMnIv7ygAAAJQ"
    "SCRIPT_URL" 
=> "/blog/tag/diary"
    "SCRIPT_URI" 
=> "https://altonarchers.co.uk/blog/tag/diary"
    "HTTPS" 
=> "on"
    "SSL_TLS_SNI" 
=> "altonarchers.co.uk"
    "SERVER_SIGNATURE" 
=> ""
    "SERVER_SOFTWARE" 
=> "Apache"
    "SERVER_NAME" 
=> "altonarchers.co.uk"
    "SERVER_ADDR" 
=> "81.27.85.11"
    "SERVER_PORT" 
=> 443
    
"REMOTE_ADDR" => "34.201.9.19"
    "DOCUMENT_ROOT" 
=> "/home/x11alto/public_html"
    "REQUEST_SCHEME" 
=> "https"
    "CONTEXT_PREFIX" 
=> ""
    "CONTEXT_DOCUMENT_ROOT" 
=> "/home/x11alto/public_html"
    "SERVER_ADMIN" 
=> "webmaster@altonarchers.co.uk"
    "SCRIPT_FILENAME" 
=> "/home/x11alto/public_html/index.php"
    "REMOTE_PORT" 
=> 52324
    
"REDIRECT_URL" => "/blog/tag/diary"
    "SERVER_PROTOCOL" 
=> "HTTP/1.1"
    "REQUEST_METHOD" 
=> "GET"
    "QUERY_STRING" 
=> ""
    "REQUEST_URI" 
=> "/blog/tag/diary"
    "SCRIPT_NAME" 
=> "/index.php"
    "PHP_SELF" 
=> "/index.php"
    "REQUEST_TIME_FLOAT" 
=> 1603823071.93
    
"REQUEST_TIME" => 1603823071
    
"argv" => array ()
    
"argc" => 0
);

$handler "apps/blog/handlers/tag.php";

$internal false;

$data = array ();

$page Page (
    
$head "";
    
$tail "";
    
$title "";
    
$_menu_title "";
    
$_window_title "";
    
$body "";
    
$layout "archers-main";
    
$scripts = array ();
    
$is_being_rendered false;
    
$cache_control true;
    
$preview false;
    
$id "blog";
    
$limit 10;
    
$tag "diary";
    
$num 0;
    
$offset 0;
    
$count false;
    
$last 1;
    
$more false;
    
$next 2;
);

$tpl Template (
    
$charset "UTF-8";
    
$cache_folder "cache";
    
$layouts_folder "layouts";
    
$view_folders "apps/%s/views/%s";
    
$default_layout "default";
    
$file_extension "html";
    
$controller Controller (
        
$params = array (
            
"diary"
        
);
        
$internal false;
        
$data = array ();
        
$cli false;
        
$put_data = ;
        
$app "blog";
        
$uri "blog/tag/diary";
        
$chunked false;
        
$cache false;
        
$status_code false;
);
);

$cache Cache (
    
$dir "cache/datastore";
);

$i18n I18n (
    
$language "en";
    
$locale = ;
    
$directory "lang";
    
$lang_hash = array (
        
"en" => array (
            
"Home" => "Home"
        
)
    );
    
$hash_order = array (
        
"en"
    
);
    
$charset "UTF-8";
    
$fullname "English";
    
$day_date_format "dddd, mmmm d, yyyy";
    
$short_day_date_format "ddd, mmm d";
    
$date_format "mmmm d, yyyy";
    
$short_format "mmm d";
    
$time_format "h:MMa";
    
$year_format "yyyy";
    
$fallbacks = array ();
    
$languages = array (
        
"de" => array (
            
"name" => "Deutsch"
            "code" 
=> "de"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "default" 
=> ""
            "date_format" 
=> "d mmmm yyyy"
            "short_format" 
=> "d mmm"
            "time_format" 
=> "HH:MM"
        
)
        
"en" => array (
            
"name" => "English"
            "code" 
=> "en"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> 1
        
)
        
"fr" => array (
            
"name" => "Français"
            "code" 
=> "fr"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"it" => array (
            
"name" => "Italiano"
            "code" 
=> "it"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "default" 
=> ""
        
)
        
"nl" => array (
            
"name" => "Nederlands"
            "code" 
=> "nl"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"pt_br" => array (
            
"name" => "Português brasileiro"
            "code" 
=> "pt"
            "locale" 
=> "br"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "mmmm d, yyyy"
            "short_format" 
=> "mmm d"
            "time_format" 
=> "h:MMa"
        
)
        
"sl_si" => array (
            
"name" => "Slovenščina"
            "code" 
=> "sl"
            "locale" 
=> "si"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"cs" => array (
            
"name" => "Česky"
            "code" 
=> "cs"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "locale" 
=> ""
            "date_format" 
=> "d.mmmm yyyy"
            "short_format" 
=> "dd.mm.yyyy"
            "time_format" 
=> "HH:MM"
        
)
        
"ru" => array (
            
"name" => "Русский"
            "code" 
=> "ru"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "dd mmmm yyyy"
            "short_format" 
=> "dd mmm"
            "time_format" 
=> "HH:MM"
        
)
        
"uk" => array (
            
"name" => "Українська"
            "code" 
=> "uk"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "dd mmmm yyyy"
            "short_format" 
=> "dd mmm"
            "time_format" 
=> "HH:mm"
        
)
        
"ja" => array (
            
"name" => "日本語"
            "code" 
=> "ja"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"zh" => array (
            
"name" => "简体中文"
            "code" 
=> "zh"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
    );
    
$cookieName "lang";
    
$url_includes_lang false;
    
$new_request_uri "";
    
$prefix "";
    
$negotiation "http";
    
$error = ;
    
$default "en";
);

$cache_uri "_c_blog_tag_diary";

$out false;

$appconf = array (
    
"Blog" => array (
        
"title" => "News"
        "layout" 
=> "archers-main"
        "post_layout" 
=> "archers-main"
        "include_in_nav" 
=> 1
        
"preview_chars" => 750
        
"post_format" => "html"
        "comments" 
=> "comments/embed"
        "show_related_posts" 
=> ""
        "disqus_shortname" 
=> ""
    
)
    
"Social Buttons" => array (
        
"twitter" => ""
        "facebook" 
=> ""
        "google" 
=> ""
    
)
    
"Custom Handlers" => array (
        
"blog/index" => "blog/index"
        "blog/post" 
=> "blog/post"
    
)
    
"Admin" => array (
        
"handler" => "blog/admin"
        "name" 
=> "Blog Posts"
        "install" 
=> "blog/upgrade"
        "upgrade" 
=> "blog/upgrade"
        "version" 
=> "1.1.4-stable"
        "sitemap" 
=> "blog\Post::sitemap"
        "search" 
=> "blog\Post::search"
    
)
);

$preview_chars 750;

$p blog\Post (
    
$table "#prefix#blog_post";
    
$_extended_field "extra";
    
$_extended false;
    
$key "id";
    
$keyval false;
    
$data = array ();
    
$fields = array ();
    
$error false;
    
$is_new true;
    
$query_fields "*";
    
$query_order "";
    
$query_group "";
    
$query_filters = array ();
    
$query_params = array ();
    
$query_having = array ();
    
$query_from false;
    
$verify = array ();
    
$failed = array ();
);

$posts false;