# modifyClass fallito con un avviso

**URL:** <https://meta.discourse.org/t/modifyclass-failed-with-a-warning/239535>\
**Category:** Development\
**Created:** [20 Settembre 2022, 10:45am UTC](https://meta.discourse.org/t/modifyclass-failed-with-a-warning/239535 "2022-09-20T10:45:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Alienazk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alienazk/32/261130_2.png) [@Alienazk](https://meta.discourse.org/u/Alienazk)\
**Post date:** [20 Settembre 2022, 10:45am UTC](https://meta.discourse.org/t/modifyclass-failed-with-a-warning/239535/1 "2022-09-20T10:45:46Z")

</div>

Ciao!  
Voglio modificare il controller con l’API dei plugin, ma fallisce con un avviso come:

[THEME xxx] “controller:full-page-search” era già memorizzato nella cache nel contenitore. Le modifiche non verranno applicate.

il mio codice:

```js
function modifySearchTypes(api) {
    api.modifyClass("controller:full-page-search", {
        pluginId: "modify-search-types",
        init() {
            this._super(...arguments);

            this.set("searchTypes", [
              { name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },
              {
                name: this.siteSettings.tagging_enabled
                  ? I18n.t("search.type.categories_and_tags")
                  : I18n.t("search.type.categories"),
                id: SEARCH_TYPE_CATS_TAGS,
              },
            ]);
            this.selected = [];
        },
    });
}

export default {
    name: "modify-search-types",
    initialize() {     
        withPluginApi("0.10.0", modifySearchTypes);
    },
};

```

Come posso risolvere il problema?  
Grazie mille!

---

_[View the full topic](https://meta.discourse.org/t/modifyclass-failed-with-a-warning/239535)._
