Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I accidentally created multiple messages with the same heartbeat id.
I'm trying to delete them, I click the delete button. The drupal message response says "Message deleted", but it's clearly still there. Deletion is not working.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#5 | heartbeat-fix-delete-procedure-725192.patch | 969 bytes | mstef |
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedI fixed this and refactored that part.
Comment #2
Stalski CreditAttribution: Stalski commentedhttp://drupal.org/cvs?commit=338128
Comment #3
mstef CreditAttribution: mstef commentedUsing code in 4.x-dev as of today, I still cannot delete items. I get the confirmation form, then the success message, but the message remains.
Comment #4
mstef CreditAttribution: mstef commentedProblem seems to stem from heartbeat_get_uaids(), which is called from within _heartbeat_activity_delete(). I have locale installed, and it seems that extra query is returning empty.
Comment #5
mstef CreditAttribution: mstef commentedYes, that was the issue. If locale is installed, not only should it add the extra translated message, but the code forgets to also add the original message.
I also changed the delete confirm form component that stores the uaid. It was set to be #type hidden, where it should be #type value.
Patch attached.
Comment #6
Stalski CreditAttribution: Stalski commentedI saw a caveat in the calculation of uaids. When no translations were logged (for what reason ever), the default activity id is still preserverd now.
Pushed to git. I hope this fixes it.
Comment #7
Stalski CreditAttribution: Stalski commentedWell I was thinking of doing it like you did or with array_unique ... does not matter much here.
I am checking the value statement in the patch. What is the specific reason for this?
Comment #8
mstef CreditAttribution: mstef commentedUsing value is more secure than hidden. With hidden, the actual data is available in the HTML source, and there's no reason for it to be. Another way of doing this is how node forms work, by just doing something like: $form['#uaid'] = $uaid. Then in the submit handle, don't check $form_state, just check $form['#uaid'] - keep it out of the source and POST data.
Comment #9
Stalski CreditAttribution: Stalski commentedOk, pushed