# bug report - javascript and buttons

**URL:** https://support.prodi.gy/t/bug-report-javascript-and-buttons/6886
**Category:** Uncategorized
**Tags:** solved, bug
**Created:** [November 8, 2023, 9:31pm UTC](https://support.prodi.gy/t/bug-report-javascript-and-buttons/6886 "2023-11-08T21:31:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![peter-axion](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/peter-axion/32/4202_2.png) [@peter-axion](https://support.prodi.gy/u/peter-axion)
#### Post date: [November 8, 2023, 9:31pm UTC](https://support.prodi.gy/t/bug-report-javascript-and-buttons/6886/1 "2023-11-08T21:31:06Z")

</div>

I have been using prodigy a bit heavily lately and have about 1.8 bug reports:

#1: In 1.11.14, putting this line in `$PRODIGY_HOME/prodigy.json` would eliminate the "reject" button:

```json
"buttons": ["accept", "ignore", "undo"],

```

In 1.14.7, it no longer seems to do that and I get all 4 buttons anyway. For my recipe, there is no functional difference between rejecting and ignoring, so it doesn't hurt me to have an extra button but it is confusing.

#2: This may just be an understanding issue on my side. In 1.14.7, when my custom recipe returns this object:

```python
{
    "view_id": "blocks",
    "dataset": dataset,
    "stream": stream,
    "exclude": exclude,
    "update": make_update,
    "validate_answer": validate_answer,
    "config": {
        "lang": ner.lang,
        "labels": label,
        "relations_span_labels": span_label,
        "exclude_by": "input",
        "wrap_relations": wrap,
        "custom_theme": {"cardMaxWidth": "90%"},
        "hide_relation_arrow": hide_arrow_heads,
        "auto_count_stream": True,
        "blocks": [
            {"view_id": "relations"},
            {"view_id": "html"},
        ],
        "global_css": CSS,
        "javascript": JAVASCRIPT,
    },
}

```

the `JAVASCRIPT` string is escaped and interpolated into a script block in the global scope as if it were a path like:

```html
<script src="${escaped javascript}" async crossorigin> </script>

```

instead of being directly added to the global scope [as the documentation indicates](https://prodi.gy/docs/custom-interfaces#javascript) and the "Custom javascript" example on the same page shows. I haven't tested 1.14.4 to see whether the changes in 1.14.5 caused this or if it has always worked this way. Could just be a misinterpretation on my part about what the code in the example is doing.

---

<div class="post-metadata">

### Author: ![magdaaniol](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/magdaaniol/32/2787_2.png) [@magdaaniol](https://support.prodi.gy/u/magdaaniol)
#### Post date: [November 14, 2023, 3:45pm UTC](https://support.prodi.gy/t/bug-report-javascript-and-buttons/6886/2 "2023-11-14T15:45:07Z")

</div>

Hi @peter-axion, thanks for sharing your report on the forum.  
As to #1: I'm not reproducing the issue with 1.14.7 (or later) with built-in recipes. Could there be something about your custom CSS that overrides the "buttons" config setting?

Wrt #2 what you're reporting is, indeed, a regression we introduced 1.14.5 and it was fixed in version [1.14.8](https://prodi.gy/docs/changelog#v1.14.8).  
Could you upgrade and see if your Javascript is loaded correctly?

Thanks again!

---

<div class="post-metadata">

### Author: ![peter-axion](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/peter-axion/32/4202_2.png) [@peter-axion](https://support.prodi.gy/u/peter-axion)
#### Post date: [November 14, 2023, 9:58pm UTC](https://support.prodi.gy/t/bug-report-javascript-and-buttons/6886/3 "2023-11-14T21:58:43Z")

</div>

I confirmed that the `config.javascript` property does work as documented in v1.14.9.

For the buttons, I figured out what went wrong. I switched to an allowlist for `.dockerignore` and forgot to include `prodigy.json`. Not having the config will do it every time!

Thanks for the help and the new version!
