question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pattern contains forbidden fields

See original GitHub issue

Same issue as in #62

Strapi version: 4.1.2 Plugin version: 2.0.6

Configuration:

sitemap: {
    enabled: true,
    allowedFields: [
      'id',
      'uid',
      'text'
    ],
},

However, it only suggests the id field, and when trying to use something else, an error message pops up, saying “Pattern contains forbidden fields”:

image image

I am trying to combine this plugin with that one: https://github.com/ComfortablyCoding/strapi-plugin-slugify

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
boazpoolmancommented, Mar 7, 2022

id and uid are available as types by default. But a uid field named “my-weird-url-field-name” would not be available by default if I were to use the field names instead of field types.

The id is kind of an exception, because the user can’t name the id field themselfs.

EDIT: Honestly I hope in the future some plugin will come that has it’s own URL field type. (Maby the slugify plugin). Then (hopefully) everybody will use that plugin for their URL fields, and I’ll allow that field type by default. That way (pretty much) nobody will have to use the allowedFields config.

1reaction
SoftCreatRcommented, Mar 7, 2022

Meh… I should read better 😄 Thank you very much, it works now (after changing text to string ^^)

Just wondering: Wouldn’t it be easier/more intuitive to use the field names, instead of their types?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use of non UID type field · Issue #19 - GitHub
This plugin has been written to use UID type fields as URLs to build the sitemap xml. Potentially we could use a non...
Read more >
Configuring fields for content-types - Strapi documentation
Content-types are composed of one or several fields. Each field is designed to contain specific kind of data, filled up in the Content ......
Read more >
Regular expression for excluding special characters [closed]
This regular expression will match all inputs that have a blacklisted character ... for this technique is for the pattern attribute for HTML...
Read more >
Values that you specify when you create or update a distribution
When you create a new distribution, the value of Path Pattern for the default cache behavior is set to * (all files) and...
Read more >
Bug Patterns - Error Prone
Each bug pattern includes code examples of both positive and negative cases; these examples are ... Access to a private protocol buffer field...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found