Upgrading to 2.0 seems to have done the trick! Thank you!
I'm pretty sure this change is preventing me from installing this package on Drupal 10.2.7. It forces an install of 10.2.0 instead, which is not at all what I want. It worked fine before this fix. Was that the intention?
Thanks!
Patch in #257 is rejected when applied to Drupal 10.2.0. I could try to reroll it myself, but I'm afraid I might not know exactly what this code is meant to do.
The reason is in `web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php`. The `*.rej` file reads as follows:
--- modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -160,19 +155,32 @@ public function buildExtraOptionsForm(&$form, FormStateInterface $form_state) {
];
}
+ /**
+ * {@inheritdoc}
+ */
+ public function submitExtraOptionsForm($form, FormStateInterface $form_state) {
+ $vids = $form_state->getValue(['options', 'vids']);
+ $form_state->setValue(['options', 'vids'], array_keys(array_filter($vids)));
+ }
+
protected function valueForm(&$form, FormStateInterface $form_state) {
- $vocabulary = $this->vocabularyStorage->load($this->options['vid']);
- if (empty($vocabulary) && $this->options['limit']) {
+ $vocabularies = $this->vocabularyStorage->loadMultiple($this->options['vids']);
+ if (empty($vocabularies) && $this->options['limit']) {
$form['markup'] = [
- '#markup' => '<div class="js-form-item form-item">' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
+ '#markup' => '<div class="js-form-item form-item">' . $this->t('Invalid or no vocabularies are selected. Please select valid vocabularies in filter settings.') . '</div>',
];
return;
}
+ $form['value'] = [
+ '#title' => $this->options['limit'] ? $this->formatPlural(count($vocabularies), 'Select terms from vocabulary @vocabs', 'Select terms from vocabularies @vocabs', [
+ '@vocabs' => "'" . implode("', '", $this->getVocabularyLabels($vocabularies)) . "'",
+ ]) : $this->t('Select terms'),
+ ];
+
if ($this->options['type'] == 'textfield') {
- $terms = $this->value ? Term::loadMultiple(($this->value)) : [];
- $form['value'] = [
- '#title' => $this->options['limit'] ? $this->t('Select terms from vocabulary @voc', ['@voc' => $vocabulary->label()]) : $this->t('Select terms'),
+ $terms = $this->value ? $this->termStorage->loadMultiple($this->value) : [];
+ $form['value'] += [
'#type' => 'textfield',
'#default_value' => EntityAutocomplete::getEntityLabels($terms),
];
FYI, this change broke our site and I just spent quite a while trying to debug it. I have custom code that expected the data to be a serialized array. I did not anticipate this kind of change from RC to stable as I wouldn't classify it as a bug fix. Just wanted to document it, in case others also have this issue.
That said, I'm very pleased that these values are JSON now! So much easier to work with! Appreciate all your hard work for this fantastic module!
I'm also having this problem, but with Drupal 9.5.10 on PHP 8.1 and Link fields.
I'm using a Link field with unlimited values, but this also happens when you have limited values >1 but not all of them are being used. This is due to this pre-validation on the form load that will validate the empty placeholder fields (which have a null value).
I've tried it on a fresh install (versions are above) with only Workspaces turned on, created a content type with an unlimited Link field. Created a node with at least one value in the Link field. Went to the edit form for the node to see the deprecation notices. This would likely be fatal in PHP 8.2.
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /var/www/html/web/core/lib/Drupal/Core/Url.php on line 281
Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /var/www/html/web/core/lib/Drupal/Core/Url.php on line 284
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/web/core/lib/Drupal/Core/Url.php on line 289
jklmnop β created an issue.