Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ed Carlevale’s picture

As #12-#18 have reported on issue queue #1013068 (http://drupal.org/node/1013068), enabling the og field access module is causing fields to disappear from any content type that isn't designated as an OG Group Type or Group Content Type. The fields reappear when the content type is modified to become either a Group Type or a Group Content Type.

This is a consistent problem that persists through all versions of OG and Drupal that I've tested, including dev versions. Also, I have tried many different sequences in enabling the modules, creating the content types, clearing cache, running cron, etc. These result in some variations as to when the fields disappear, but they don't avoid the bug. The essential problem remains that fields disappear for all non-OG content types when the OG field access module is enabled.

As a workaround, I designate a non-OG content type as an OG Group Content Type and ignore the Group Audience pulldown if I create a node with that content type. Not an ideal solution but good enough for what I am trying to do with OG right now. Down the road I hope to contribute to tracking down bugs like this and contributing patches, but my developer skills aren't there yet.

amitaibu’s picture

It seems that OG fields (group/ audience) remin in the node. What I suspect is that this is the scenario, unless you think otherwise

1) Content type e.g. Article is set to a group
2) User creates an article node.
3) Article is set not to be a group.
4) The existing node still has the OG fields, thus triggering og_field_access

sven.lauer’s picture

Stranger things are happening, I just did this on a fresh install (latest CVS of core, github of og):

1) Activate og, og_ui.
2) Make Article a group type.
3) Make Article a non-group type.
4) Look at the edit group type screen again: Article is still a group type (or so the form claims).

And indeed, it seems like og_node_type_save does nothing if og_group_type_$type has the value omitted.

amitaibu’s picture

Status: Active » Reviewed & tested by the community

Indeed, you can't unset group/ group content from the node type form, since I wan't to make sure you realize you delete a field. I've added a fix, to disable the radio in such a case and send you to the "Manage fields" group.

https://github.com/amitaibu/og/commit/c7cafbc10b3af6eb8862d50ea9c9f31e77...

Ed Carlevale’s picture

No, fields disappear for any content type that isn't designated as either group type or group content type. This is real easy to confirm - create a new content type and don't designate it as group or group content. Now add a node using that content type -- after you save the node, you will not see any fields (apart from title, date, etc). Now change that content type to group content and the fields reappear.

amitaibu’s picture

> This is real easy to confirm - create a new content type and don't designate it as group or group content. Now add a node using that content type -- after you save the node, you will not see any fields

I can't reproduce.. Have you tried it from a clean installation?

Ed Carlevale’s picture

FileSize
51.88 KB
60.02 KB

Below are screenshots from a clean installation of Drupal 7 and OG, from a site I created a few hours ago. I enabled the OG modules (including field access). Then I created a page using the pre-installed Basic content type. I didn't modify the content type in any way. As you can from the screenshot (8), the body field doesn't appear even though it has text in it. Next I modified the content type so that it was now a Group type. As you can see from the screenshot (9), this time the body field shows up.

Amitai, I just added you as a group and site admin on this site, so that you check out the configurations. But I have done many installations of OG over the last few weeks, and this issue has been consistent throughout.

http://planbweb.net/drupal-7.0/content/new-basic-page

amitaibu’s picture

Status: Reviewed & tested by the community » Active
FileSize
42.95 KB

> Then I created a page using the pre-installed Basic content type. I didn't modify the content type in any way.

I've logged in to your site, and the basic page has an OG field in it.

Ed Carlevale’s picture

This is really simple bug to recreate. I created three new screenshots to show the bug in action.

1. Create a new content type. Do not designate the new content type as a Group type or a Group content type. Save the content type.
2. Create a node using that content type. Add some text for the title and for the body field. Save the new node.
3. View the node.

You will not see anything in the body field, nor in any other field if you had added any.

Ed Carlevale’s picture

Ed Carlevale’s picture

Screenshots didn't post properly in previous comment.

amitaibu’s picture

I can not reproduce. Are u using latest version from github?

protools’s picture

+1 I have this problem too ...

amitaibu’s picture

@Ed Carlevale,
Can you add some debug functions to see where it fails?

protools’s picture

I use MAMP PRO 1.9.4 for mac Postgresql 9 + PHP 5.3/5.2 clean installation of Drupal 7 and OG ... when enable Organic groups field access - content in node page is empty, in teaser on front page - ok. When disable - ALL Ok.
.

weboide’s picture

I had this issue with an earlier revision.
I just tried to reproduce it using trunk, but there is now a notice telling you to remove the group_type field directly when you wish to remove the "group type" of the content type.
After removing the field, the content is still visible so this is not reproducible for trunk.

