Working on a KirbyTag, code gets executed twice?

Hi there!

I am new to Kirby, and working on a plugin that offers a video tag to be used in content.

I was using a few echos & var_dumps to get a better understanding of object structures and flows. While I was at it, I realized all my echos and var_dumps got executed twice, when I requested the public URL of a content I added my tag to.

Do I make sense?

What’s cooking there?

Thanks
Sascha

Without seeing your code, it’s impossible to tell what’s happening.

My bad :slight_smile:

See https://pastebin.com/fsnYMFnu

There’s a var_dump in line 53. In my content, there’s one call to the second tag. Yet, when I open the public page:

string(3) "XXX"
string(3) "XXX"
<!DOCTYPE html>
<html lang="en">
<head>
[…]

Any ideas? I have tinkered with Kirby in the past days. Nothing made me understand this behavior, tho.

The code in the link does no longer exist?

1 Like

Oh dang. The pasteboard expired.

I will update it ASAP. My bad!

You can post your code here instead of someplace else if you want.

Pastebin is rather natural for me, if that’s not too inconvenient.

https://pastebin.com/bx3ciCeW

In line 23, there’s a var_dump. It‘s executed twice on my local machine, with Kirby‘s cache off and debugging enabled, if that‘s important.

Hmm.

Hm, I can’t reproduce the duplicate var_dump in a 3.2.5 Starterkit. Does your text file only contain a single tag?

That was my first guess too, but it isn’t the case. The file contains only one tag.

My local installation is still on 3.2.4, I’ll test it with the current version and report back.

Thank you!

Must have been a hickup in my brain. Cannot reproduce. My bad.

That’s better than a bug in Kirby :wink: