Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
function message_type_delete has a wrong explanation: message -> message type OR
There's a misconsistency in object and id:
It is:
/**
* Deletes an existing message.
*
* @param $message
* The message object to be deleted.
*/
function message_type_delete($message) {
return entity_delete('message_type', $message);
}
It should be:
/**
* Deletes an existing message type.
*
* @param $message_id
* The message type object id to be deleted.
*/
function message_type_delete($message) {
return entity_delete('message_type', $message);
}
OR:
/**
* Deletes an existing message type.
*
* @param $message
* The message type object to be deleted.
*/
function message_type_delete($message) {
return entity_delete('message_type', $message->id);
}
I believe the second one is a better way as you can use function message_type_load() to load the message type object and you just pass this object into function message_type_delete().
Comment | File | Size | Author |
---|---|---|---|
#7 | fix_function_message_type_delete-2299231-7.patch | 597 bytes | karuna patel |
| |||
#6 | message-message_type_delete-2299231-6.patch | 599 bytes | jacob.embree |
| |||
#5 | message_type_delete.patch | 562 bytes | bsandor |
|
Comments
Comment #1
bsandor CreditAttribution: bsandor commentedComment #2
bsandor CreditAttribution: bsandor commentedComment #3
bsandor CreditAttribution: bsandor commentedComment #4
bsandor CreditAttribution: bsandor commentedComment #5
bsandor CreditAttribution: bsandor commentedComment #6
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentedEntity delete functions normally expect the entity identifier as the parameter. Here is a patch to fix the documentation and parameter name but leaves the functionality the same.
Comment #7
karuna patel CreditAttribution: karuna patel as a volunteer and at SynapseIndia Outsourcing Pvt. Ltd. commented#6 patch worked for me, I have updated documentation and parameter in patch.
Comment #8
karuna patel CreditAttribution: karuna patel as a volunteer and at SynapseIndia Outsourcing Pvt. Ltd. commentedComment #9
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedLooks good to me. +1 to RTBC
Comment #10
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentedI think the patch in #6 is better than the patch in #7 because #6 makes it more clear what the nature of the parameter must be.
Comment #11
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented