Upload will insert new row when setup primary key at model ?
Closed this issue · 1 comments
tuanrobe1989 commented
When i change primary key at model to new character ID, After saved will add new row, not update this row, I found cause and fixed
At line 30 core/helpers/mvc_form_helper.php
$html .= '<input type="hidden" id="'.$this->input_id('hidden_id').'" name="'.$this->input_name('id').'" value="'.$object_id.'" />';
Replace to below:
$html .= '<input type="hidden" id="'.$this->input_id('hidden_id').'" name="data['.$this->model->name.']['.$this->model->primary_key.']" value="'.$object_id.'" />';
Thanks
cyberscribe commented
Thanks. Please submit a pull request if you think you have found a bug. :)
…On 17 November 2017 at 10:37, tuanrobe1989 ***@***.***> wrote:
When i change primary key at model to new character ID, After saved will
add new row, not update this row, I found cause and fixed
*At line 30 core/helpers/mvc_form_helper.php*
$html .= '';
*Replace to below:*
$html .= '';
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#199>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAqV5aCy2ELeDB3KUyVKM6S3P0H2Dr19ks5s3WHZgaJpZM4Qh2Kf>
.