I am banging my head against the wall but I have no idea what I am doing wrong. I tried all possible combinations of final and dev versions of pathauto and filefield_path but I keep on getting the Cannot redeclare _pathauto_alias_exists() I "function_exists" out every pathauto-x.inc to try if that might solve the problem temporarely but it does not instead I then get Cannot redeclare token_something() (can´t remember the exact but it was first function in token-nodes.inc) I disabled uninstalled upgraded whatever I could do but it aint helping - the error keeps popping up leaving me unable to use this great module :( Any idea where to look and why its doing it?
It seems to reload the .incs even so they are already loaded. I have not enough plan to know where it loads the .inc to see if I can prevent it from doing so. The bug is in the newest dev version and also in the 5x-1.0 release version.
[11-Dec-2008 16:49:23] PHP Fatal error: Cannot redeclare _pathauto_alias_exists() (previously declared in /home/11/fgpt/drupal/sites/all/modules/pathauto/pathauto.inc:65) in ./sites/all/modules/pathauto/pathauto.inc on line 80
Otherwise pathauto and token works on my install without much problem.
Comments
Comment #1
falk_g commentedI can completely narrow it down to the following line of codes which I have no clue what they are doing and why they are causing problems:
line 275 and following in filefield_paths.module:
If I comment these out it works - any idea somebody?
breaking it down further makes it more a mystery.
I can clearly attribute the error to the @rmdir function which triggers the "cannot redeclare" error in pathauto. i can see that it could be a permission problem or a problem with save mode but since everything else on the site is working like a charm i am a bit puzzled. If anyone can help it would be greatly appreciated.
ok more info. after extensive testing and almost deleting my whole drupal install i figured out that
$field['widget']['file_path']
is empty - always no matter what I do its not populated. Any idea why that is. i made an if statement that when its empty it shouldn´t process stuff below and that seems to work - so it does not clean up after itself obviously. everything else works as expected. :(
Comment #2
deciphered@falk_g
I've just run a quick test and not been able to reproduce the issue.
One thing I can say is that FileField_Paths doesn't redeclare _pathauto_alias_exists(), nor does the code you have commented out to prevent the issue.
While commenting out out that code may prevent the issue for you, it is cleanup code and without it you will end up with a bunch of temporary directories cluttering up your files directory.
My guess at this stage is that there is some other module you have that has redeclared _pathauto_alias_exists(), which is somehow being triggered. What modules do you have installed (including versions)? Is it possible you can run a search over your modules directory searching from '_pathauto_alias_exists'?
Let me know how you go and I will do the best I can to help you resolve this issue.
Cheers,
Deciphered.
Comment #3
falk_g commentedAs said I can attribute the problem to $field['widget']['file_path'] being empty. It never gets populated. Then in return it tries to delete the file directory itself (as said by trying to test this I almost deleted my whole drupal install) so this is quite a serious thing to debug for me ;)
I experience the problem on a VERY module heavy site and its quite likely possible that another module might cause this - I suspect it might be the cursed category plugin but that is impossible to deactivate without breaking the whole site. I just need some pointers on where $field['widget']['file_path'] should get populated so that I can investigate myself. As the original error suggests its not another module having duplicate functions but the pathauto and token module being loaded twice for some reason. I suspect with my insufficent knowledge that this happens because the @rmdir bugs out (it does bug out because it tries to delete the file directory - so far I am already) and then takes with it the whole module system somehow (don´t ask me how). So I need to find where exactly $field['widget']['file_path'] should have been filled with the right temp path - because this is where the bug actually happens I think.
Comment #4
decipheredHi falk_g,
Firstly, let me apologize for never getting back to you on this issue, I completely overlooked it.
Can you confirm whether this issue still exists with either the latest development build (soon to be version 1.3) or 1.2?
Cheers,
Deciphered.
Comment #5
neRok commentedClosing old issue. I think 5.x is pretty much dead.