Contribution Date
Technology
Contribution Project
Contribution Details
Hey Siddarth,
I just cloned this project and enabled on local and tried uploading image on a certain role.
per_role_picture.admin.inc file:
1) Line 72 generates a fatal error.DOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'uid' in 'field list': INSERT INTO {per_role_picture} (rid, fid, uid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 6 [:db_insert_placeholder_1] => 17 [:db_insert_placeholder_2] => 1 ) in per_role_picture_form_submit() (line 72
You are trying to insert "uid" in $record -> which is later entered into per_role_picture schema.
But this column does not exist there.
Reference.
$record = array(
'fid' => $file_saved->fid,
'uid' => $user->uid, // THIS THING
);
if ($file_saved->status === FILE_STATUS_PERMANENT) {
db_merge('per_role_picture')->key(array('rid' => $rid))->fields($record)->execute();
drupal_set_message(t('User picture for @name role has been saved.', array('@name' => $role->name)));
}
Contribution Issue Link
Contribution Link
Files count
0
Patches count
0