Checkboxes options: url doesn't show results on dokku server

Hi there,

I have a problem with a kirby site that is deployed on a dokku server. The site works like a charm, but when I want to edit an entry that has a checkboxes field the checkboxes are not rendered. The JSON url works and locally (MAMP) it works as well.

Code in blueprint:

    type: checkboxes
    label: Awards
    options: url
    url: /api/prices

Result in json:

    "price-one": "Price - One",
    "price-two": "Price - Two",
    "price-three": "Price - Three",
    "price-four": "Price - Four",
    "price-five": "Price - Five",
    "price-six": "Price - Six",
    "price-seven": "Price - Seven",
    "price-eight": "Price - Eight",
    "price-nine": "Price - Nine",
    "price-ten": "Price - Ten"

Anyone got an idea?

Thank you,

I think you cannot use a “local” endpoint in Kirby 2. If you need that, I think you can achieve this with the controlled list plugin.

@bvdputte relative URLs are possible since 2.5.0

@vanjim Do you get any errors in your console, php error log or server error log?

@texnixe no, there are no errors…

How is your API created? Via a route? If so, where is the route defined?

The API is a route yes. It is defined in the config.php

@bvdputte s answer did help though, it now works. Added bonus is that the json is not exposed.

That’s true, could be prevented via the route as well by limiting access to the panel.

Glad that the alternative solution is fine for you. Pity though, that we’ll never find out now why it doesn’t work :wink:

1 Like