weboide’s picture

Actually, I can reproduce part of this issue when og_context is enabled.
$entity->{OG_AUDIENCE_FIELD} is somehow set to array(1) { ["und"]=> NULL }.

amitaibu’s picture

@weboide,
Your hint did the trick... I'm working on a fix.

amitaibu’s picture

Status: Active » Reviewed & tested by the community

I have problems with the CVS, so currently fixed only on github -- https://github.com/amitaibu/og/commit/23d97e5579261ef0e285f5fe3ee3142ac4...

weboide’s picture

I am unable to reproduce this issue with the latest commit.
Thanks for the fix!

amitaibu’s picture

Title: og_field_access: Under certain conditions, fields of non-group-content types are hidden erroneously. » Og context + og field access make fields disappear for non-group nodes.

better title

femrich’s picture

Sorry if this is a dense question: I've been experiencing this problem and want to download the proper og release with the fix. Is there a direct github link you can point me to which I can paste into my drupal7 installation module update window (the one where I normally paste the url at drupal.org pointing to the download link for the latest release of a module)? If that won't work, can you point me to the proper github link to download the latest full og package containing this fix, please? The link in #19 above looks like it only contains a portion of the module.

Thanks.

Lobidu’s picture

@femrich

what you see there is a patch, it's only an overview over what needs to be changed to fix ths bug.

the easiest way (well, no, the most straightforward way) to use this patch is to click on "view file @23d97e5" in the top right corner of the code section, then on the page which opens, to click on "raw" in the same top right corner and copy and paste this into your original og.module file (you find it in your drupal installation under sites/all/modules/og/ or if you used the version from github: under sites/all/modules/amitaibu-og-c0ab40b); then do the same with the patch for the og.test file (remember on the page linked above are two patches- one for the og.module file and one for the og.test file).

gorillaz.f’s picture

Used the @23d97e5 og.module , fields are reappear , cheers~~!
But ! Got white screen when click into group global permission setting , and group nodes are mass up (I have 2 test sites , one got white screen when viewing a group node, another just cannot edit the group node)

femrich’s picture

@lobidu, thanks for the guidance. Will try entering the brave new world of drupal patching...

amitaibu’s picture

@femrich,
No need to patch, just download the latest version from github (you have a download button). After the git migration (that AFAIK should be tomorrow), you can download it from Drupal.org.

femrich’s picture

@Amitaibu, thanks. Will wait for it to appear at drupal.org to take advantage of drupal 7's fabulous automated module upgrade procedure.

kbell’s picture

Has this patch been "officially" released to d.o. yet?

kbell’s picture

The body and summary fields are completely missing when viewing the page and when I view source, for ALL nodes (blog posts, articles, etc.), we do have OG installed, but disabling it did not fix. We have locale running, and the posts are both designated "en" and "un". I have determined that the nodes with language set to "und" are the only ones that are visible. We have two languages installed, German and English. No nodes are listed as "de" - only "und" and "en". However, just changing the values globally to "und" did not solve the problem. My site has been down for 3 days with this problem and I am in desperate need for a resolution at this point. Any help appreciated. Sample page: http://www.commonslearningalliance.org/content/fallacy-tragedy-commons

I have checked the db and all the body data is still present in the database. When I view source, the <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"> div is entirely missing (not present and empty).

When I disable the og_field_access module, it DOES NOT solve my problem.

I have of course rebuilt the access permissions several time, cleared caches, and done numerous other diagnostics, disabled all non-Core modules, with no luck.

Thank you.

amitaibu’s picture

> Has this patch been "officially" released to d.o. yet?

It will happen after git migration, meanwhile use github.

kbell’s picture

Status: Fixed » Reviewed & tested by the community

I have still not been able to resolve this issue. I have conclusively determined that for all field_data_body" tables in the database, the ones that have "language" set to "und" are the only ones that show up on their node pages (summaries are affected the same). The ones that have the language field set to "en" DO NOT APPEAR. I tried changing all these values to "und", and it DID NOT RESOLVE the problem, so something else is going on too. Can someone give me a clue as to what else is related that I need to change?

I have determined that the content disappeared immediately after the previous developer enabled the OG module for the first time - that's the only clue I have. I've tried every other diagnostic under the sun, spent hours in IRC, and it's conclusive that something in the db is messed up - disabling ALL modules did not fix the problem. But at this point I have no idea what else to try. The site content is 80% not visible (titles, yes, but the Body field, no - and when one "edits" the node, the body content is not visible there either, though you can clearly see the content in the database "body_value" field), so this is a real emergency. Any ideas welcome.

