[html-formfu] new dists - major changes!

Octavian Rasnita orasnita at gmail.com
Mon Sep 27 12:54:05 GMT 2010


Hi Carl,

The problem of my approach is that $config->{uploaded_files_dir} is set but with the scalar '__path_to(...)__'. This macro is not interpreted in place, so $ENV{uploaded_files_dir} contains just that scalar.

But that scalar from $ENV was somewhere interpreted, however I don't know where and that's why I said that it was probably doing that by mistake. :-)

The scalar from $config->{uploaded_files_dir} is interpreted only after Catalyst::Plugin::ConfigLoader reads the configuration file.

As a solution, I changed the configuration file and I have overridden the method finalize_config of C:P::ConfigLoader and I created the environment variables in that method and not in the configuration file.

And until now it works fine, although I need to find why the opened file handle is not closed even the context of the variable that holds it ends (the action method).

Octavian

----- Original Message ----- 
From: "Carl Franks" <fireartist at gmail.com>
To: "HTML Form Creation,Rendering and Validation Framework" <html-formfu at lists.scsys.co.uk>
Sent: Monday, September 27, 2010 12:19 PM
Subject: Re: [html-formfu] new dists - major changes!


> On 24 September 2010 19:37, Octavian Rasnita <orasnita at gmail.com> wrote:
> 
>> It was taken from the configuration file of the app which contains something like:
>>
>> my $config = {
>> uploaded_files_dir => '__path_to(root,static,uploaded_files)__',
>> uploaded_files_url => '/static/uploaded_files',
>> };
>>
>> $ENV{uploaded_files_dir} = $config->{uploaded_files_dir};
>>
>> $config;
>>
>> After the module Catalyst::Plugin::ConfigLoader reads this config file, it replaces __path_to(...)__ with the generated path in the $c->config but it doesn't do it in the environment variable.
>>
>> Until this last version of HTML::FormFu, I don't know how and where (maybe by mistake :) this column inflator was working fine, but now that macro __path_to()__ is not expanded anymore.
> 
> Hi,
> 
> If I'm following correctly, your Cat app's config file uses a .pl/perl
> extension and contains perl code.
> 
> $config->{uploaded_files_dir} is being set correctly, but the assignment to
> $ENV{uploaded_files_dir} doesn't appear to be happening.
> 
> I'm afraid that's as far as I can follow what's going wrong, so I
> can't really see how the form code is involved.
> 
> Have you used local 'lib' directories containing the different
> versions of FormFu to verify that that's the only thing that's
> changing?
> 
> Cheers,
> Carl
> 
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu



More information about the HTML-FormFu mailing list