Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$watsonSettings is not defined #54

Closed
alxndr-w opened this issue Oct 18, 2019 · 8 comments
Closed

$watsonSettings is not defined #54

alxndr-w opened this issue Oct 18, 2019 · 8 comments

Comments

@alxndr-w
Copy link
Contributor

ReferenceError: $watsonSettings is not defined
/assets/addons/watson/watson.js?buster=1541757826:105

Auch nach Speichern der Einstellungen bleibt der Fehler, Watson öffnet sich nicht mehr.

REDAXO 5.8, alle Addons aktuell

@tbaddade
Copy link
Owner

Ist das die Version aus dem Installer oder die GH Version? Ich kann hier mit 2.1.0 in REX 5.8 den Fehler nicht reproduzieren.

@tbaddade
Copy link
Owner

Existiert dieser Part in deinem HTML

<script type="text/javascript">
    <!--
    if (typeof($watsonSettings) == "undefined") {
        var $watsonSettings = {"resultLimit":20,"agentHotkey":"17-32","quicklookHotkey":"91","backend":true,"backendUrl":"index.php?page=watson","backendRemoteUrl":"index.php?page=watson&watson_query=%QUERY","wildcard":"%QUERY"};
    }
    //-->
</script>

@alxndr-w
Copy link
Contributor Author

Nein, der Part existiert nicht.

Es ist die Installer-Version 2.1.0

@tbaddade
Copy link
Owner

Entweder existiert der EP PAGE_HEADER bei dir nicht oder es werden keine Providers wie diese hier geladen
https://github.com/tbaddade/redaxo_watson/blob/master/package.yml#L14-L20

Hast du irgendwelche Anpassungen gemacht oder ist es eine Standardinstallation?

@alxndr-w
Copy link
Contributor Author

Hast du irgendwelche Anpassungen gemacht oder ist es eine Standardinstallation?

Am Core habe ich nichts verändert. Ich nutze den page_header-EP selbst in einem Addon. Das sollte jedoch kein Problem darstellen, oder?

@tbaddade
Copy link
Owner

Könntest du testen, indem du deinen Aufruf mal deaktivierst. Ich könnte frühestens erst nächste Woche testen.

@alxndr-w
Copy link
Contributor Author

Tatsächlich. Wenn ich ihn deaktiviere, klappt Watson wieder. Aber warum?

//    rex_extension::register('PAGE_HEADER', 'backend_style_css', rex_extension::LATE);
function backend_style_css() {
  $backend_icon = "";
...
    $css = '
    <style>
    .icon-logo {
        display: inline-block;
        background-image: url('. $backend_icon .');
        width: 20px;
        height: 20px;
        margin-left: -28px;
        margin-right: 3px;
        background-position: 0 0;
        background-repeat: no-repeat;
        background-size: 20px 20px;
        vertical-align: middle;
    }
    </style>';
    return $css;
}

@alxndr-w
Copy link
Contributor Author

alxndr-w commented Oct 21, 2019

Konnte die Frage selbst beantworten. Man muss den $ep mit abfragen und das subject wieder mit anhängen, also:

function backend_style_css($ep) {
...
return $ep->getSubject().$css;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants