Gossamer Forum
Home : Products : DBMan : Customization :

2 mod's living together?

Quote Reply
2 mod's living together?
I installed dbman first, all worked fine.
I added the mod 'Preview', all worked fine.
I added the mod 'Validate', all went wrong. All kinds off error appear, so after 3 day's (and nights) I deleted ecerything to begin from scratch.
I installed dbman, all worked fine.
I added the mod 'Validate', all worked fine.
I added the mod 'Preview', pushed the 'Preview Record' button and all went wrong again.
This time the error is around line 66:
Undefined subroutine &main::timediff called at /home/blahblah/cgi-bin/dbman/db.cgi line 66.

Around line 66 I have:
55: require "auth.pl"; # Authorization Routines
56: };
57: if ($@) { &cgierr ("Error loading required libraries.\nCheck that they exist, permissions are set correctly and that they compile.\nReason: $@"); }
58:
59: # If we are using benchmarking, then we start a timer and stop it around &main. Then we print the difference.
60: if ($db_benchmark) { eval { require Benchmark; }; if ($@) { &cgierr ("Fatal Error Benchmark Module not installed: $@"); } $t0 = new Benchmark; }
61:
62: eval { &main; }; # Trap any fatal errors so the program hopefully
63: if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
64:
65: # Stop the timer and print.
66: if ($db_benchmark) { $t1 = new Benchmark; print "<h6>Processing Time: " . timestr(timediff($t1, $t0)) . "</h6>"; }
67:
68: # Display debugging information if requested.
69: &cgierr("Debug Information") if ($db_debug);
70:
71: exit; # There are only two exit calls in the script, here and in in &cgierr.
72:
73: sub main {
74: # --------------------------------------------------------
75: my ($status, $uid);
I cannot find anything wrong, but I'm not an expert on perl...

So my question is, what is wrong?
Second; is there a chance that these 2 mod's can not live together; ading 1 is no problem bur when adding the second all went wrong.
Is there someone outthere who has them both in dbman and working fine?

I would like to ad another mod 'upload-file'to it but if this don't work I surely can forget the third mod!


Quote Reply
Re: 2 mod's living together? In reply to
Your error lies in one of your lines. I think you are missing a "{". You should change the line to (addition in red):

60: if ($db_benchmark) { eval { require Benchmark; }; if ($@) { &cgierr ("Fatal Error Benchmark Module not installed: $@"); } {$t0 = new
Benchmark; }

Julian
Quote Reply
Re: 2 mod's living together? In reply to
Sorry to say it Vampy, but when I added the '{'the page wont load at all.....(500 error)
Maybe you know a good perl/cgi-debugger around?
Well at least the screen isn't turning blue!
I downloaded a real texteditor like EditPlus2 instead of using Wordpad for the bigger textfiles and made the changes from scratch. I learned that wordpad could do strange unwanted things. But still when I want to preview the addition dbman says; Validated (Too long. Max length: 3)
And I didn't even put something in!
Any ideas?

Quote Reply
Re: 2 mod's living together? In reply to
Well I think I found the problem....;
As an author I could add a record but when pressing 'Preview" I got the error-message.
As an admin I could do the same, but then I noticed that it showed two times the validation.
The line : <b>print &build_radio_field ("Validated", "$rec{'Validated'}"); </b> was inserted but there was already such a line in the table. So I removed it et voila...
You realy should see me smile Laugh
Thanks for the support!