nystudio107 / craft-instantanalytics

DEPRECATED: Instant Analytics brings full Google Analytics support to your Twig templates and automatic Craft Commerce integration with Google Enhanced Ecommerce.
https://nystudio107.com/
Other
20 stars 9 forks source link

Settings screen appearing blank #17

Closed joelzerner closed 5 years ago

joelzerner commented 5 years ago

Installed on Craft CMS 3.3.11 and license entered and validated.

The Instant Analytics settings page is showing up with the Craft CMS frame but the content section is completely blank. I've pasted the code for the content section below.

<div id="content">
<input type="hidden" name="action" value="plugins/save-plugin-settings">
<input type="hidden" name="pluginHandle" value="instant-analytics">
<input type="hidden" name="redirect" value="3a1a59291fa50140e088c32a9e8637326fa56c57ca986b198cb39ce13eb8e1efsettings">
</div>

I've tried in two different environments and getting the same issue. Any help is appreciated.

wuhhh commented 5 years ago

I'm also seeing a blank settings page. Craft 3.3.12, Instant Analytics 1.1.1 (Trial)

ragnarfrosti commented 5 years ago

The problem is in the settings template in the plugin (vendor/nystudio107/craft-instantanalytics/src/templates/settings.twig).

{% if craft.imageOptimize.craft31 %}
    {{ forms.autosuggestField({
        label: 'Google Analytics Tracking ID:',
        instructions: "Enter your Google Analytics Tracking ID here. Only enter the ID, e.g.: UA-XXXXXX-XX, not the entire script code.",
        suggestEnvVars: true,
        id: 'googleAnalyticsTracking',
        name: 'googleAnalyticsTracking',
        value: settings['googleAnalyticsTracking'],
    }) }}
{% else %}
    {{ forms.textField({
        label: 'Google Analytics Tracking ID:',
        instructions: "Enter your Google Analytics Tracking ID here. Only enter the ID, e.g.: UA-XXXXXX-XX, not the entire script code.",
        id: 'googleAnalyticsTracking',
        name: 'googleAnalyticsTracking',
        value: settings['googleAnalyticsTracking']})
    }}
{% endif %}

Where the statement {% if craft.imageOptimize.craft31 %} fails.

Temporarily replace the code-snippet above with the code below to make it work until an official fix is released.

{{ forms.textField({
    label: 'Google Analytics Tracking ID:',
    instructions: "Enter your Google Analytics Tracking ID here. Only enter the ID, e.g.: UA-XXXXXX-XX, not the entire script code.",
    id: 'googleAnalyticsTracking',
    name: 'googleAnalyticsTracking',
    value: settings['googleAnalyticsTracking']})
}}
ragnarfrosti commented 5 years ago

... or you could change the if-statement to {% if craft.instantAnalytics.craft31 %} which probably is how it should have been from the beginning :)

khalwat commented 5 years ago

Fixed in https://github.com/nystudio107/craft-instantanalytics/releases/tag/1.1.2