Novice kirbytextinline (deprecated error) question


I’m hoping someone can assist me with an error I’ve been attempting to rectify.

In debug mode on Kirby 3.6.6 and now 3.7.0 (local/MAMP) I’ve been seeing the following notice when opening my portfolio pages only:

 Whoops \ Exception \ ErrorException (E_USER_DEPRECATED)
Cms\App::kirbytext(): the $inline parameter is deprecated and will be removed in Kirby 3.8.0. Use $options['markdown']['inline'] instead.

As far as I can ascertain this error is caused by my parent and footer menu snippets which are coded as follows:

Header menu snippet:

<nav class="menu">
    <?php foreach($pages->listed() as $item): ?>
      <a class="menu-item<?= r($item->isOpen(), ' is-active') ?>" href="<?= $item->url() ?>"<?php e($item->isOpen(), ' aria-current="page"') ?>><?= $item->navigation()->kirbytextinline() ?></a>
    <?php endforeach ?>
    <?php snippet('palette') ?>

Footer menu snippet:

<?php foreach($pages->listed() as $item): ?>
	  <p><?php e($item->isOpen(), '<span class="location">You are here → </span>') ?><a class="menu-item<?= r($item->isOpen(), ' is-active') ?>" href="<?= $item->url() ?>"<?php e($item->isOpen(), ' aria-current="page"') ?>><?= $item->navigation()->kirbytextinline() ?></a></p>
<?php endforeach ?>

I’ve referenced Kirby docs re: $options['markdown']['inline'] but no matter how many variations I’ve tried, I can’t figure out the exact syntax I should be using for this.

However, what is really puzzling me is why this deprecated error is only showing with old (previously added) portfolio pages. If I add a new page (using same blueprint, template and snippets) it works perfectly with no warnings.

Thank you for any advice, assistance or pointers. :slight_smile:

The two snippets are ok. There’s nothing deprecated there.
Are you sure the error comes from those lines? Are you sure you update the whole Kirby folder?

I mean the deprecation in question is only relevant for internal Kirby code, until you just call $field->kirbytext() or $field->kirbytextinline(), and not $kirby->kirbytext(...) nothing changed.

Thanks for the reply.

This certainly explains why I wasn’t able to fix the issue! :wink:

I have indeed replaced the entire Kirby Folder.
Typically I just delete the previous kirby folder and drop in the latest.

Out of curiosity I’ve dropped the entire Kirby site project in question into BBEdit and ran a global search for $field->kirbytext() and $field->kirbytextinline() and, only a single example of $field->kirbytext() is found within the kirby/config/methods.php. This, as you have mentioned, is an internal/core file and nothing to do with my site files.

It’s puzzling.

Actually with $field I just meant a generic field of a page, like $item->navigation()->kirbytextinline() ($field in this case would be $item->navigation(), not literally $field). So it’s no wonder you didn’t find any :wink:

Have you any plugins installed that do stuff with kirbytext?

Could you show us the stacktrace of the error (the left column in the “whoops” error screen)?

Ah, haha. That certainly does explain why I didn’t find anything. I’ve learned something new though. Thanks. :blush:

I don’t have any plugins installed, just a basic ‘stock’ install of Kirby.

Here’s a stacktrace of the error.
Too long for a screen shot so I hope this is ok.

 Stack frames (21)
20 Whoops\Exception\ErrorException

19 trigger_error

18 Kirby\Cms\Helpers deprecated

17 Kirby\Cms\App kirbytext

16 Kirby\Cms\Core {closure}

15 Kirby\Text\KirbyTag render

14 Kirby\Text\KirbyTags Kirby\Text\{closure}

13 preg_replace_callback

12 Kirby\Text\KirbyTags parse

11 Kirby\Cms\App kirbytags

10 Kirby\Cms\App kirbytext

9 Kirby\Cms\Core {closure}

8 Kirby\Cms\Field __call

7 include

6 Kirby\Filesystem\F loadIsolated

5 Kirby\Filesystem\F load

4 Kirby\Toolkit\Tpl load

3 Kirby\Cms\Template render

2 Kirby\Cms\Page render

1 Kirby\Cms\App io

0 Kirby\Cms\App render

Thanks again for taking the time to look at this for me. I appreciate it. :slight_smile:

So, what’s in /site/templates/project.php on line 21?

Hey, that was quick! :wink:

Line 21 of template/project.php is as follows:

<?= $page->text()->kirbytext() ?>

As mentioned, It’s these project (portfolio) pages that are throwing the deprecated error.

Congratulations. You have found a regression (a bug) in Kirby 3.7.
I’ll create an issue for you.

Edit: actually there is already one: [3.7.0] Textarea - Image with caption throws deprecation notice · Issue #4435 · getkirby/kirby · GitHub

Ah, I read about this with one of the pre-3.7.0 release candidates but thought it had been rectified. I’m just happy to know it’s not my code! :sweat_smile:

I’m now a little more knowledgeable with $field and debug mode. Bonus points!

Thanks again for the assistance. Very much appreciated.


Just to follow up…

This issue appears to be fixed (for me anyway) in Kirby

Thank you. :slight_smile: