Welcome Guest, Not a member yet? Register   Sign In
Active Record Bug !!!!
#1

[eluser]Sarfaraz Momin[/eluser]
Hi Folks,
I got a weird bug in the Active Record which i think is not new to this community but unfortunately I was not able to find any posts regarding it. I am not posting a bug report for this as i know that it might not be a bug in the first place. So the situation is here.

I have ajax forms in the CMS which helps in adding / updating the records. I have this weird problem that sometimes when the update button is clicked and the internet connection does not seem to repond well then the complete table just blanks out. All the fields in the form are blanked out in the table. I has this problem 4 times now and was searching for some stuff on the net out of this forum and found a post from this guy whose issue is somewhat very similar to mine. The link is given below.

Codeigniter ORM Bug

If any of you guys have a solution to this please lemme know. How about using the ORM library. Is that tested for production use. Well there are some updates in the production frontend environment as well so I would be difficult if any such thing happens there.

I hope to get some quick replies on this.

Regards.
#2

[eluser]xwero[/eluser]
Tell me if i'm wrong but you regenerate your table/row after you added/updated a record so when the data isn't send or recieved you are not going to see the updated table/row so i don't know if it's a CI problem.

I don't know what you use to make ajax requests but i think you can solve this using some handling if there is an error with the request. If you use jQuery you could do
Code:
$.ajax({
   type: "POST",
   url: "some.php",
   data: "name=John&location=Boston",
   error : function(msg){
      alert( "Error: " + msg );
   },
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
});
#3

[eluser]Michael Wales[/eluser]
I posted this reply on that blog post:

Quote:This has been mentioned before and is a very well-known fact within the CI community. I do believe EllisLabs is intending on changing the functionality (so this doesn't happen) in future versions, but there is a strong case for validating your input.

Based on the code pasted here - please give us your URL so we can all create admin accounts.

I would highly suggest you backtrack through all of your queries and ensure you are receiving the correct data, from the correct location, in the correct format. If this is done properly - is it literally impossible for this bug to affect you.
#4

[eluser]Sarfaraz Momin[/eluser]
Hi,
I am using jquery and am using the correct ajax request. There is no error in the request since the request is processed fine. It is just that if it misses the condition value for "where" in the request then it does not include that clause at all and mess things up. I do not understand why it does this but i think i can overcome it after doing a little research I found that I can check of the value for the where condition. If found true then the query will execute of pass an error. which can be used as a workaround. If you have a better and more robust solution please provide it asap as I am in urgent need of it.
#5

[eluser]xwero[/eluser]
Sorry for the misunderstanding, i was focusing too much on the following sentence i guess
Quote:I have this weird problem that sometimes when the update button is clicked and the internet connection does not seem to repond well then the complete table just blanks out.


You got a workaround in the form of validating but i don't know if you can consider it a workaround. Validating input is a standard security practice. It applies to every form of input - POST, GET and cookies - for every means of request - form submitting, url and ajax -.

I don't know how the people at Ellislab are going to fix it but i hope it doesn't lead to bad practices.




Theme © iAndrew 2016 - Forum software by © MyBB