Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Error: EntityMetadataWrapperException: Unknown data property og_group_ref. in EntityStructureWrapper->getPropertyInfo() (line 339 of /Users/jimmy/Downloads/commons-7.x-3.x-dev/profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc
This happens with 3.x-dev (Nov 19), default installation and content type Document.
Steps to reproduce:
- Enable Document Feature
- Go to a specific group
- Upload a document, click Save
Comment | File | Size | Author |
---|---|---|---|
#12 | 2139665-group-sitewide-validation-12.patch | 7.75 KB | Devin Carlson |
#11 | 2139665-group-sitewide-validation-11.patch | 7.75 KB | Devin Carlson |
#10 | required_fields_hidden.png | 134.3 KB | Devin Carlson |
#10 | 2139665-group-sitewide-validation-10.patch | 7.08 KB | Devin Carlson |
#7 | 2139665-group-sitewide-validation-7.patch | 6.49 KB | japerry |
Comments
Comment #1
meba CreditAttribution: meba commentedNote that you need to do thsi from the short form, not full form. It looks like the short form is lacking group context
Comment #2
meba CreditAttribution: meba commentedComment #3
ezra-g CreditAttribution: ezra-g commentedSorry to hear that you're having problems here. Adding to our Commons 7.x-.3.6 radar for triage.
Comment #4
japerryComment #5
japerryHello, this issue is due to the trusted contacts module not being reverted after the documents feature is enabled. Once you revert trusted contacts, this issue should go away!
Comment #6
ezra-g CreditAttribution: ezra-g commentedMarking as postponed pending more info. Please let us know if japerry's suggestion above resolves your issue.
Comment #7
japerryWhat a fun issue! Not.
So I've done a bit of re-writing here because a few assumptions made back when trusted contacts and commons_groups were made, have changed.
Biggest change is relying on site-wide permissions for group posting, as well as removing groups from being a required field (when trusted contacts were added)
This essentially means that any 'node/add/(content type)' link should allow someone with sufficient privileges to post outside of a group. We let OG and entity reference permissions handle this now. Because of this, we can remove the node_validate function within commons_groups.
Secondly, with trusted contacts added and og_access optional, we had to make a few use cases for the bw_widget, which is where we really want to be controlling if people could accidently be posting outside of groups. For now (because of site-wide views on the front page), we've decided that the bw_widget should not allow site-wide posting of group content. I've altered the validation functions in this patch to work mainly on the bw_widget to disallow site-wide posting.
I've also fixed the earlier bug where trusted contacts can deny people from being able to post within a group when og_access is disabled.
All said and done, this has been fairly well tested against the above use cases and I think is good to go for 3.6
Comment #8
ezra-g CreditAttribution: ezra-g commentedThanks, japerry!
We'll do some functional testing on this today. One part of the code that may need revision is this:
At a glance, I'm not sure if we can count on LANGUAGE_NONE here in all cases. Also, marking #2160221: Missing validation on frontpage short form as duplicate of this.
Comment #9
ezra-g CreditAttribution: ezra-g commentedBased on my functional testing on a single language site, #7 seems like a solid stopgap. I think we can use this approach and then pursue a more comprehensive fix as part of #2020061: Allow users to create content outside of groups, ideally for Commons 7.x-3.7.
Comment #10
Devin Carlson CreditAttribution: Devin Carlson commentedMy experience has been the same as #9.
The only issue I've come across is the poor UX of displaying an error message to users but not showing the associated field (as it is hidden by
Drupal.behaviors.commonsBwExpandableForm
).I'd suggest doing something like:
in order to prevent fields which have an error from being hidden on page load.
Comment #11
Devin Carlson CreditAttribution: Devin Carlson commentedAn updated version of #10 which addresses an issue where the group form item was never hidden with translation enabled and makes the display of expanded forms which have an error more consistent with standard expanded forms.
Comment #12
Devin Carlson CreditAttribution: Devin Carlson commentedAn updated patch to change the error message from
to
Comment #13
Devin Carlson CreditAttribution: Devin Carlson commentedThis was committed to Commons 7.x-3.x with http://drupalcode.org/project/commons.git/commit/1b26b13
Comment #14
japerryLinking to #2020061: Allow users to create content outside of groups
Comment #15
ezra-g CreditAttribution: ezra-g commentedWe're working on a more robust followup fix at #2020061: Allow users to create content outside of groups.