Closed (fixed)
Project:
Taxonomy Title
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2011 at 11:54 UTC
Updated:
21 Dec 2011 at 18:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
fuerst commentedLooks like an empty title will trigger the insert in
_taxonomy_title_update(). Asdb_result()returns FALSE if no record found you can use that for triggering the update instead. Attached patch fixes that.BTW: Wouldn't it be better to delete a record from {taxonomy_title} once a title gets empty?
Comment #2
jenlamptoncleaning up queue
Comment #3
fuerst commentedHow did you fix the issue? Did not find a related commit. Therefore resetting status to the former one.
Comment #4
jenlamptonIf you check the dev branch, there are already issets wrapped around the insert and update hooks that solve this problem. If you'd like to add a delete when title is empty though, I'll review that patch :)
Comment #5
joostpluijmers commentedAh yea, those lines are probably the result of my overachieving IDE. The produced was:
user warning: Duplicate entry '2' for key 'PRIMARY' query: INSERT INTO taxonomy_title (tid, title) VALUES (2, '') in taxonomy_title.module on line 161.
This error occurred in the event that you edit a term with an empty title. The empty titles were caused by checking if a $form_state value was set, which it always is due to the form API. The update function checks against existence of a record which exists with an empty title string, but the check fails because an empty string is also false (go PHP freetyping ;). Thus causing the insert error.
I uploaded a new patch, with only the necessary lines. It also includes a ‘no query’ check by submitting an arbitrary flag that signals if there was a previous taxonomy title.
Comment #6
jenlamptonGreat work :)
I've cleaned up some of your syntax: changed true to TRUE and added/removed some spaces where necessary. See http://drupal.org/coding-standards for reference. Here's a new patch. Can you test this one and make sure it works the same as yours?
Comment #7
joostpluijmers commentedThanks for the cleanup, I will have to outfit a formatter to match those coding standards and try out those development modules.
All mutations on terms and titles are working like in my patch. This works.
Comment #8
jenlamptonThanks! (In the future, you can also change the status of the issue when you leave your comment)
Do you feel up to providing a matching patch for the D7 branch? :)
Comment #9
jenlamptoncommitted to 6.x-1.x . will be included in the next release.
Comment #10
joostpluijmers commentedThen I am now officialy a Drupal contributor. :)
*Pops the cork*
Comment #11
jenlamptonCongratulations, and thank you! :)