Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
can you add to the end of this function line "return true;" as i did? when i delete rel's with api in ajax i can't check if that action success or failed without this line.
Comment | File | Size | Author |
---|---|---|---|
#2 | user_relationships_1740344.patch | 1.23 KB | drewish |
Comments
Comment #1
mrf CreditAttribution: mrf commentedSounds like a bug to me.
Comment #2
drewish CreditAttribution: drewish commentedHow's this look? I wouldn't call it a bug before because there was no result documented so it was working as designed.
Comment #3
drewish CreditAttribution: drewish commentedComment #4
b8x CreditAttribution: b8x commentedlooks good
Comment #5
Berdir@drewish: Thanks for working on this project. I'm going to be more or less offline for the next three weeks, but I'll look at your patches when I'm back.
Comment #6
BerdirNote the the return value of db_delete()->execute() is defined as "Depends on the database". I'm not sure if we can rely on this as this patch is trying to do.
Comment #7
drewish CreditAttribution: drewish commentedRight that's exactly why I documented the return value as coming from DeleteQuery::execute(), so people can dig into it if they really need to know what it'll be. But that said my understanding is core's database layers return truthy values.
I don't see the harm in bubbling the result up, but I don't think it makes any sense to return a hard coded TRUE value.
Comment #8
b8x CreditAttribution: b8x commentedIf at least some kind of mistake will be, f-tion will fail and return the no result. Maybe the error is with the object $relationship. to be correct, check whether the object is removed must be in the same f-tion, why not. Simple db_seleсt(). if you want to just make sure that the link is removed.