moinwiki/moin

'Error: metadata validation failed' when adding a link with starting '+' sign

UlrichB22 opened this issue · 3 comments

If you create a new item called Test and add a link that points to the metadata of this item: [[+meta/Test]],
you can save and view the item, the link works fine. If you try to modify the item and click on "ok" to save it, you will receive the message:

Error: metadata validation failed, invalid field value(s) =

The CLI command to check metadata doesn't find an issue:

$ moin maint-validate-metadata -v -a
0 items with invalid metadata found

Same problem exists with any other url starting with a '+' sign. Deleting the item leads to a HTTP 500 and traceback in the logs. The workaround to fix the problem was manually removing the itemlinks entry in the metadata on the filesystem layer ☹️ .

The issue is similar to #1577.

The validation of itemlinks is using wikiname_validator and name_validator and they don't allow the usage of views like +meta/<itemname>:

List.named(keys.ITEMLINKS).of(String.named("itemlink").validated_by(wikiname_validator)).using(optional=True),

Should we create a new itemlink_validator to solve the issue? Please advise.

Didn't we use the "+" as prefix for actions?

Agree, we need an itemlink_validator to resolve this issue.

Another problem is the links have a class of moin-nonexistent:

<a class="moin-nonexistent" href="/+Highlight/Test2">+Highlight/Test2</a>