Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Nikomuse

    (@nikomuse)

    In the dbte_save_cb function of the db-table-editor.php file, in the condition at the line 349, you don’t send any id to $cur->update_cb function, but in the ‘else’ closure, id is well set in the $where variable.

    If I may suggest this fix, l.350 :
    call_user_func($cur->update_cb,$cur, $up, $cols, $idxs[$ridx], $id);

    Regards,
    Nicolas.

    Plugin Author bobbysmith007

    (@bobbysmith007)

    I just updated the version to 1.3 With the changes you have suggested in place. Thanks for the bug report. In my one case of using the callbacks, I had to recompute the ID anyway, so it was not missed, but it certainly does make sense to pass it.

    I think next time I have to change the API of these functions I will change them to using an array of keyword arguments instead so that additive changes to the API are less likely to cause problems.

    Added ID to callbacks / actions where it makes sense
    * update_cb, delete_cb, dbt_row_updated

    Thread Starter Nikomuse

    (@nikomuse)

    Ok. Great, thanks !

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Update problem with update_cb callback function’ is closed to new replies.