I have a project where I copied the guts of a Doctrine based form,
deleted all fields, added a simple file field, but kept the line with
'getModelName' with the old model. Didn't think it would work it all,
but it does, sort of.

When I use the dev environment, it works perfectly. I upload a file, I
can bind it, get the value, save the fiile to file system, VOILA,
build the original model in a new object, and save the URL for the
file's new location in the database. Love :-)

When I run it in production mode, accessing the ...URL/new link
produces NO output, sends a 500 Server Error return code. Using die
statements, I found that it stops at the ONE line in 'executeNew'
function of the action class.

         $this->form = new
myNewFormNotBasedOnModelNameHasNoAssociatedObjectClass();

Now is where it gets wierd, wierd, wierd. I did the following tracing:

  Put a try/catch block around the line above . . .  no exception gets
trapped.
  Traced out all the Form Hierarchy:
      MyNewForm...
        BaseOldFormName...
          BaseFormDoctrine...
            sfFormDoctrine (has a constructor which calls the
parent::__constructor)
              BaseForm...
                sfFormSymfony  (has a constructor which calls the
parent::__constructor)
                  sfForm  (has a constructor)

So I put an echo statement in the constructor of sfFormDoctrine, the
first constructor that should be encountered by PHP generating the
object, and folks, it never gets executed. Somewhere in building the
object hierarchy, php crashes, or some Symfony/Doctrine code throws an
exception. Now I have NO idea where that code might be, I don't think
there is any. It's just PHP creating an object and until executable
code is found in a constructor, there's nothing the code base can
affect.

So, my next thing is to put a constructor in my new form and see if it
gets executed. Probably, I am going to have to switch to using sfForm
as my base class, 'cause it doesn't have to be based on a model
object, OR, I am going to have to make a model object, OR learn more
about file uploads :-)

I'l post what I find is the error spot, but without a full blown
debugger, I think I"m just going to get lucky if I find it.

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to