I get an error whenever saving either of the provided google_analytics_reports view without any customization.

The error is as follows:

InvalidArgumentException: The configuration property display.default.display_options.filters.start_date.value.type doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 74 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

I thought this patch might resolve but to no avail:

#2369119: Fatal error when trying to save a View with grouped filters using other than string values

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sylus created an issue. See original summary.

sylus’s picture

Status: Active » Needs review
FileSize
3.09 KB

This seems to get it working again for me ^_^

othermachines’s picture

Status: Needs review » Postponed (maintainer needs more info)

I would be very surprised if this isn't somehow related to #2369119: Fatal error when trying to save a View with grouped filters using other than string values. There's a fix committed for core 8.3.x and 8.4.x branches just days ago. I've got 8.2.x installed and I can't duplicate the problem on my machine.

The extra config info really shouldn't be necessary. It would be good to know if the problem still persists for you on an updated installation and, if so, the steps to duplicate it. Core version and any modules installed would be helpful, too.

Thanks for your report. Sorry I can't be more help than that.

RaisinBranCrunch’s picture

Yes, it is definitely that issue that causes this. I think the specific cause of it is:

views.filter_value.*:
type: string
label: 'Filter value'

Which was added to views.filter.schema.yml. It causes the DataDefinition to be loaded as string, even though in the past it would have been a mapping or something like that. I haven't had a chance to look into it enough yet, but this change broke a filter on one of our custom fields.

RaisinBranCrunch’s picture

Thanks so much, sylus, for the schema. That allows it to be imported.

Reproduction steps: use 8.3.0. Don't ask me why, but the fix you mentioned is actually the thing that causes this for this module (and for certain custom filters, like ours). If you remove the changes that were made to views between RC2 and 8.3.0, it still works.

RaisinBranCrunch’s picture

Status: Postponed (maintainer needs more info) » Needs work
DuneBL’s picture

#2 solved my problem
Thank you!!

casey’s picture

Status: Needs work » Needs review
FileSize
2.09 KB
abu-zakham’s picture

I can confirm Patch #2 solved the problem. Thanks.

kingfisher64’s picture

Another confirmation that #2 patch fixes the issue.

Can this please be committed Mr Maintainer?

kingfisher64’s picture

Status: Needs review » Reviewed & tested by the community
DuneBL’s picture

I confirm #2 solved the issue, and #8 doesn't solve it...

othermachines’s picture

Status: Reviewed & tested by the community » Needs work

OK, I'm now running into this on 8.3.7.

I think a more complete solution would combine patches in both #2 and #8. #2 only resolves the problem when saving the default views; however I still get errors if I save a GA view that I have created:

InvalidArgumentException: The configuration property display.default.display_options.filters.end_date.value.min doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 74 of D:\---\core\lib\Drupal\Core\Config\Schema\ArrayElement.php). 

#8 resolves this error.

serg2’s picture

@othermachines, does your suggestion still work against 8.4?

othermachines’s picture

@serg2 - Sorry, I don't know. I'm not yet using this module on an active 8.x installation as it hasn't been supported in over a year. :(

serg2’s picture

As Othermachines said in #13 there are two issues:

1: Saving an existing view

2: Creating(and then saving) a new view: e.g. duplicating one of the existing two views.

Against Drupal 8.4.0 the patch in #2 solves the first issue but not the second. The #8 needs a re-roll once #2 has been applied but even then does not solve the second issue.

Lendude’s picture

Something like #8 is the right way to fix this. Every custom filter needs to have a corresponding schema. The default is a single string value. If the filter wants values other then that, it needs a schema.

See core/modules/views/config/schema/views.filter.schema.yml for some examples. It's also strange that the default Views contain no plugin_id for the filters, so rebuilding the Views after adding the proper schema sounds like a pretty good idea too.

RAWDESK’s picture

Both #2 and #8 fixed it for me. Without #2 the error on save persisted for a newly added "Chart" display.

akprasad303’s picture

#2 fixes issue when we edit available view from Google analytics but when try to add new view then same error persist.

stevieb’s picture

I had a similar issue ... this solved it

https://www.drupal.org/project/drupal/issues/2917006

Vivek Panicker’s picture

#2 solved my problem too for Drupal 8.4.4.

akprasad303’s picture

b_sharpe’s picture

Status: Needs work » Needs review
FileSize
5.05 KB

A combination of both and removing core info, working for me on 8.4.4

b_sharpe’s picture

Fixes missing 'plugin_id' for attachments as well.

igonzalez’s picture

Edit

handkerchief’s picture

Priority: Normal » Major

Core 8.5.0
--> I added the patch from #24

--> If I want to edit an existing google analytics report view, this is shown in the field section: broken/missing handler

--> If I want to create a view with google analytics data:

