When I try to save a new view (not an existing view), it works fine until I add either the start date or the end date filter. This is somewhat similar to #2850463: Fix Error whenever saving either of the provided google_analytics_reports view without any customization except that in that issue, the "fix" was made only for the views provided by the module. In fact, there was a patch in #8 (also in #24) comment that could have worked but didn't for some reason.

Tracing back in how views defines its schema, I think that we really should define the schema for the filter plugin types.

Steps to reproduce:

  1. Install and authenticate the module.
  2. Add a new view with Google Analytics as source.
  3. Add any fields you want.
  4. Save the view, it should work fine.
  5. Now, edit the view and add the start date and/or end date filter. Set offset type and specify any offset.
  6. The preview should work.
  7. Save, and it will throw an exception.
CommentFileSizeAuthor
#2 3078777-2.patch628 byteshussainweb

Comments

hussainweb created an issue. See original summary.

hussainweb’s picture

Status: Active » Needs review
StatusFileSize
new628 bytes

Here's a patch that fixes the issue for me.

I also tried reverting changes in the issue #2850463: Fix Error whenever saving either of the provided google_analytics_reports view without any customization but that broke those views. So, I am just going to leave that there. But I do think that that patch could be better and more generic and the problem lies elsewhere. Well, one issue at a time and this patch fixes the issue and also adds some necessary schema for views filters.

rajab natshah’s picture

Thank you Hussain for reporting and the patch!
I have seen your issue after
#3097496: Add config schema for google analytics date views filter plugin id

In my opinion, we are of need for more config schemas, but we need to manage some kind of update process for old views.
More testing will follow

rajab natshah’s picture

Status: Needs review » Needs work
rajab natshah’s picture

I have noticed that all of us are having a number of issues, each one fixed by some change of config or config schema
Reviewing all issues for this module and extra testing before we release the stable version
We could work on a number of automated testing cases.

I did a number of them in
Total Control Admin Dashboard
#3069156: Add Automated Testing for the Total Control Admin Dashboard module

Our test use for the module is in Varbase Total Control Dashboard
Varbase Dashboard

In my opinion, most of Drupal 8 contrib modules should stable before Drupal 9

rajab natshah’s picture

#3102925: Add an automated testing for the [Google Analytics Reports] and API module

  • Having an optimization round over the code in the module.
  • Adding Drupal-ci automated testing for selected used testing cases
  • Then release an RC or Stable version