Re: [Maypole] Maypole::Application still broken in 2.09?

From: Matt Adams (matt.adams at morcor.com)
Date: Fri Feb 04 2005 - 21:30:30 GMT


Hi Simon:

Sorry it took so long to get back to you. Things have been crazy at the work place.

Just to reiterate, here is my Maypole app configuration:

BEGIN {
   package MyApp;
   use MyApp::Constants;
   $ENV{MAYPOLE_CONFIG} = BINPATH . '/MyApp.yaml';
}

package MyApp;

use Maypole::Application qw(
     -Debug
     Config::YAML
     Authentication::Abstract
    -Setup
);

>>>
>>> But unfortunately this doesn't work out too well with
>>> Maypole::Application 2.09 which still gives me the same error as in
>>> 2.08:
>>>
>>> MyApp...Debugging enabled
>>> MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
>>> MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
>>
>>
>>
>> This looks a little odd. One of the things fixed in 2.09 was to make
>> sure that the plugins really are loaded in the order they are declared
>> (this wasn't the case in some previous releases). Now these messages
>> aren't in the same order as in your use statement. So are you sure
>> these messages are really being output by 2.09?

Whoops. I should have looked at the output closer. You're right:
Maypole::Application 2.09 gets the order straight. 2.08 doesn't.

However, I still get the same error with 2.09 that I did with 2.08.

The error (slightly edited to remove long paths) is:

MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...No DSN set in config
[error] Can't locate object method "new" via package "Class::DBI::Loader::"
(perhaps you forgot to load "Class::DBI::Loader::"?) at Class/DBI/Loader.pm line 77.
BEGIN failed--compilation aborted at MyApp.pm line 36.
Compilation failed in require at (eval 17) line 3.
[error] Can't call method "_table2class" on an undefined value at
Maypole/Model/CDBI.pm line 250.

> Indeed. It looks like it has loaded the plugins in sort() order, which
> was the case pre 2.09.
>
> Matt, could you check the debug output of:
>
> #!/usr/bin/perl
> use Maypole::Application 2.09 qw(-Debug Config::YAML
> Authentication::Abstract);

Yes. The output (slightly edited to remove unsightly paths) of this command is:

Debugging enabled at Maypole/Application.pm line 24.
Loaded plugin: Maypole::Plugin::Config::YAML at Maypole/Application.pm line 31.
Loaded plugin: Maypole::Plugin::Authentication::Abstract at
Maypole/Application.pm line 31.

>> If so, they seem to be showing a 2.09 bug. A complete simple test case
>> would be very helpful.
>>
>> I guess your config might be relevant to understanding what's going on
>> here? (Not by me, I don't use either the YAML or CDBI-Loader :)

My YAML config file is:

--- #YAML:1.0
dsn: dbi:mysql:myapp
model: MyApp::Model::CDBI
pass: user
rows_per_page: 10
uri_base: http://bugs:8000/
user: user
datetime: '%a, %b %e, %Y at %l:%M %p'

FWIW, I'm using a PERL5LIB path modified by my Apache configuration.
And few of my Perl modules are in the standard location but that doesn't seem to
  (and shouldn't) matter since the PERL5LIB path includes them all.

> I wonder whether it's picking up an older version of Maypole. It would
> be good to check which version of Maypole::Application is being used. Do
> you have Apache::Status installed?

Nope. It appears to be picking up the correct version of Maypole. I only have
one installed. Things work if I use Maypole::Application 2.07 but not if I use
Maypole::Application 2.08 or 2.09.

Thanks for your help!

Matt

-- 
Matt Adams <matt.adams at morcor.com>
Development Specialist
Morcor Solutions Inc. <http://www.morcor.com/>
(613) 354-2912 x228

GnuPG public key at <http://staff.morcor.com/~madams/> Key fingerprint: BED5 B4F7 CCF5 D7B5 7C56 0505 9A0A A0FB C937 5975



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:58 GMT