Hello,
Sorry for my bad english. i hope anyone kann help me.
I have an guildwebsite build with Drupal, PHPBB3 and the bridgemodul for Drupal.
Anything works fine.
Now I will integrate Alter Ego into my website to build a guild roster. But when i activate the module my site crashs and the only what i see ist this error messages.
Fatal error: Cannot redeclare avatar_delete() (previously declared in /home/ohadmin/motleycrew/sites/all/modules/alter_ego/avatar.entity.inc:95) in /home/ohadmin/motleycrew/phpBB3/includes/functions_user.php on line 230
i know it exist an patch for an similar error in the phpbrigde, but this patch is already installed.
Anyone have an idea how i can correct this problem
thx
Angrim
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | avatar_delete.zip | 5.04 KB | TheOther |
Comments
Comment #1
ytwater commentedHumm. That's a tough one.
The only thing I can think of is to do a search and replace of "avatar_delete(" to "phpbb3_avatar_delete(" in the directory /home/ohadmin/motleycrew/phpBB3/.
Drupal dynamically calls my function so it cannot be renamed.
If it comes down to it, you can delete my function avatar_delete(/home/ohadmin/motleycrew/sites/all/modules/alter_ego/avatar.entity.inc:95). It'll leave extra data in your database, but I don't think it'll do anything really bad. Of course you'll need to do the same thin when up update the module.
I hope you get it working!
Comment #2
Angrim commentedI have the function
deactivated. now it works fine.
But i don't think that is a problem in the module. I think it is a problem of the permissions of my site or the forum. I don't know which permission can make the problems.
When u are guest of my site, the site will be loaded correctly. But when you will login or already logged in, the website show the error massage.
Maybe is the Problem the equality of the function name.
Comment #3
ytwater commentedI'm guessing it's still a problem.
Drupal won't load functions that it doesn't need, so I'm assuming that when a user is not logged in, it doesn't need the Avatar functions. When the user does log in, it does.
And you have it correct, the problem is that both program use the exact function name.
Comment #4
Angrim commentedThank u for help.
The problem was resolved with your hint.
But one thing i want to say.
Great Module !!!!
Best Regards
Angrim
Comment #5
JoshuaF commentedytwater, decided to use this issue since it is related and still open. Hopefully that is fine.
I'm trying to use the PHPBB Forum integration module and I've got it all working, with the tip from above.
One issue I'm having is that the avatar images aren't showing up or syncing to PHPBB from Drupal.
I'm not sure if it's a problem with Alter Ego or with the other module, but I thought I would mention in case other have had the same issue and/or you know a possible fix.
Thanks,
Joshua
Comment #6
JoshuaF commentedJust some followup information:
http://drupal.org/project/phpbbforum
That is the specific module I'm using.
I could live without the avatars to be honest, what I do need however is the hook into the $username from the select avatar rather that PHPBB Forum using the drupal account name.
Any help you can provide would be great. I was looking through some of the php in the module but couldn't figure it out.
Comment #7
TheOther commentedI have run into the same problem using alter_ego together with the phpbbforum module and I can confirm that the issue is a name collision with the "avatar_delete()" function in avatar_entity.inc. phpBB also declares such a function in "includes\functions_user.php" which apparently gets dragged into Drupal during configuration of the phpBB integration module leading to a white screen of death halfway during the configuration if alter_ego is also installed.
Personally I solved this by renaming the alter_ego function in avatar_entity.in to "avatar_delete_single()" and updating the corresponding call in avatar_admin.inc. After this fix I was able to properly configure phpbbforum.
This could of course also be fixed on the phpBB side, but comparing the work it was a lot less change to do it in alter_ego since this function is only called once (that I could find).
Now, this isn't really a bug in alter_ego, and I realise that it may not be top priority, but since it's such a simple change, may I humbly ask for a rename of this function for the next official release to have this scenario working out of the box?
Attaching my patched files in case someone else is interested.
Comment #8
ytwater commentedIt's an idea, but sticking to Drupal conventions:
For Entity type: Node
you use node_load, node_insert, node_update, node_view, node_delete, etc
So I'm using the same convention for Entity type: Avatar.
You'd actually have to change the entity name to change the function name. It might also break modules that hook into avatar_delete.
JoshuaF: I'll have a look at phpBB.
Truthfully, I think I should be changing the actual user avatar rather than overriding it. That way it'll work with any module.
Comment #9
TheOther commentedAh, I see.. not being a Drupal developer I didn't consider naming conventions or hooks.
Another approach might of course be from the phpbbforum module side. You're already required to patch phpBB as a part of the installation anyway so perhaps a fix for this could be included there but I'll leave that for someone else to consider.
Thanks anyway for looking into this.
Comment #10
JoshuaF commented+ytwater thanks man I appreciate your time.
I run the website for the 49 twink bracket in wow. Luckily the forums aren't heavily used so it can wait :)
I'll eagerly be awaiting your answer, and if you need a tester let me know and I'd be willing to help.
Comment #11
JoshuaF commentedAny updates ytwater?