Skip to content
Snippets Groups Projects
Commit c9c35d2d authored by Angie Byron's avatar Angie Byron
Browse files

#260372 by andershal and nedjo: Fix count bug in translation deletion logic.

parent f070c5d0
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -255,8 +255,8 @@ function translation_nodeapi_delete(&$node, $teaser, $page) {
*/
function translation_remove_from_set($node) {
if (isset($node->tnid)) {
if (db_result(db_query('SELECT COUNT(*) FROM {node} WHERE tnid = %d', $node->tnid)) <= 2) {
// There would only be one node left in the set: remove the set altogether.
if (db_result(db_query('SELECT COUNT(*) FROM {node} WHERE tnid = %d', $node->tnid)) == 1) {
// There is only one node left in the set: remove the set altogether.
db_query('UPDATE {node} SET tnid = 0, translate = 0 WHERE tnid = %d', $node->tnid);
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment