Error
Call to a member function url() on null Error thrown with message "Call to a member function url() on null" Stacktrace: #11 Error in /home/warriorsstudio/public_html/site/snippets/relatedProject.php:14 #10 require in /home/warriorsstudio/public_html/kirby/src/Toolkit/Tpl.php:39 #9 Kirby\Toolkit\Tpl:load in /home/warriorsstudio/public_html/kirby/config/components.php:144 #8 Kirby\Cms\App:{closure} in /home/warriorsstudio/public_html/kirby/src/Cms/App.php:1137 #7 Kirby\Cms\App:snippet in /home/warriorsstudio/public_html/kirby/config/helpers.php:683 #6 snippet in /home/warriorsstudio/public_html/site/templates/project.php:78 #5 require in /home/warriorsstudio/public_html/kirby/src/Toolkit/Tpl.php:39 #4 Kirby\Toolkit\Tpl:load in /home/warriorsstudio/public_html/kirby/src/Cms/Template.php:164 #3 Kirby\Cms\Template:render in /home/warriorsstudio/public_html/kirby/src/Cms/Page.php:1151 #2 Kirby\Cms\Page:render in /home/warriorsstudio/public_html/kirby/src/Cms/App.php:575 #1 Kirby\Cms\App:io in /home/warriorsstudio/public_html/kirby/src/Cms/App.php:838 #0 Kirby\Cms\App:render in /home/warriorsstudio/public_html/index.php:5
Stack frames (12)
11
Error
/
site
/
snippets
/
relatedProject.php
14
10
require
/
kirby
/
src
/
Toolkit
/
Tpl.php
39
9
Kirby
\
Toolkit
\
Tpl
load
/
kirby
/
config
/
components.php
144
8
Kirby
\
Cms
\
App
{closure}
/
kirby
/
src
/
Cms
/
App.php
1137
7
Kirby
\
Cms
\
App
snippet
/
kirby
/
config
/
helpers.php
683
6
snippet
/
site
/
templates
/
project.php
78
5
require
/
kirby
/
src
/
Toolkit
/
Tpl.php
39
4
Kirby
\
Toolkit
\
Tpl
load
/
kirby
/
src
/
Cms
/
Template.php
164
3
Kirby
\
Cms
\
Template
render
/
kirby
/
src
/
Cms
/
Page.php
1151
2
Kirby
\
Cms
\
Page
render
/
kirby
/
src
/
Cms
/
App.php
575
1
Kirby
\
Cms
\
App
io
/
kirby
/
src
/
Cms
/
App.php
838
0
Kirby
\
Cms
\
App
render
/
index.php
5
/
home
/
warriorsstudio
/
public_html
/
site
/
snippets
/
relatedProject.php
<?php
/**
 * Created by Michael Maschinoff
 * www.maschinoff.com
 * www.zeppit.pro
 * [email protected]
 * Github: https://github.com/maschinoff
 * File: newsRelated.php
 * Date: 4/24/19
 * Time: 10:58 PM
 * Project: warriorsstudio.com
 */ ?>
<li class="work-related-list">
    <a href="<?= $relatedPage->url() ;?>">
        <?php
        $images = $relatedPage->images()->sortBy('sort', 'asc')->filterBy('filename', '*=', 'thumb');
        if(count($images)){
            $image = ($images->first()->url()) ? $images->first()->url() : $relatedPage->image()->url();
        }
        ?>
        <div class="image"
             style="background-image:url('<?= $image;?>');">
            <div class="image-overlay">
                <div class="text-sm title">See full case study</div>
                <div class="article-details">
                    <ul class="category">
                        <?php foreach($relatedPage->categories()->split() as $tag):?>
                            <li><?= $tag; ?></li>
                        <?php endforeach; ?>
                    </ul>
                </div>
            </div>
        </div>
        <div class="content">
            <h2 class="text-sm title"><?= $relatedPage->title();?></h2>
            <p><?= $relatedPage->text()->html();?></p>
        </div>
    </a>
</li>
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Toolkit
/
Tpl.php
    /**
     * Renders the template
     *
     * @param string $__file
     * @param array $__data
     * @return string
     */
    public static function load(string $__file = null, array $__data = []): string
    {
        if (file_exists($__file) === false) {
            return '';
        }
 
        $exception = null;
 
        ob_start();
        extract($__data);
 
        try {
            require $__file;
        } catch (Throwable $e) {
            $exception = $e;
        }
 
        $content = ob_get_contents();
        ob_end_clean();
 
        if ($exception === null) {
            return $content;
        }
 
        throw $exception;
    }
}
 
/
home
/
warriorsstudio
/
public_html
/
kirby
/
config
/
components.php
 
        return $smartypants->parse($text);
    },
 
    /**
     * Add your own snippet loader
     *
     * @param Kirby\Cms\App $kirby Kirby instance
     * @param string $name Snippet name
     * @param array $data Data array for the snippet
     * @return string|null
     */
    'snippet' => function (App $kirby, string $name, array $data = []): ?string {
        $file = $kirby->root('snippets') . '/' . $name . '.php';
 
        if (file_exists($file) === false) {
            $file = $kirby->extensions('snippets')[$name] ?? null;
        }
 
        return Snippet::load($file, $data);
    },
 
    /**
     * Add your own template engine
     *
     * @param Kirby\Cms\App $kirby Kirby instance
     * @param string $name Template name
     * @param string $type Extension type
     * @param string $defaultType Default extension type
     * @return Kirby\Cms\Template
     */
    'template' => function (App $kirby, string $name, string $type = 'html', string $defaultType = 'html') {
        return new Template($name, $type, $defaultType);
    },
 
    /**
     * Add your own thumb generator
     *
     * @param Kirby\Cms\App $kirby Kirby instance
     * @param string $src The root of the original file
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Cms
/
App.php
     *
     * @internal
     * @param string $text
     * @return string
     */
    public function smartypants(string $text = null): string
    {
        return $this->component('smartypants')($this, $text, $this->options['smartypants'] ?? []);
    }
 
    /**
     * Uses the snippet component to create
     * and return a template snippet
     *
     * @internal
     * @return Snippet
     */
    public function snippet(string $name, array $data = []): ?string
    {
        return $this->component('snippet')($this, $name, array_merge($this->data, $data));
    }
 
    /**
     * System check class
     *
     * @return System
     */
    public function system(): System
    {
        return $this->system = $this->system ?? new System($this);
    }
 
    /**
     * Uses the template component to initialize
     * and return the Template object
     *
     * @internal
     * @return Template
     */
    public function template(string $name, string $type = 'html', string $defaultType = 'html'): Template
/
home
/
warriorsstudio
/
public_html
/
kirby
/
config
/
helpers.php
function smartypants(string $text = null): string
{
    return App::instance()->smartypants($text);
}
 
/**
 * Embeds a snippet from the snippet folder
 *
 * @param string $name
 * @param array|object $data
 * @param boolean $return
 * @return string
 */
function snippet(string $name, $data = [], bool $return = false)
{
    if (is_object($data) === true) {
        $data = ['item' => $data];
    }
 
    $snippet = App::instance()->snippet($name, $data);
 
    if ($return === true) {
        return $snippet;
    }
 
    echo $snippet;
}
 
/**
 * Includes an SVG file by absolute or
 * relative file path.
 *
 * @param string $file
 * @return string
 */
function svg(string $file)
{
    $extension = F::extension($file);
 
    // check for valid svg files
/
home
/
warriorsstudio
/
public_html
/
site
/
templates
/
project.php
                                </div>
                            </div>
                        <?php endif;?>
                    </li>
                    <?php endif;?>
                    <?php $i++;?>
                <?php endforeach;?>
                </ul>
            </div>
        </div>
    </div>
</section>
 
<section class="bg-white border-t border-black">
    <div class="grid-container py-sm">
        <ul class="article-list news">
            <?php $relatedPage = $page->prev() ?>
            <?php snippet('relatedProject', compact('relatedPage'));?>
            <?php $relatedPage = $page->next() ?>
            <?php snippet('relatedProject', compact('relatedPage'));?>
        </ul>
    </div>
</section>
<?php snippet('getintouch') ?>
<?php snippet( 'footer' ) ?>
</div>
</div>
 
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Toolkit
/
Tpl.php
    /**
     * Renders the template
     *
     * @param string $__file
     * @param array $__data
     * @return string
     */
    public static function load(string $__file = null, array $__data = []): string
    {
        if (file_exists($__file) === false) {
            return '';
        }
 
        $exception = null;
 
        ob_start();
        extract($__data);
 
        try {
            require $__file;
        } catch (Throwable $e) {
            $exception = $e;
        }
 
        $content = ob_get_contents();
        ob_end_clean();
 
        if ($exception === null) {
            return $content;
        }
 
        throw $exception;
    }
}
 
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Cms
/
Template.php
        }
    }
 
    /**
     * Returns the template name
     *
     * @return string
     */
    public function name(): string
    {
        return $this->name;
    }
 
    /**
     * @param array $data
     * @return string
     */
    public function render(array $data = []): string
    {
        return Tpl::load($this->file(), $data);
    }
 
    /**
     * Returns the root to the templates directory
     *
     * @return string
     */
    public function root(): string
    {
        return App::instance()->root($this->store());
    }
 
    /**
     * Returns the template type
     *
     * @return string
     */
    public function type(): string
    {
        return $this->type;
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Cms
/
Page.php
        }
 
        // fetch the page regularly
        if ($html === null) {
            $kirby->data = $this->controller($data, $contentType);
 
            if ($contentType === 'html') {
                $template = $this->template();
            } else {
                $template = $this->representation($contentType);
            }
 
            if ($template->exists() === false) {
                throw new NotFoundException([
                    'key' => 'template.default.notFound'
                ]);
            }
 
            // render the page
            $html = $template->render($kirby->data);
 
            // convert the response configuration to an array
            $response = $kirby->response()->toArray();
 
            // cache the result
            if ($cache !== null) {
                $cache->set($cacheId, [
                    'html'     => $html,
                    'response' => $response
                ]);
            }
        }
 
        return $html;
    }
 
    /**
     * @internal
     * @return Template
     */
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Cms
/
App.php
        }
 
        // Empty input
        if (empty($input) === true) {
            return $this->io(new NotFoundException());
        }
 
        // Response Configuration
        if (is_a($input, 'Kirby\Cms\Responder') === true) {
            return $input->send();
        }
 
        // Responses
        if (is_a($input, 'Kirby\Http\Response') === true) {
            return $input;
        }
 
        // Pages
        if (is_a($input, 'Kirby\Cms\Page')) {
            $html = $input->render();
 
            if ($input->isErrorPage() === true) {
                if ($response->code() === null) {
                    $response->code(404);
                }
            }
 
            return $response->send($html);
        }
 
        // Files
        if (is_a($input, 'Kirby\Cms\File')) {
            return $response->redirect($input->mediaUrl(), 307)->send();
        }
 
        // Simple HTML response
        if (is_string($input) === true) {
            return $response->send($input);
        }
 
/
home
/
warriorsstudio
/
public_html
/
kirby
/
src
/
Cms
/
App.php
 
        $requestUri  = '/' . $this->request()->url()->path();
        $scriptName  = $_SERVER['SCRIPT_NAME'];
        $scriptFile  = basename($scriptName);
        $scriptDir   = dirname($scriptName);
        $scriptPath  = $scriptFile === 'index.php' ? $scriptDir : $scriptName;
        $requestPath = preg_replace('!^' . preg_quote($scriptPath) . '!', '', $requestUri);
 
        return $this->setPath($requestPath)->path;
    }
 
    /**
     * Returns the Response object for the
     * current request
     *
     * @return Response
     */
    public function render(string $path = null, string $method = null)
    {
        return $this->io($this->call($path, $method));
    }
 
    /**
     * Returns the Request singleton
     *
     * @return Request
     */
    public function request(): Request
    {
        return $this->request = $this->request ?? new Request;
    }
 
    /**
     * Path resolver for the router
     *
     * @internal
     * @param string $path
     * @param string|null $language
     * @return mixed
     */
/
home
/
warriorsstudio
/
public_html
/
index.php
<?php
 
require __DIR__ . '/kirby/bootstrap.php';
 
echo (new Kirby)->render();
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
USER warriorsstudio
HOME /home/warriorsstudio
SCRIPT_NAME /index.php
REQUEST_URI /projects/yes-no
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /projects/yes-no
REMOTE_PORT 45346
SCRIPT_FILENAME /home/warriorsstudio/public_html/index.php
SERVER_ADMIN [email protected]
CONTEXT_DOCUMENT_ROOT /home/warriorsstudio/public_html
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /home/warriorsstudio/public_html
REMOTE_ADDR 3.238.195.81
SERVER_PORT 443
SERVER_ADDR 85.159.212.243
SERVER_NAME warriorsstudio.com
SERVER_SOFTWARE Apache
SERVER_SIGNATURE
PATH /usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin
HTTP_X_HTTPS 1
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_CF_RAY 86b855b2abdb0827-LHR
HTTP_CF_IPCOUNTRY US
HTTP_CDN_LOOP cloudflare
HTTP_CF_VISITOR {"scheme":"https"}
HTTP_CF_CONNECTING_IP 3.238.195.81
HTTP_X_REAL_IP 3.238.195.81
HTTP_X_FORWARDED_SERVER warriorsstudio.com
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_HOST warriorsstudio.com
HTTP_X_FORWARDED_FOR 3.238.195.81
HTTP_REFERER http://warriorsstudio.com/projects/yes-no
HTTP_HOST warriorsstudio.com
proxy-nokeepalive 1
HTTPS on
HTTP_AUTHORIZATION
SCRIPT_URI https://warriorsstudio.com/projects/yes-no
SCRIPT_URL /projects/yes-no
UNIQUE_ID ZgV_sOnVRMiQYlWDFvkkYAAAAIM
REDIRECT_STATUS 200
REDIRECT_HTTPS on
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_SCRIPT_URI https://warriorsstudio.com/projects/yes-no
REDIRECT_SCRIPT_URL /projects/yes-no
REDIRECT_UNIQUE_ID ZgV_sOnVRMiQYlWDFvkkYAAAAIM
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711636400.2066
REQUEST_TIME 1711636400
argv Array ( )
argc 0
empty
0. Whoops\Handler\PrettyPageHandler