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.
when creating new post content on a fresh install.
Comment | File | Size | Author |
---|---|---|---|
#12 | 1818180_warnings-group-ref_12.patch | 1.03 KB | jrbeeman |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedComment #2
ezra-g CreditAttribution: ezra-g commentedhttp://drupalcode.org/project/commons_groups.git/commitdiff/dd5efde?hp=2... resolves the field being overridden in my testing. Leaving this issue open for remaining bug.
Comment #3
ezra-g CreditAttribution: ezra-g commentedMarked #1837308: Error (unable) in creating New posts as a duplicate.
Comment #4
ezra-g CreditAttribution: ezra-g commentedI'm not actively working on this at the moment. I plan to come back to it, but if someone wanted to troubleshoot this, commons_groups_entityreference_default_value() would be the place to start.
Comment #5
Matt V. CreditAttribution: Matt V. commentedI looked into this a bit on Friday. Oddly, the errors persisted even when I commented out the contents of the entire commons_groups_entityreference_default_value() function.
There is an issue in the Entity reference queue #1784608: error when using with auotocomplete(tagged) widget that mentions a similar error. Unfortunately, the proposed solution, the latest dev release is already in use in Commons.
Comment #6
Matt V. CreditAttribution: Matt V. commentedThis issue seems to be specific to the Autocomplete (Tags style) reference widget within Organic Groups. The other OG reference field widgets don't have the same problem.
I've opened a ticket in the OG issue queue: #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches. And I'll continue to look into it.
Comment #7
ezra-g CreditAttribution: ezra-g commentedAwesome - Thanks for looking into this, Matt!
Marking this issue as postponed pending #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches.
Comment #8
ezra-g CreditAttribution: ezra-g commentedI marked #1857394: Invalid argument foreach in Entityreference without URL prepopulation as a duplicate of this.
Comment #9
ezra-g CreditAttribution: ezra-g commentedMarking as "needs review" based on the patch now available at #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches :).
Comment #10
ezra-g CreditAttribution: ezra-g commentedI marked #1874592: Warning and javascript error when creating a post with entity reference autocomplete as a duplicate of this issue.
Comment #11
jrbeemanFound the issue here. Working on patches to related modules and will post back once I've submitted them to the relevant issue queues, along with a Commons make file patch.
Comment #12
jrbeemanPatch attached for the Commons make file that references patches supplied to related projects:
OG: #1876696-17: Warning message in line 69 of og.field.inc using Entity reference prepopulate module
Entity Reference: #1522172-5: Invalid argument supplied for foreach in entityreference_field_widget_form()
Comment #13
jrbeemanComment #14
Matt V. CreditAttribution: Matt V. commentedjrbeeman, It looks like you may have a copy-and-paste error. The OG patch you reference in your patch is the same one applied 3-lines above.
Comment #15
Matt V. CreditAttribution: Matt V. commentedjrbeeman,
In my testing, the original issue is already fixed in the latest 2013-Jan-27 dev release, presumably by the fact that Commons already uses the 2.x-dev release of OG, which includes the fix from #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches.
Are these other two patches necessary? I noticed that the OG issue (#1876696: Warning message in line 69 of og.field.inc using Entity reference prepopulate module) was marked as "closed (works as designed)".
Comment #16
ezra-g CreditAttribution: ezra-g commentedI resolved the invalid argument foreach warnings by making commons_groups_entityreference_default_value() return an $items array in all cases where there are no matches: http://drupalcode.org/project/commons_groups.git/commitdiff/8c7b38d
However, I'm now unable to reference groups where the current user is not already a member. This regression may have been introduced by #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches.
Comment #17
ezra-g CreditAttribution: ezra-g commentedI filed #1902086: Allow group-audience widget to allow adding new content to groups a user doesn't belong to to request some guidance from amitaibu on how best to proceed.
Comment #18
ezra-g CreditAttribution: ezra-g commentedAfter further investigation, I re-titled to #1902086: Allow group-audience widget to allow adding new content to groups a user doesn't belong to, filed a patch and added it to the Commons make file with http://drupalcode.org/project/commons.git/commit/523f2e5.
However, since then, the patch has failed OG's automated testing.
Comment #19
ezra-g CreditAttribution: ezra-g commentedI reviewed the proposed alternative patch/issue and re-opened #1902086.
Comment #20
johnlutzKind of unrelated but when I got here from an error that this post was related to, I also got a related error/notice you might want to be aware of:
Notice: Undefined variable: id in commons_groups_entityreference_default_value() (line 397...
In commons_groups_entityreference_default_value it is coded:
(og_user_access($target_type, $target_id, "create $entity->type content") || og_user_access($target_type, $id, "update any $entity->type content"))
Figure that $id should be $target_id?
Comment #21
ezra-g CreditAttribution: ezra-g commentedRe-titling to be more accurate.
Comment #22
ezra-g CreditAttribution: ezra-g commentedLet's continue this work at #1961296: Refactor og_group_ref field per OG API improvements.