[OJS 3.2.1-1] Cannot add keywords

Hi,
Authors can insert their submission keywords with no problem.
But if, say, an Editor tries to add a new one later on within the editorial stages in the Metadata section some errors occur.

I’ve inspected the devtools console, when adding a new keyword and I see the following:

build.js?v=3.2.1.1:14 TypeError: Cannot read property ‘match’ of null
at build.js?v=3.2.1.1:8
at Array.filter ()
at o.filteredSuggestions (build.js?v=3.2.1.1:8)
at ri.get (build.js?v=3.2.1.1:14)
at ri.evaluate (build.js?v=3.2.1.1:14)
at o.filteredSuggestions (build.js?v=3.2.1.1:14)
at o.Ke (build.js?v=3.2.1.1:8)
at o.e._render (build.js?v=3.2.1.1:14)
at o.i (build.js?v=3.2.1.1:14)
at ri.get (build.js?v=3.2.1.1:14)

I also researched the code which generates the error, and I could find it here:

filteredSuggestions: function () {
var e = this;
if (!this.inputValue) return [];
var t = new RegExp(this.inputValue.replace(/[-/\^$*+?.()|[]{}]/g, ‘\$&’), ‘gi’),
n = this.suggestions.filter((function (n) {
return !e.inputValue.includes(n) && n.match(t)
}));

Any help with this issue?
Thanks in advance

Regards,
Juan

Hi @jascanio,

Is there anything relevant in your PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for your reply

No, there isn’t apparently anything relevant in the error log. It seems to be a javascript issue.

Should I look for anything in particular in the PHP error log?

The attached image shows how a new keyword looks like (sometimes) when being inserted in the existing metadata field for keywords. In this ocassion, the system accepted the keyword. I tried to type in a new one afterwards but the form wouldn’t accept anymore keywords. Nor “Enter” nor “tab” would produce any effect. The keyword would remain in the text field like a free text, nothing happening.

Thanks in advance for your help.
keyword

Regards,
Juan

Hi again @asmecher,

I think it’s solved already. By querying the table controlled_vocab_entry_settings, we found lots of null values for column setting_value.

A big batch of back issues had been inserted with QuickSubmit, which treats keywords in a different manner as far as obligation of insertion is concerned.

We queried the db so as null values where replaced with a sample word. That solved the issue.

Regards,
Juan

1 Like