Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4549748
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:24:11+00:00 2026-05-21T16:24:11+00:00

I’m currently on a project that receives applications and the part I’m currently on

  • 0

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]

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);
                      }
        });
});});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:24:12+00:00Added an answer on May 21, 2026 at 4:24 pm

    This ended up being in my routing.yml file. The lack of method: find in options: { model: Application, type: object}is what was causing the error. A save was occuring, but not on the record I was wanting (I thought this was implicit but it instantly started working after I added this). final code…

    public function executeSetLongAnswerGrade(sfWebRequest $request){
    $application = $this->getRoute()->getObject();
    if($request->isXmlHttpRequest()){
        $application->{$request->getParameter('value')}($request->getParameter('value'));
        $application->save();
        return sfView::NONE;
    }else{
        return false;
    }
    

    and the ajax….

    $('#passion').attr('disabled', true);
            $('.passionSuccess').hide();
            $('#passionMSG').slideDown(200);
            $('.passionError').hide();
    $.ajax({
                url: '<?php echo url_for2('ajaxSetLongAnswerGrade', $application) ?>',
          data: { methodCall: "setGradepassion",
                              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);
                      }
        });
    

    I do appreciate the guidance! I was raised Java and still getting used to symfony/php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a small JavaScript validation script that validates inputs based on Regex. I
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.