Would it be possible to upgrade this issue to MAJOR? It's certainly major for me, as I can't find any workaround that will make my content reappear.

Thank you,

kbell’s picture

Also, the Git migration is complete, but there is no OG update showing up for me - can you please update d.o.? I would really like to do it through d.o. if possible, and I know others in this queue are wishing to do the same.

Thanks,
Kelly

amitaibu’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal.org

femrich’s picture

Seconding kbell in #33, though I note I am using the 7.x-1.0 version of og, not dev. Should we expect an update there? Because I've been having the problem noted in this thread there and have temporarily fixed it by following some of the stop-gap solutions in the thread.

kbell’s picture

Status: Reviewed & tested by the community » Fixed

I too am using 7.x-1.0, not dev. I am still not seeing an update available in d.o. despite maintainer's commit. Do we need to be requesting the latest dev version or the stable release?

kbell’s picture

I just ran the latest update of dev, and now my summaries show up on the home page, but the node bodies still don't show up on the node page, and when one clicks edit, there isn;t even a Body field showing. This is a major issue. Thoughts?

I don;t believe this issue should be called "fixed".

Thanks,
Kelly

amitaibu’s picture

No need to repeat your issue in both places. Just get the latest version from durpal.org's git or wait for the updated package release (once every 12hours).

femrich’s picture

I'm still a bit confused here, Amitaibu. When I looked at github last week, it seemed as if there was a recently updated version of 7.x-1.0. This is the verision I have been looking for (as generally I understand .dev releases are not recommended for production sites), though I opted to wait for the git migration to get it through drupal.org. (I have been experiencing the same problem when using 7.x-1.0 og field access as discussed in this thread, and so have had og field access disabled for some time now.)

However, though the git migration is now complete, the latest version drupal.org lists of 7.x-1.0 is dated January 5, two weeks before this thread was initiated. This is the version I have been using and still use.

1) Has the stable release, 7.x-1.0, been updated to include fixing the problem addressed in this thread?

2) If yes, when will that fix be available through drupal.org? If not anytime soon, does the latest stable release (7.x-1.0) at github include a fix for this?

3) If the answer to 1 above is no, do you recommend installing the latest 7.x-dev and using that on a production site? In general, do you recommend using the latest stable release of og? or .dev?

Thank you.

amitaibu’s picture

get the latest version (-dev version) from durpal.org

femrich’s picture

Thanks. Will do...

kbell’s picture

Latest update fixed my problem - content is now all visible - thank you!!!!
-Kelly Bell

Status: Fixed » Closed (fixed)

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

cartagena’s picture

Amitaibu, thank you for a wonderful module and the video explaining it.
I am having the same issue described above but I am not a programmer and don't know how to work with git hub. I am using the recommended release 7.x-1.0 with a date of Jan. 5. Should I be using the development release dated March 15--is that what is referred to above?

I had signed up for your conference at DrupalCon Chicago, was so sorry you weren't able to be there...
Thanks again, I am one grateful non-programmer.

femrich’s picture

Cartagena, yes, the advice was to install the dev release (now dated March 18) rather than 7.x-1.0, because fixes for bugs have not gotten into the official release yet, presumably. As for github, you don't have to use it now--just use drupal.org for modules, as now they are coming from github in any case...

rogical’s picture

I think this is a big bug, and normally when a major bug fixed, a new release should be published.

As the dev release is not easy to upgrade.

Wappie08’s picture

Totally agree rogical, think this is a major bug fixed so 7.1 would be logic..

j2r’s picture

FileSize
15.8 KB

Please see the attached image...

when i select a forums as not a group type the body is not visible...
and when i select it as group type the body reappear..

I am using the latest dev version of OG
Is this issue is related to this discussion or should i create new issue.

thanks in advance...

fizk’s picture

This bug alone is worth creating another official release.

It's been 7 months since the patch was committed to dev. What's going on here??

yurgon’s picture

Are bug fix in DEV ?

Anonymous’s picture

What is the status of this MAJOR bug? Removed OG (not easy) cleared cache/cron, etc. Still getting same behavior, missing fields all over the place. Do I need to reinstall OG dev version?

Anonymous’s picture

Priority: Normal » Major
Status: Closed (fixed) » Needs review

Installed latest dev release after eventually removing 7.x-1.1. Same problem, missing body field in Blog & Forum, etc. Did complete removal of OG, uninstall (pain), delete module directory OG, and clean db entries but still getting same problem.

*** Disabled WYSIWYG Module and now able to see Body field in Forums.***

Will reinstall OG Dev version to confirm that it is not at fault.

amitaibu’s picture

Status: Needs review » Closed (fixed)

Please open a new issue.