Posted by ezra-g on October 19, 2012 at 11:08pm
4 followers
| Project: | Drupal Commons |
| Version: | 7.x-3.x-dev |
| Component: | Groups |
| Category: | task |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
when creating new post content on a fresh install.
Comments
#1
#2
http://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.
#3
Marked #1837308: Error (unable) in creating New posts as a duplicate.
#4
I'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.
#5
I 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.
#6
This 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.
#7
Awesome - Thanks for looking into this, Matt!
Marking this issue as postponed pending #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches.
#8
I marked #1857394: Invalid argument foreach in Entityreference without URL prepopulation as a duplicate of this.
#9
Marking as "needs review" based on the patch now available at #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches :).
#10
I marked #1874592: Warning and javascript error when creating a post with entity reference autocomplete as a duplicate of this issue.
#11
Found 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.
#12
Patch 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()
#13
#14
jrbeeman, 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.
projects[og][patch][] = "http://drupal.org/files/og-add-group-message.patch"+; Fix warning in og_field_widget_form(), in og.field.inc
+; http://drupal.org/node/1876696
+projects[og][patch][] = "http://drupal.org/files/og-add-group-message.patch" <-- same as 3-lines above
#15
jrbeeman,
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)".
#16
I 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.
#17
I 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.
#18
After 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.
#19
I reviewed the proposed alternative patch/issue and re-opened #1902086.
#20
Kind 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?
#21
Re-titling to be more accurate.
#22
Let's continue this work at #1961296: Refactor og_group_ref field per OG API improvements.