Open jtallantumich opened 3 years ago
@jtallantumich does the dataset you are adding the resource to have a value in the "Groups" field?
@janette Thanks for looking into this. Yes, it does have a value in the "Groups" field. It autopopulates from the node editors designated group.
@jtallantumich is the person who is adding a resource to that dataset also in that group? or have the administrator role?
@janette Yes and yes, I'm admin and part of that group
Have you done any customizations @jtallantumich ? I'm not able to reproduce the error, you could try xdebug to see what value is being passed to https://git.drupalcode.org/project/rules/-/blob/7.x-2.x/includes/rules.state.inc#L735
@janette I assume you mean modification of the dataset and resource content type. Yes, we've added new fields to incorporate the Ecological Metadata Standard (EML) and entity for related items in our site like bibliographic references, research sites, and affliated researchers.
@janette We will test the xdebug and get back.
@janette I tried setting a breakpoint there but it seems that it never makes it to that point in the process for it to hit the breakpoint.
(I'm working with @jtallantumich on the same site - this isn't a problem with a separate DKAN install)
It seems it fails prior to that and xdebug basically gives the same error as the watchdog error @jtallantumich opened the issue with. The node id the error is referring to is the resource node.
Just prior to that in the call stack, it is at line 808 of /profiles/dkan/modules/dkan/dkan_dataset/dkan_dataset.module
- $wrapper_resource->og_group_ref->set($resource_groups);
I don't think I was getting this every time, but now on my local environment I'm getting an exception in at line 76 of /profiles/dkan/modules/dkan/dkan_datastore/src/Resource.php - Exception: Invalid node type
when I try to edit an existing dataset.
I don't know if that provides any more insight into the problem. Please let us know if there is anything else you can think of that we can check.
Have you done any customizations @jtallantumich ? I'm not able to reproduce the error, you could try xdebug to see what value is being passed to https://git.drupalcode.org/project/rules/-/blob/7.x-2.x/includes/rules.state.inc#L735
I'm going to loop @dafeder in here, he has more experience with customized dataset fields on 7.x-1.x sites, he may recall the things to look out for. Also wondering if you would be interested in upgrading DKAN to 2.x.
Thanks @andyguzman and @janette. I hope @dafeder has some insight. Yes it is a goal to migrate/upgrade to DKAN2, but I'm not there yet...
DKAN Install Profile (DKAN (dkan-7.x-1.17.1)) Production Site: https://mfield.umich.edu
Describe the bug
For about 3 months we've been unable to associate any resource to any dataset, regardless of how we try to make that association ("Add Resource" button in an existing dataset or referencing a resource from within the dataset edit page or relating it to dataset from the resource edit page) It always returns the same error message:
_EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. Value at node(17063)->og_group_ref: array ( '' => 'a:2:{s:8:"gravatar";i:1;s:17:"mimemailtextonly";i:0;}', ). in EntityDrupalWrapper->set() (line 756 of /var/www/html/profiles/dkan/modules/contrib/entity/includes/entity.wrapper.inc).
Bypassing the validation in the entity module listed in the error above by commenting it out will actually allow the resource to be added, and instead the log gets filled up with these two errors, the first one about 50 times:
_Notice: Trying to get property of non-object in dkan_dataset_get_dataset_groups() (line 669 of /var/www/html/profiles/dkan/modules/dkan/dkan_dataset/dkan_dataset.module).
Warning: Illegal offset type in OgBehaviorHandler->groupAudiencegetDiff() (line 163 of /var/www/html/profiles/dkan/modules/contrib/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php)._
Disabling / re-enabling the 'DKAN Dataset Groups' module seems to fix the problem, but also breaks all of the many existing entity references that were entered before, on datasets and other content types.
Steps To Reproduce
I think this is probably only reproducable on our dev/production site... but can share with anyone who is able to dig into the problem.
Expected behavior
No errors when attempting to create a new dataset or adding a new resource to an existing dataset.