Verified Commit 66ac2064 authored by Jess's avatar Jess
Browse files

Issue #3185640 by lucienchalom, jungle, smustgrave, ravi.shankar, andregp,...

Issue #3185640 by lucienchalom, jungle, smustgrave, ravi.shankar, andregp, xjm, quietone, sergiogsanchez: Fix or ignore words that start with "v", excluding real non-English words
parent 5a193a82
......@@ -2,6 +2,8 @@
namespace Drupal\Component\Transliteration;
// cspell:ignore vibber
/**
* Implements transliteration without using the PECL extensions.
*
......
......@@ -1392,26 +1392,19 @@ userref
userreference
userspace
usuario
vals
vampirize
varchar
veeeery
veniam
verison
versionable
versionless
verygreatdrupalmodule
vfsstream
vibber
viewmode
viewports
viewsviewfiles
vocabs
volgende
vorige
vous
vxezb
vxfbk
wcprops
webassert
webcal
......
......@@ -274,35 +274,37 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf
];
$exception->embeddedHtmlResponse = NULL;
// cSpell:disable-next-line.
$token = 'PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU';
// 7. Edge case: response filter throwing an exception for this placeholder.
$embedded_response_exception = new BigPipePlaceholderTestCase(
[
'#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::responseException', []],
'#create_placeholder' => TRUE,
],
'<drupal-render-placeholder callback="\Drupal\big_pipe_test\BigPipeTestController::responseException" arguments="" token="PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU"></drupal-render-placeholder>',
'<drupal-render-placeholder callback="\Drupal\big_pipe_test\BigPipeTestController::responseException" arguments="" token="' . $token . ' "></drupal-render-placeholder>',
[
'#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::responseException', []],
]
);
$embedded_response_exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU';
$embedded_response_exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=' . $token;
$embedded_response_exception->bigPipePlaceholderRenderArray = [
'#markup' => '<span data-big-pipe-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU"></span>',
'#markup' => '<span data-big-pipe-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=' . $token . '"></span>',
'#cache' => $cacheability_depends_on_session_and_nojs_cookie,
'#attached' => [
'library' => ['big_pipe/big_pipe'],
'drupalSettings' => [
'bigPipePlaceholderIds' => [
'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU' => TRUE,
'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=' . $token => TRUE,
],
],
'big_pipe_placeholders' => [
'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU' => $embedded_response_exception->placeholderRenderArray,
'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=' . $token => $embedded_response_exception->placeholderRenderArray,
],
],
];
$embedded_response_exception->embeddedAjaxResponseCommands = NULL;
$embedded_response_exception->bigPipeNoJsPlaceholder = '<span data-big-pipe-nojs-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU"></span>';
$embedded_response_exception->bigPipeNoJsPlaceholder = '<span data-big-pipe-nojs-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&amp;&amp;token=' . $token . '"></span>';
$embedded_response_exception->bigPipeNoJsPlaceholderRenderArray = [
'#markup' => $embedded_response_exception->bigPipeNoJsPlaceholder,
'#cache' => $cacheability_depends_on_session_and_nojs_cookie,
......
......@@ -31,18 +31,18 @@
* A string with the summary.
*/
function checkboxesSummary(context) {
const vals = [];
const values = [];
const $checkboxes = $(context).find(
'input[type="checkbox"]:checked + label',
);
const il = $checkboxes.length;
for (let i = 0; i < il; i++) {
vals.push($($checkboxes[i]).html());
values.push($($checkboxes[i]).html());
}
if (!vals.length) {
vals.push(Drupal.t('Not restricted'));
if (!values.length) {
values.push(Drupal.t('Not restricted'));
}
return vals.join(', ');
return values.join(', ');
}
$(
......
......@@ -559,6 +559,7 @@ public static function fromString(string $elements_string): HTMLRestrictions {
unset($allowed_elements['*']);
// @see \Drupal\filter\Plugin\Filter\FilterHtml::getHTMLRestrictions()
// @todo remove this in https://www.drupal.org/project/drupal/issues/3226368
// cSpell:disable-next-line
unset($allowed_elements['__zqh6vxfbk3cg__']);
// Postprocess tag wildcards: convert
......
......@@ -13,6 +13,8 @@
use Drupal\node\Entity\NodeType;
use Drupal\Tests\BrowserTestBase;
// cspell:ignore viewsviewfiles
/**
* Translate settings and entities to various languages.
*
......
......@@ -256,6 +256,7 @@ public function getHTMLRestrictions() {
$html = str_replace('>', ' />', $this->settings['allowed_html']);
// Protect any trailing * characters in attribute names, since DomDocument
// strips them as invalid.
// cSpell:disable-next-line
$star_protector = '__zqh6vxfbk3cg__';
$html = str_replace('*', $star_protector, $html);
$body_child_nodes = Html::load($html)->getElementsByTagName('body')->item(0)->childNodes;
......
name: 'Locale Test Development Release'
type: module
description: 'Helper module to test the behavior when the core verison is a development release.'
description: 'Helper module to test the behavior when the core version is a development release.'
package: Testing
version: VERSION
hidden: true
......@@ -17,24 +17,26 @@
const $context = $(context);
// Provide the vertical tab summaries.
$context.find('#edit-workflow').drupalSetSummary((context) => {
const vals = [];
const values = [];
$(context)
.find('input[name^="options"]:checked')
.parent()
.each(function () {
vals.push(Drupal.checkPlain($(this).find('label')[0].textContent));
values.push(
Drupal.checkPlain($(this).find('label')[0].textContent),
);
});
if (!$(context).find('#edit-options-status').is(':checked')) {
vals.unshift(Drupal.t('Not published'));
values.unshift(Drupal.t('Not published'));
}
return vals.join(', ');
return values.join(', ');
});
$(context)
.find('#edit-language')
.drupalSetSummary((context) => {
const vals = [];
const values = [];
vals.push(
values.push(
$(context).find(
'.js-form-item-language-configuration-langcode select option:selected',
)[0].textContent,
......@@ -44,10 +46,10 @@
.find('input:checked')
.next('label')
.each(function () {
vals.push(Drupal.checkPlain(this.textContent));
values.push(Drupal.checkPlain(this.textContent));
});
return vals.join(', ');
return values.join(', ');
});
},
};
......
......@@ -17,30 +17,30 @@
const $context = $(context);
// Provide the vertical tab summaries.
$context.find('#edit-submission').drupalSetSummary((context) => {
const vals = [];
vals.push(
const values = [];
values.push(
Drupal.checkPlain($(context).find('#edit-title-label')[0].value) ||
Drupal.t('Requires a title'),
);
return vals.join(', ');
return values.join(', ');
});
$context.find('#edit-workflow').drupalSetSummary((context) => {
const vals = [];
const values = [];
$(context)
.find('input[name^="options"]:checked')
.next('label')
.each(function () {
vals.push(Drupal.checkPlain(this.textContent));
values.push(Drupal.checkPlain(this.textContent));
});
if (!$(context).find('#edit-options-status').is(':checked')) {
vals.unshift(Drupal.t('Not published'));
values.unshift(Drupal.t('Not published'));
}
return vals.join(', ');
return values.join(', ');
});
$('#edit-language', context).drupalSetSummary((context) => {
const vals = [];
const values = [];
vals.push(
values.push(
$(
'.js-form-item-language-configuration-langcode select option:selected',
context,
......@@ -50,24 +50,24 @@
$('input:checked', context)
.next('label')
.each(function () {
vals.push(Drupal.checkPlain(this.textContent));
values.push(Drupal.checkPlain(this.textContent));
});
return vals.join(', ');
return values.join(', ');
});
$context.find('#edit-display').drupalSetSummary((context) => {
const vals = [];
const values = [];
const $editContext = $(context);
$editContext
.find('input:checked')
.next('label')
.each(function () {
vals.push(Drupal.checkPlain(this.textContent));
values.push(Drupal.checkPlain(this.textContent));
});
if (!$editContext.find('#edit-display-submitted').is(':checked')) {
vals.unshift(Drupal.t("Don't display post information"));
values.unshift(Drupal.t("Don't display post information"));
}
return vals.join(', ');
return values.join(', ');
});
},
};
......
......@@ -38,16 +38,16 @@
$context.find('.node-form-options').drupalSetSummary((context) => {
const $optionsContext = $(context);
const vals = [];
const values = [];
if ($optionsContext.find('input').is(':checked')) {
$optionsContext
.find('input:checked')
.next('label')
.each(function () {
vals.push(Drupal.checkPlain(this.textContent.trim()));
values.push(Drupal.checkPlain(this.textContent.trim()));
});
return vals.join(', ');
return values.join(', ');
}
return Drupal.t('Not promoted');
......
......@@ -74,7 +74,7 @@ public function providerComputedConstraintName() {
return [
['user_field_data', 'pkey', 'user_field_data____pkey'],
['user_field_data', 'name__key', 'user_field_data__name__key'],
['user_field_data', 'a_veeeery_veery_very_super_long_field_name__key', 'drupal_BGGYAXgbqlAF1rMOyFTdZGj9zIMXZtSvEjMAKZ9wGIk_key'],
['user_field_data', 'a_very_very_very_very_super_long_field_name__key', 'drupal_WW_a8TlbZ3UQi20UTtRlJFaIeSa6FEtQS5h4NRA3UeU_key'],
];
}
......
......@@ -135,11 +135,11 @@ public function preRender(&$values) {
}
if ($nids) {
$vocabs = array_filter($this->options['vids']);
$vids = array_filter($this->options['vids']);
if (empty($this->options['limit'])) {
$vocabs = [];
$vids = [];
}
$result = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->getNodeTerms($nids, $vocabs);
$result = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->getNodeTerms($nids, $vids);
foreach ($result as $node_nid => $data) {
foreach ($data as $tid => $term) {
......
......@@ -343,7 +343,7 @@ public function resetWeights($vid) {
/**
* {@inheritdoc}
*/
public function getNodeTerms(array $nids, array $vocabs = [], $langcode = NULL) {
public function getNodeTerms(array $nids, array $vids = [], $langcode = NULL) {
$query = $this->database->select($this->getDataTable(), 'td');
$query->innerJoin('taxonomy_index', 'tn', '[td].[tid] = [tn].[tid]');
$query->fields('td', ['tid']);
......@@ -352,8 +352,8 @@ public function getNodeTerms(array $nids, array $vocabs = [], $langcode = NULL)
$query->orderby('td.name');
$query->condition('tn.nid', $nids, 'IN');
$query->addTag('taxonomy_term_access');
if (!empty($vocabs)) {
$query->condition('td.vid', $vocabs, 'IN');
if (!empty($vids)) {
$query->condition('td.vid', $vids, 'IN');
}
if (!empty($langcode)) {
$query->condition('td.langcode', $langcode);
......
......@@ -118,16 +118,16 @@ public function resetWeights($vid);
*
* @param array $nids
* Node IDs to retrieve terms for.
* @param array $vocabs
* (optional) A vocabularies array to restrict the term search. Defaults to
* empty array.
* @param array $vids
* (optional) an array of vocabulary IDs to restrict the term search.
* Defaults to empty array.
* @param string $langcode
* (optional) A language code to restrict the term search. Defaults to NULL.
*
* @return array
* An array of nids and the term entities they were tagged with.
*/
public function getNodeTerms(array $nids, array $vocabs = [], $langcode = NULL);
public function getNodeTerms(array $nids, array $vids = [], $langcode = NULL);
/**
* Returns the hierarchy type for a specific vocabulary ID.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment