Author Name: larry shi
Original Redmine Issue: 1443, http://www.fossology.org/issues/1443
Original Date: 2012/03/08
Original Assignee: Bob Gobeille
reproduce:
- click on [Admin]-->[License Admin] menu, then click on any edit icon, click on the link 'update' to change some items of this license.
- repeat the step 1, get one error msg :
File: /usr/local/share/fossology/www/ui/admin-license-file.php, Line number: 361
ERROR: duplicate key value violates unique constraint "rf_md5unique"
UPDATE license_ref set rf_active='true', marydone='false', rf_shortname='3DFX', rf_fullname='', rf_url='', rf_notes='', rf_text_updatable='false', rf_detector_type='2', rf_text='License by Nomos.', rf_md5='2837743839a3f8e500aed1b9144452bb' WHERE rf_pk='202'
#0 debugbacktrace() called at [/usr/local/share/fossology/lib/php/common-db.php:158]
#1 DBCheckResult(, UPDATE license_ref set
rf_active='true',
marydone='false',
rf_shortname='3DFX',
rf_fullname='',
rf_url='',
rf_notes='',
rf_text_updatable='false',
rf_detector_type='2',
rf_text='License by Nomos.',
rf_md5='2837743839a3f8e500aed1b9144452bb'
WHERE rf_pk='202', /usr/local/share/fossology/www/ui/admin-license-file.php, 361) called at [/usr/local/share/fossology/www/ui/admin-license-file.php:361]
#2 admin_license_file->Updatedb(Array ([rf_pk] => 202,[req_marydone] => all,[req_shortname] => All,[updateit] => true,[rf_active] => true,[marydone] => false,[rf_shortname] => 3DFX,[rf_fullname] => ,[rf_text] => License by Nomos.,[rf_text_updatable] => false,[rf_detector_type] => 2,[rf_url] => ,[rf_notes] => )) called at [/usr/local/share/fossology/www/ui/admin-license-file.php:457]
#3 admin_license_file->Output() called at [/usr/local/share/fossology/www/ui/index.php:51]
the reason is because for now, almost all the 'license text' are 'License by Nomos.', but definition of license_ref say rf_md5 should be unique, rf_md5 is from md5(rf_text) .