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 I installed the module I got the a white page with the following php error:
Fatal error: Cannot redeclare class OgMembershipMetadataController in /home/user/Public/www/cwkb/sites/all/modules/og/includes/og.info.inc on line 135
This cause the whole site to only be a white page with this error.
Comments
Comment #1
amitaibuYou seem to have 2 OGs on your site.
Comment #2
amitaibuComment #3
cfgregory CreditAttribution: cfgregory commentedHow would I get two OGs on my site and how do I remove one of them?
Comment #4
cfgregory CreditAttribution: cfgregory commentedUpdate: I always get the error if I enable Organic groups access control.
If I comment out class OgMembershipMetadataController and disable OG access control, the site is fine. I can even put class back in as long I don't enable access control.
Comment #5
jaarong CreditAttribution: jaarong commentedSame error, I don't have two og folders. I did enable access control. I updated by completely deleting the old og 1.x folder and uploading the og 2.x folder. Deleting the og_access folder fixed the problem for me.
Comment #6
edvanleeuwenI have the samen error after upgrading core from 7.15 to 7.16. I'll restore and see if the problem returns.
Comment #7
edvanleeuwenI had two og.info.inc files, one residing in the og root and one in the og includes. I think this is a leftover from a test I have done trying to upgrade to 7.x-2.x.
In 7.x-1.x the og.info.inc is in og/includes.
In 7.x-2.x the og.info.inc is in og.
To solve this, I have deleted the og folders and replaced them with a fresh copy downloaded.
I think this is a bug, because in my opinion the .inc files should be in the includes folder where they were in the previous version. Therefor, I have altered the category and version. Please excuse me, if I am mistaken.
Comment #8
saloob CreditAttribution: saloob commentedRemove og.info.inc from the main folder - it is now in includes
Comment #9
edvanleeuwenThis is not the current situation. As I said before, in the 7.x-2.x versions the og.info.inc is in the root; there is no copy in the includes. I checked it with both the beta2 and dev (17 Ocotber 2012) versions.
If they follow up your advise now, users will end up with a corrupt environment.
Comment #10
GeekFamily CreditAttribution: GeekFamily commentedThis worked for us. We were attempting to upgrade from OG 1 to OG 2. Overwrote current files in site but came up with this error. After removing the 2nd copy of og.info.inc (the one in the main folder) - site is now working again. Thank you for your help!
Comment #11
amitaibuComment #12
edvanleeuwenAmitaibu, please review my comment #7. I do think this is a bug.
Even in the latest dev the og.info.inc is in the root and not in the includes folder. If you think that that is the correct place, please add that and set the status to closed/won't fix.
If this is not solved GeekFamily will have its problem back with a future version, because she deleted the one in the root.
Comment #13
edvanleeuwenPlease bear in mind that at this moment the 7.x-2.x-dev puts the og.info.inc in the root. Therefor, you have deleted the wrong file and you will have your problem back when upgrading.
You can verify this by inspecting the contents of the original dev archive you downloaded.
Comment #14
amitaibuYes, when upgrading a module, unless using git, it is advised to completely remove the folder and add the new version.
Comment #16
kingshuk01 CreditAttribution: kingshuk01 commentedIf I delete the og.info.inc file in includes and then I get the following error
Fatal error: require_once() [function.require]: Failed opening required '/home//public_html/sites/all/modules/og/includes/og.info.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myjourne/public_html/includes/bootstrap.inc on line 3102
And if I delete the og.info.inc in the main folder the I get the following error below
Fatal error: Call to undefined function og_field_property_callback() in /home//public_html/sites/all/modules/entity/modules/field.info.inc on line 30
Where am I going wrong? Please help!
Comment #17
FlutterStack CreditAttribution: FlutterStack commentedI had a same issue
Fatal error: Cannot redeclare class OgMembershipMetadataController in sites/all/modules/og/includes/og.info.inc on line 135
I solved it,
In og.info.inc (sites/all/modules/og/includes/og.inf) file i have added if(!class_exists('OgMembershipMetadataController')) this has solved my problem but i have doubt that the class in which it is having conflict may have other features as well. So test the site thoroughly.