Posted by rajiv.r.in on July 14, 2009 at 2:52pm
| Project: | Library |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I can create the first 'Patron', but when I attempt to create another one (or more), I get the following error:
user warning: Duplicate entry '0' for key 'patron_uid' query: INSERT INTO library_patrons (nid, name_last, name_first, email, patron_uid, barcode, disabled) VALUES (194, 'lastname', 'firstname', 'firstname.lastname@domain.com', 0, '', 0) in C:\xampp\htdocs\drupal\sites\all\modules\library-6.x-1.x-dev\library\patron\patron.module on line 123.
However, the content does get created: as is indicated by the following message:
Library Patron firstname lastname has been created.
However, this 'Patron' is not visible in 'parton list'
Any help would be highly appreciated. thx!
Comments
#1
Sounds like you're using the patron module without the patrons as users option. I wouldn't recommend this in the long term since my current plan (if I were to release a Drupal 7 version) is to simplify the module by removing the 'patron' submodule altogether and just use Drupal users.
I think I've found the error, but it may take me a while to release an update since I don't currently have an environment to test it. If you'd like to try it, change line 190 in the patron module to the following:
$node->patron_uid = NULL;Then run the following SQL statement on your database:
UPDATE library_patrons SET patron_uid = NULL WHERE patron_uid = 0
If you try it, please let me know if it fixes the problem.
#2
Thx Jastraat for responding!
I will try the solution and will let you know the results. However, I did not see the option of "patrons are users" anywhere while configuring the module. If you can point me to that, I'll try that first before attempting to change the code in the module.
Thx agian, Rajiv
#3
Check admin/settings/library/patrons
#4
Thank you so much! I followed the link and activated the user setting “Associate Library Partons with Drupal Users” and it solved the problem. The problem was, there is no link visible on ‘admin/settings/library’. But when I typed ‘admin/settings/library/patrons’ in the browser, I was straightway taken to the ‘Parton Settings’ page. There, I activated the option.
#5
Here's a patch that fixes the above problem.
#6
#7
patch applied to latest dev version
#8
Automatically closed -- issue fixed for 2 weeks with no activity.