Score:0

How to find bad tokens stored in config automatically?

cn flag

I recently deleted some fields (media_term_fruits) and created new fields (media_fruits) on a local dev site. I then exported the config and pushed it to my dev server.

My dev server uses Github Actions to import config and everything imported with no errors.

However, for my media image fields, I set the image path using a token via the Filefield Paths module. This token referenced a deleted field (media_term_fruits), but the config imported as valid config even though the field media_term_fruits no longer exists.

If I go to the /admin/structure/media/manage/image/fields/media.image.field_media_image page and re-save the config, I get the error:

File path is using the following invalid tokens: [media:field_media_term_fruits:0:entity:url:path].

Is there some way to catch this error automatically (perhaps during config import) instead of requiring me to visit the site and manually resave all the config to check for errors?

Here, I gave the example of the Filefield Paths module, but please consider this question to apply to any module in which the exported config values can be imported, but those values are actually invalid for the site and will produce an error when attempting to save the data on the config page.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.