Welcome Guest, Not a member yet? Register   Sign In
Is it safe to suppress the update_batch bug in CI by making changes in System file``
#1

[eluser]jigarjain[/eluser]
My Problem is, i have used update_batch function of CI in few places in my app & it throws an error stating

Code:
A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: database/DB_active_rec.php

Line Number: 1407

On googling a bit i found that it is actually an CI bug and had a fix here

It asks to change the line 1407 from
Code:
$not[] = $k.'-'.$v;

to this

Code:
$not[] = $k2.'-'.$v2;

Wanted to know whether it would be safe to make this change in System File ? I mean are there any other dependencies which might get affected because of this change ?
#2

[eluser]TheFuzzy0ne[/eluser]
Yes, it's safe, or I wouldn't have suggested it. Wink

Editing system files is not normally recommended, and in fact, it's frowned upon, but in this instance, since we can't extend the database classes (as we can with all of the other libraries), it really is the only solution besides moving the method somewhere else, which would mess up your application flow.

Since that code doesn't actually seem to do anything, you can safely comment it out. Changing it as you suggested will certainly fix the error, but since the code itself does nothing besides adding data to an array that's never used, you can safely comment it out and then forget about it.

I recommend commenting it out over removing it, so that if you ever get any other errors, the line number you give us will be correct, which will help us to fix the error.

I still haven't submitted a fix for this, but I'm hoping to tonight -- I've been really busy.

Hope this helps. Smile




Theme © iAndrew 2016 - Forum software by © MyBB