Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Keep getting old-values from ORM jquery
  • Hey.
    Situation: i have a form where user places some data in. Currently i ask a query to get data which ill fill out the forms and i add some extra data(arrays) to the results. And then i have the same query which i will use to modify the database data.
    Problem: when i save the form, the new filled data has been saved, so far so good, but the forms are filled with the old values, as i debug the models, i see that they are filled with the old values rather the new/modified values. whats causing the class to read the old values?

    As i needed 2 of the same queries to create a variable for each purpose with same data, i used "from_cache(false)", to make 2 queries, thus imitating a copy, because i cant assign "model1 = model2" and change model1 data, because it will change model2 also


    $sortingamount = Model_SortingAmount::query()->related('sortingamounttranslation')->get();
  • HarroHarro
    Accepted Answer
    I can't comment, because I don't know what you're doing. But I've never seen this, on the contrary, ORM does it's utmost to maintaince a single instance of every object, just to avoid having multiple objects flying around in a different state.

    I am very curious to see what kind of complicated code you have cooked up to make this necessary, can you post a controller method on http://bin.fuelphp.com so that I can see what you're trying to do.

    At the moment, I'm clueless. I've made thousands of forms, and I've never encountered this problem.
  • Today with a fresh mind looked at the code found the issue: it was me,  not this wonderfull framework, i was using templates, but after modifying the data i passed the old data toe the view, rather creating a response to the controller funcion :D You can delete this. 

    Anyway thanks for the response!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion