Problem saving ENUM field to MySQL using symfony1.4/Doctrine using jquery ajax call
I'm currently on a project that receives applications and the part I'm currently on has a grader that assigns a manual grade for the application.  The possible scores are enum values stored in a MySQL field.  For whatever reason I cannot seem to get the value to actually be save to the database.

I have tried Doctrines Rawsql and I have tried the method below (that I would expect to work).  I have done testing to ensure that the values received on the server side to match the SQL enum field.  I've tried to include as much code as possible that I see as pertaining to the issue, but if there's more needed just let me know!

Function to update field in DB.

    public function executeSetLongAnswerGrade(sfWebRequest $request){
        
        $application = $this->getRoute()->getObject();
        if($request->isXmlHttpRequest()){
            if($request->getParameter("methodCall") == "Passion"){
                $application->setGradepassion($request->getParameter('value'));
                return true;
            }elseif($request->getParameter("methodCall") == "Grammer"){
                $application->setGradegrammer($request->getParameter('value'));
                
            }elseif($request->getParameter('methodCall') == "Thought"){
                $application->setGradethought($request->getParameter('value'));
                return true;
            }
            $application->save();
            return true;
        }
    }


----------


Route:

> ajaxSetLongAnswerGrade:
  url:          /setLongAnswerGrade/:applicationId
  class:        sfDoctrineRoute
  options:      { model: Application, type: object}
  param:        { module: application, action: SetLongAnswerGrade } 
  requirements: 
    id:         \d+ 
    sf_method:  [get]

(Can't find a way to get the yml formatted correctly)
----------
Ajax Call:

    $(document).ready(function(){
    $('#passionMSG').hide();
    $('#grammerMSG').hide();
    $('#thoughtMSG').hide();
    $('.passionSuccess').hide();$('.passionError').hide();
    $('.grammerSuccess').hide();$('.grammerError').hide();
    $('.thoughtSuccess').hide();$('.thoughtError').hide();
	$('#passion').change(function()
	{
		$('#passion').attr('disabled', true);
                $('.passionSuccess').hide();
                $('#passionMSG').slideDown(200);
                $('.passionError').hide();
		$.ajax({
                    url: '<?php echo url_for2('ajaxSetLongAnswerGrade', $application) ?>',
			  data: { methodCall: "Passion",
                                  value: this.value} ,
			  success: function(data) {
				  $('#passion').attr('disabled', false);
                                  $('#passionMSG').slideUp(1500)
                                  $('.passionSuccess').delay(1300).slideDown(2000);
			  },
                          error: function(){
                                  $('#passion').attr('disabled', false);
                                  $('#passionMSG').slideUp(1500)
                                  $('.passionError').delay(1300).slideDown(2000);
                          }
			});
	});});
Problem saving ENUM field to MySQL using symfony1.4/Doctrine using jquery ajax call
===

I'm currently on a project that receives applications and the part I'm currently on has a grader that assigns a manual grade for the application.  The possible scores are enum values stored in a MySQL field.  For whatever reason I cannot seem to get the value to actually be save to the database.

I have tried Doctrines Rawsql and I have tried the method below (that I would expect to work).  I have done testing to ensure that the values received on the server side to match the SQL enum field.  I've tried to include as much code as possible that I see as pertaining to the issue, but if there's more needed just let me know!

Function to update field in DB.

    public function executeSetLongAnswerGrade(sfWebRequest $request){
        
        $application = $this->getRoute()->getObject();
        if($request->isXmlHttpRequest()){
            if($request->getParameter("methodCall") == "Passion"){
                $application->setGradepassion($request->getParameter('value'));
                return true;
            }elseif($request->getParameter("methodCall") == "Grammer"){
                $application->setGradegrammer($request->getParameter('value'));
                
            }elseif($request->getParameter('methodCall') == "Thought"){
                $application->setGradethought($request->getParameter('value'));
                return true;
            }
            $application->save();
            return true;
        }
    }


----------


Route:

> ajaxSetLongAnswerGrade:
  url:          /setLongAnswerGrade/:applicationId
  class:        sfDoctrineRoute
  options:      { model: Application, type: object}
  param:        { module: application, action: SetLongAnswerGrade } 
  requirements: 
    id:         \d+ 
    sf_method:  [get]

(Can't find a way to get the yml formatted correctly)
----------
Ajax Call:

    $(document).ready(function(){
    $('#passionMSG').hide();
    $('#grammerMSG').hide();
    $('#thoughtMSG').hide();
    $('.passionSuccess').hide();$('.passionError').hide();
    $('.grammerSuccess').hide();$('.grammerError').hide();
    $('.thoughtSuccess').hide();$('.thoughtError').hide();
	$('#passion').change(function()
	{
		$('#passion').attr('disabled', true);
                $('.passionSuccess').hide();
                $('#passionMSG').slideDown(200);
                $('.passionError').hide();
		$.ajax({
                    url: '<?php echo url_for2('ajaxSetLongAnswerGrade', $application) ?>',
			  data: { methodCall: "Passion",
                                  value: this.value} ,
			  success: function(data) {
				  $('#passion').attr('disabled', false);
                                  $('#passionMSG').slideUp(1500)
                                  $('.passionSuccess').delay(1300).slideDown(2000);
			  },
                          error: function(){
                                  $('#passion').attr('disabled', false);
                                  $('#passionMSG').slideUp(1500)
                                  $('.passionError').delay(1300).slideDown(2000);
                          }
			});
	});});