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
@@ -386,88 +386,90 @@ function locale_update_8005() {
}
$plural_lids=array_unique($plural_lids);
// Look up all translations for these source strings. Ordering by language
// will group the strings by language, the 'plid' order will get the
// strings in singular/plural order and 'plural' will get them in precise
// sequential order needed.
$results=db_query("SELECT s.lid, s.source, t.translation, t.plid, t.plural, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid WHERE s.lid IN (:lids) ORDER BY t.language, t.plid, t.plural",array(':lids'=>$plural_lids));
// Collect the strings into an array and combine values as we go.
$strings=array();
$parents_to_sources=array();
$remove_lids=array();
foreach($resultsas$child){
$strings[$child->language][$child->lid]=array(
'source'=>array($child->source),
'translation'=>array($child->translation),
);
if(empty($child->plid)){
// Non-children strings point to themselves as parents. This makes it
// easy to look up the utmost parents for any plurals.
$parents_to_sources[$child->lid]=$child->lid;
}
else{
// Children strings point to their utmost parents. Because we get data
// in PLID order, we can ensure that all previous parents have data now,
// so we can just copy the parent's data about their parent, etc.
// Append source to the utmost parent's source string only if it is the
// plural variant. Further Drupal specific plural variants are not to be
// retained for source strings.
$utmost_parent['source'][]=$child->source;
if(!empty($plural_lids)){
// Look up all translations for these source strings. Ordering by language
// will group the strings by language, the 'plid' order will get the
// strings in singular/plural order and 'plural' will get them in precise
// sequential order needed.
$results=db_query("SELECT s.lid, s.source, t.translation, t.plid, t.plural, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid WHERE s.lid IN (:lids) ORDER BY t.language, t.plid, t.plural",array(':lids'=>$plural_lids));
// Collect the strings into an array and combine values as we go.
$strings=array();
$parents_to_sources=array();
$remove_lids=array();
foreach($resultsas$child){
$strings[$child->language][$child->lid]=array(
'source'=>array($child->source),
'translation'=>array($child->translation),
);
if(empty($child->plid)){
// Non-children strings point to themselves as parents. This makes it
// easy to look up the utmost parents for any plurals.
$parents_to_sources[$child->lid]=$child->lid;
}
else{
// Children strings point to their utmost parents. Because we get data
// in PLID order, we can ensure that all previous parents have data now,
// so we can just copy the parent's data about their parent, etc.