Problems accessing ccounts and some other things

I have A problem accessing the account section getting this error:

 {
        return $this->encoding;
    }
 
    /**
     * Escape a string for the HTML Body context where there are very few characters
     * of special meaning. Internally this will use htmlspecialchars().
     *
     * @return string
     */
    public function escapeHtml(string $string)
    {
        return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);
    }
 
    /**
     * Escape a string for the HTML Attribute context. We use an extended set of characters
     * to escape that are not covered by htmlspecialchars() to cover cases where an attribute
     * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE).
     *
     * @return string
     */
    public function escapeHtmlAttr(string $string)
    {
        $string = $this->toUtf8($string);
        if ($string === '' || ctype_digit($string)) {
            return $string;
        }
 
        $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string);
        return $this->fromUtf8($result);

as well as i had a blog running a while ago which wasnt working after a while, i updatet kirby and so on but somehow my blog.yml is not processed and i have no clue why. i think all problems satrted when i was implementing the multilanguage option but that also happened a while ago. Would be nice if someone could help or tell me which information is needed to solve the problems. rest of the site is working wout any problems. additinal info, im using the same blog structure on a another system which works wout any problems, only difference no multilanguage implemented

Hm, could you please post the error message and its stack trace?

Make sure that all content text files have the language extension, so for example blog.en.txt instead of blog.txt, otherwise Kirby will not know the right blueprint to use and fall back to the default.yml. If you add your languages via the Panel, Kirby takes care of this, otherwise you have to rename your files manually.


The yml file is in the pages folder and and when I try to get the author in the blog.php template it’s crashing as well. When I exclude that it’s working but not loading images and so on

Statt

Thank you, but images don’t help me much. Could you please post the content of your blog.php template (as code, not as image)?

If I understand you correctly, the fields from blog.yml are not shown when you open the blog page in the panel. What do you get instead, the default.yml blueprint?

The “page is crashing” information is not very helpful. You should usually see an error, if not, enable debugging in the /site/config/config.php file.debug | Kirby CMS, and then post the error message here.

<div class="card-footer">
            <?php if ($author = $article->author()->toUser()): ?>
            <?php endif ?>
            <p class="post-meta">Posted by <font color="#f27405">|</font> <?php echo $author->name() ?> <br>
              Date <font color="#f27405">|</font> <?= $article->date()->toDate('d F Y') ?>
            </p>
</div>

this section is responsible for the crash

Call to a member function name() on null

is the error

and i get

Column (1/1)

No sections yet

from that:

title: Superblog
icon: 📚


# Page options allow you to control how users can interact with the page.
# Here we prevent changing the page slug and page deletion
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
options:
  changeSlug: false
  delete: false

columns:
    width: 1/2
    sections:
      drafts:
        extends: sections/articles
        headline: Entwürfe
        status: draft
      unlisted:
        extends: sections/articles
        headline: In Review
        status: unlisted  
        
      meta:
        type: fields
        fields:  
          intro:
            label: Introtext
            type: textarea
            size: small
          cover:
            type: files
            headline: Cover
            layout: cards
            info: "{{ file.dimensions }}"
            template: cover
            min: 0
            max: 1
          somepic:
            type: files
            headline: Cover
            layout: cards
            info: "{{ file.dimensions }}"
            template: cover
            min: 0
            max: 1
          

    width: 1/2
    sections:
      listed:
        extends: sections/articles
        headline: Published
        status: listed

The if statement doesn’t make sense. The endif should appear after:

<div class="card-footer">
  <?php if ($author = $article->author()->toUser()): ?>
    <p class="post-meta">Posted by <font color="#f27405">|</font> <?php echo $author->name() ?> <br>
              Date <font color="#f27405">|</font> <?= $article->date()->toDate('d F Y') ?>
    </p>
  <?php endif ?>
</div>

As regards the blueprint, the indentation seems to be wrong.

columns:
  width: 1/2
    sections:
      drafts:
        extends: sections/articles
        headline: Entwürfe
        status: draft
      unlisted:
        extends: sections/articles
        headline: In Review
        status: unlisted

oh yes thx that worked, strange how taht could happen maybe a copy mistake :slight_smile:

Ok i found another problem, i was using the editor so my articels are not recognized at the moment, just if i creat new ones, guess that has to do with some formating of the file but ll find out a workarroud, thx for the help the rest is working meanwhile :slight_smile:

hi, i fixed everything so far a bit of damage was done by the editor i used before which is not longer supported. there is still the problem taht i cant enter the user section in the panel it crashes with:

TypeError

Argument 1 passed to Laminas\Escaper\Escaper::escapeHtml() must be of the type string, null given, called in /home/redhaabb/ktest.redhammer.at/kirby/src/Toolkit/Escape.php on line 104

