HI,

Ok I have managed to totally crash a perfectly working Drupal installation so any help would be great. I downloaded the latest release of Views. I duly copied this into the appropriate location under sites/all/modules, and followed the procedure to enable views, Views exporter and Views UI. Now on all of my pages I get:

Fatal error: Cannot redeclare views_ui_list_views() (previously declared in ./sites/all/modules/views/includes/admin.inc:11) in ./sites/all/modules/views//includes/admin.inc on line 19

Anyone any clue what's happened? More importantly, anyone know how I get my site back? :-)

thanks,

Dónal

Comments

Apollo610’s picture

Hey Donal, have you tried rebuilding the site using update.php? I find that sometimes when I update or purge modules, the system flakes out (with similar messages to the one you're getting).

Going to www.mysite.com/update.php and running through that process usually fixes the problem completely.

Not sure if this will work in your case, but might be worth the shot...

donalfitz’s picture

Just tried that and I get absolutely nothing. I can run some mysql commands to get rid of the module, but I'd love to know what the problem with the drupal config is. It only seems to be an issue when views UI is actually installed.

WorldFallz’s picture

Judging from the error message it seems you might have 2 copies of views installed-- thoroughly check your directory structure for a second copy somewhere.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

donalfitz’s picture

Just checked and unfortunately not. Hmm, I'm guessing it's time to drop databases and reinstall :(

donalfitz’s picture

Hi again,

Ok this one now becomes stranger. I did the following:

1. dropped the database I'm using;
2. cleaned out the entire Drupal installation.
3. Downloaded a totally clean install, creeated the database, and installed as per instructions.
4. on my local test machine, I enabled the views module(s). This worked fine.
5. I carried out steps 1-4 on the server I' using, and ... it produced the same fatal error as described earlier in this thread. So on the local machine it works, and on the server it doesn't.

I've looked at the various reports generated on both the local laptop and the server, and there seem to be no differences

So people, I now ask the experts, as I am totally baffled.

Thanks,

Dónal

kjl’s picture

What do you see on line 19 of views/includes/admin.inc?

Why is there a double '//' between "views" and "includes" in the path in the second part of the error message?

donalfitz’s picture

Hi,

Line 19 contains the closing "}" for that function. As to the second "/" I wish I knew. Interestingly, someone else filed a bug on this one a couple of months ago; however the developer seems to think it is something to do with a corrupt "admin.inc" in all cases. The fact that the same error has happened to two people surely suggests not?

What is confusing me is the fact that precisely the same code base works on a localhost install. Could it be something to do with the version of PHP that's running on the server? (i'm clutching at lots of straws here)

WorldFallz’s picture

Is one system windows based and the other linux based? I ran into something similar once and iirc, it had to do with the way /'s were handled differently by windows and linux.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

donalfitz’s picture

Hey,

Yes one is XP based while the other is linux based.

Interestingly, all other modules are enabling perfectly.

WorldFallz’s picture

Now I just have to find my notes-- I no longer use the module I had to fix so lets hope I kept some notes on what the fix was.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

kjl’s picture

I would wonder if the problem isn't an extra '/' before "include" on line 189 of views_ui.module.

Try removing it and clearing the theme cache.

Compare lines 198 and 215

WorldFallz’s picture

I think you may be on to something-- there are several lines with /includes/admin.inc in that area and only one 'includes/admin.inc' on line 215.

Donal-- try adding in the '/' on line 215.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

donalfitz’s picture

Really appreciate the help with this, thanks a lot.

Incidentally, I decided to be really silly and just comment out that entire function (one does these kinds of things when baffled) and, interestingly, the same error manifested itself in relation to the next function in the file admin.inc. I'm sure this has no bearing on things, but the fact that it relates to just the Views UI portion of the views subsystem, and that it manifests itself in different places is interesting.

kjl’s picture

I think the problem probably is linux ignores '//' and windows doesn't. In the views_ui there's a bunch of spots that have an errant '/' before 'includes/filename'

WorldFallz’s picture

or maybe it should be the other way around, lol.

In any case, whichever is the right answer, they should all match.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

donalfitz’s picture

I can't thank you enough for your help. Believe it or not, it wasn't putting the "/" in, it was taking it out that fixed it. I literally went through all the "admin.inc" includes and removed the leading "/" and it worked fine.

Cheers,

Dónal

WorldFallz’s picture

Don't forget to update your issue in the views queue and let merlin know so he can fix the module.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

kjl’s picture

There's a bunch more that have the same error. If there's an issue for this, I'll roll a patch and add it to the thread.

donalfitz’s picture

Just updated it. (as this is the first issue I've raised I've probably done it wrong but one lives and learns!)

Oddly enough the other "/" errors don't seem to be causing a problem.

thanks again guys.

Kudos’s picture

Hi all,

I'm new to drupal and I new to the web building adventure as well. I got my test site online, and am playing around with the latest version of drupal 6.21 . The site is online for only 2 weeks and I haven't have much time to work with it.

However, I incur the same exact problem with this post. Read all comments and I still don't understand what I need to do ? There are a number of "//" in the includes/admin.inc file . How would I know which one I should delete?

I don't know how to read codes, but believe that this : " $Id: admin.inc,v 1.161.2.3 2009/11/20 22:04:22 merlinofchaos Exp $ " means that this patch is belong to merlin (?) and it should be fixed (from previous report in 2008) ?

Can someone help me with this? Thank you very much.