InvalidArgumentException: The configuration property display.default.display_options.filters.start_date.value.type doesnt exist. in Drupal\Core\Config\Schema\ArrayElement-get() (line 76 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php). Drupal\Core\Config\StorableConfigBase-castValue(display.default.display_options.filters.start_date.value.type, offset) (Line: 211) Drupal\Core\Config\StorableConfigBase-castValue(display.default.display_options.filters.start_date.value, Array) (Line: 211) Drupal\Core\Config\StorableConfigBase-castValue(display.default.display_options.filters.start_date, Array) (Line: 211) Drupal\Core\Config\StorableConfigBase-castValue(display.default.display_options.filters, Array) (Line: 211) Drupal\Core\Config\StorableConfigBase-castValue(display.default.display_options, Array) (Line: 211) Drupal\Core\Config\StorableConfigBase-castValue(display.default, Array) (Line: 211) Drupal\Core\Config\StorableConfigBase-castValue(display, Array) (Line: 212) Drupal\Core\Config\Config-save() (Line: 280) Drupal\Core\Config\Entity\ConfigEntityStorage-doSave(google_analytics, Object) (Line: 392) Drupal\Core\Entity\EntityStorageBase-save(Object) (Line: 259) Drupal\Core\Config\Entity\ConfigEntityStorage-save(Object) (Line: 387) Drupal\Core\Entity\Entity-save() (Line: 637) Drupal\Core\Config\Entity\ConfigEntityBase-save() (Line: 989) Drupal\views_ui\ViewUI-save() (Line: 191) Drupal\views_ui\ViewAddForm-submitForm(Array, Object) call_user_func_array(Array, Array) (Line: 111) Drupal\Core\Form\FormSubmitter-executeSubmitHandlers(Array, Object) (Line: 51) Drupal\Core\Form\FormSubmitter-doSubmitForm(Array, Object) (Line: 585) Drupal\Core\Form\FormBuilder-processForm(view_add_form, Array, Object) (Line: 314) Drupal\Core\Form\FormBuilder-buildForm(view_add_form, Object) (Line: 74) Drupal\Core\Controller\FormController-getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-Drupal\Core\EventSubscriber\{closure}() (Line: 582) Drupal\Core\Render\Renderer-executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-Drupal\Core\EventSubscriber\{closure}() (Line: 151) Symfony\Component\HttpKernel\HttpKernel-handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel-handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session-handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle-handle(Object, 1, 1) (Line: 99) Drupal\page_cache\StackMiddleware\PageCache-pass(Object, 1, 1) (Line: 78) Drupal\page_cache\StackMiddleware\PageCache-handle(Object, 1, 1) (Line: 50) Drupal\ban\BanMiddleware-handle(Object, 1, 1) (Line: 57) Drupal\shield\ShieldMiddleware-handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware-handle(Object, 1, 1) (Line: 50) Drupal\Core\StackMiddleware\NegotiationMiddleware-handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel-handle(Object, 1, 1) (Line: 657) Drupal\Core\DrupalKernel-handle(Object) (Line: 19)

rudam’s picture

same problem as #26 on 8.5.1

broken/missing handler

handkerchief’s picture

Priority: Major » Critical
mikolos’s picture

I had the same issue with the broken/missing handler after installing the patch. Re-importing the Google Analytics Fields at /admin/config/services/google-analytics-reports-api and clearing all caches resolved the issue for me.

mikolos’s picture

Confirmed, I'm having the same issue as #26.
The only workarounds that I can see for now are:
-> Broken handler issue for existing GA Views: re-import the Google Analytics fields.
-> InvalidArgumentException for new GA views: duplicate one of the existing views and modify it to your needs.

mbaev’s picture

Drupal 8.5.4. Patch #2 still works.

hkoosha’s picture

Mind you, google_analytics_reports (not the API module though) must be re-installed so Drupal picks up the file views.schema file.

DuneBL’s picture

@hkoosha thank you for the patch, but what is the difference with #24? Should we apply both?

hkoosha’s picture

@DuneBL It's okay either way.

#24 fixes built-in default views, so you can clone them. #32 fixes the add new view wizard form, so you can add a new view without cloning.
I tested, everything works without #24 too. It shouldn't!!! but it does. Anyways you go ahead and apply #24 too.

Rajab Natshah’s picture

We have been using #2 for over 2 years, and it's working well
committing #2. so any other addon or changes could be in a new issue

Rajab Natshah’s picture

Rajab Natshah’s picture

Status: Needs review » Reviewed & tested by the community
Rajab Natshah’s picture

Rajab Natshah’s picture

Title: Error when saving either google_analytics_reports view » Fix Error whenever saving either of the provided google_analytics_reports view without any customization

  • RajabNatshah committed 9e4794c on 8.x-3.x authored by sylus
    Issue #2850463 by sylus: Fix Error whenever saving either of the...
Rajab Natshah’s picture

Assigned: Unassigned » Mohammed J. Razem
Status: Reviewed & tested by the community » Needs review
Rajab Natshah’s picture

Assigned: Mohammed J. Razem » Unassigned
Rajab Natshah’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hkoosha’s picture

I still insisnt upon having my patch (#34) applied. The views is really determined to find the value.min and value.max, if the filter type of start_date / end_date is set to number.

I spent a whole day going down through the yaml parser, I can see the min and max are there, insinde an array keyed by value, however yaml can not realize this value is also an array. It thinks it's a plain single value without any subvalues.

You could easily try this on a recent version of Drupal core. also synchronizing and importing configuration via drush completely fails unless this patch is applied.

But anyway, it's your call :shrug.

jidrone’s picture

I agree with @hkoosha, a new issue should be created, I needed the patch #32 using version 8.x-3.0-beta3 and Drupal core 8.7.10.

Rajab Natshah’s picture

Thanks koosha and Ivan for following up !

I will re-test your patch again.
You could create a new issue as a follow up issue, you have got a good point

Rajab Natshah’s picture