{
        return $this->encoding;
    }
 
    /**
     * Escape a string for the HTML Body context where there are very few characters
     * of special meaning. Internally this will use htmlspecialchars().
     *
     * @return string
     */
    public function escapeHtml(string $string)
    {
        return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);
    }
 
    /**
     * Escape a string for the HTML Attribute context. We use an extended set of characters
     * to escape that are not covered by htmlspecialchars() to cover cases where an attribute
     * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE).
     *
     * @return string
     */
    public function escapeHtmlAttr(string $string)
    {
        $string = $this->toUtf8($string);
        if ($string === '' || ctype_digit($string)) {
            return $string;
        }
 
        $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string);
        return $this->fromUtf8($result);

Is there any stacktrace for the error? Check your browser console and the php error logs.

Which version of Kirby are you using (exact version number)?

first of all i updatet to the newest 3.6.2

/media/panel/99a345cdf5e5dc02cf40bb11746da4ae/js/index.js:1 GET Kirby Panel 500 sagt das browser panel

might it be possible that there is also some confligt with the multilanguage implementation ? Do i need to adapt some config fiels or anything ?

Whenever you update, remove the media folder first, clear the /site/sessions folder and make sure to clear your browser cache.

If your issue persists, please provide an error description with exact steps to reproduce the error.

its simple to reproduce it.
i can login to the panel, i click in the left upper corner on the menue point Accounts and geht following error:

Argument 1 passed to Laminas\Escaper\Escaper::escapeHtml() must be of the type string, null given, called in /home/redhaabb/ktest.redhammer.at/kirby/src/Toolkit/Escape.php on line 104

4

TypeError

…/vendor/laminas/laminas-escaper/src/Escaper.php180

23

Laminas\Escaper\Escaper escapeHtml

…/src/Toolkit/Escape.php104

22

Kirby\Toolkit\Escape html

…/config/areas/users/views.php44

21

Kirby\Http\Route {closure}

[internal]0

20

array_map

…/src/Toolkit/Collection.php1142

19

Kirby\Toolkit\Collection values

…/config/areas/users/views.php45

18

Kirby\Http\Route {closure}

…/src/Toolkit/A.php48

17

Kirby\Toolkit\A Kirby\Toolkit{closure}

[internal]0

16

array_walk_recursive

…/src/Toolkit/A.php50

15

Kirby\Toolkit\A apply

…/src/Panel/View.php234

14

Kirby\Panel\View Kirby\Panel{closure}

…/src/Toolkit/A.php48

13

Kirby\Toolkit\A Kirby\Toolkit{closure}

[internal]0

12

array_walk_recursive

…/src/Toolkit/A.php50

11

Kirby\Toolkit\A apply

…/src/Panel/View.php434

10

Kirby\Panel\View response

…/src/Panel/Panel.php276

9

Kirby\Panel\Panel response

…/src/Panel/Panel.php333

8

Kirby\Panel\Panel Kirby\Panel{closure}

…/src/Http/Router.php109

7

Kirby\Http\Router call

…/config/helpers.php647

6

router

…/src/Panel/Panel.php337

5

Kirby\Panel\Panel router

…/config/routes.php101

4

Kirby\Http\Route {closure}

[internal]0

3

Closure call

…/src/Http/Router.php111

2

Kirby\Http\Router call

…/src/Cms/App.php345

1

Kirby\Cms\App call

…/src/Cms/App.php1115

0

Kirby\Cms\App render

/home/redhaabb/ktest.redhammer.at/index.php5

and in might be a problem in line 180 of the kirby/vendor/laminas/laminas-escaper/src/Escaper.php

     */
    public function escapeHtml(string $string)
{
        return $this->encoding;
    }
 
    /**
     * Escape a string for the HTML Body context where there are very few characters
     * of special meaning. Internally this will use htmlspecialchars().
     *
     * @return string
     */
    public function escapeHtml(string $string)
    {
        return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);
    }
 
    /**
     * Escape a string for the HTML Attribute context. We use an extended set of characters
     * to escape that are not covered by htmlspecialchars() to cover cases where an attribute
     * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE).
     *
     * @return string
     */
    public function escapeHtmlAttr(string $string)
    {
        $string = $this->toUtf8($string);
        if ($string === '' || ctype_digit($string)) {
            return $string;
        }
 
        $result = preg_replace_callback('/[^a-z0-9,\.\-_]/iSu', $this->htmlAttrMatcher, $string);
        return $this->fromUtf8($result);

This line is calling $user->username() which should return either the user email or the user name. This should never be null, the question is why that happens here. Looks like there is something wrong with your user accounts.

Try removing the accounts and create a new admin by calling panel/install. If you are not on localhost, you will have to make the panel installable on remote in your config.

OMG what a super akward error, somehow another folder landed in the user folder and i have no idea how and when that happened. of course that created an error causer ther where no user credential files in that folder just some php-files. i just deleted it and everything works fine again. thx very much