I hesitate to post this as it's so vague . . . Yesterday I noticed that an image field on a custom content type had disappeared. (This is outwardly similar to issue Some Content Type Fields Disappeared?) The field had disappeared from the user's and editor's points of view, and from the admin's content type's Manage fields and Manage displays forms. However, the expected JSON files in the active config folder were present (that's to say field.field.field_xxx and field instance JSONs). In addition, there was data in the database for two of the 625 nodes of this content type. Fortunately, I hadn't started to populate that image field for the remaining nodes.

At the same time, the custom shortcuts on the admin's nav bar disappeared, although I haven't scoped that as they're easy to re-build.

I'm reluctant to start getting images into these nodes until I can better understand causes.

I don't recall doing anything that might have triggered this loss. There was nothing informative that I could see in the log. Any possible pointers, please? (Backdrop 1.27.0.)

Accepted answer

This is very helpful indeed. Thank you. Yes, I clear caches often when working with Backdrop, as with Drupal too. The menu_router table looks fine, not that I can see inside the BLOBs. It seems similarly tidy to the other Backdrop sites I have installed (this being local for the moment).

I'll go the Devel way for the moment and keep an eye out for this happening again.

Very helpful contribution, argiepiano. Thank you.

Comments

What happens if you try to open the UI for that particular field, as in:

 

admin/structure/types/manage/[BUNDLE]/fields/[FIELD_MACHINE_NAME]

Good question! Page not found!

And you are absolutely sure that the files/config_XXX/active folder contains the files 

field.instance.node.BUNDLE.FIELD_NAME.json

for the specific bundle

AND

field.field.FIELD_NAME.json

If so, there may be an issue with your menu_router table - you could try truncating that table and clearing caches to rebuild it. That's kind of dangerous, so you need to make a backup first. 

 

BTW, you won't be able to clear caches from within the site after truncating menu_router. You'll have to use bee

This is very helpful. Thanks. The JSON files you mention were definitely there. This was why I was concerned about there possibly being a deeper problem at play.

Keen to move on, I created a new image field and configured that, leaving the content for the old one orphaned in the dB.

The possibility that there may be an issue with the menu_router table is a good pointer. Thank you. As I'm not familiar with Bee and had hoped to steer clear of command line interactions with Backdrop, I need to evaluate this very carefully. I don't like the idea of losing the ability to clear caches from within the site.

To that end - and before I embrace Bee - any pointers please on how I might spot issues with the menu_router table?

First, have you tried clearing caches in your site before doing anything else? 

One thing you could do is open the menu_router table with PHPMyAdmin (which your hosting provide may provide) and look for the path

admin/structure/types/manage/%/fields/%

HOWEVER, if this path were missing, you would not be able to open ANY field UI. 

Another thing you could try is to rebuild the menus. Install Devel, open the Execute PHP code form, and run menu_rebuild(); 

That will rebuild the menu_router from within the site, which is a lot safer than truncating the table. According to the documentation, "This function will clear and populate the {menu_router} table, add entries to {menu_links} for new router items, and then remove stale items from {menu_links}."

This is very helpful indeed. Thank you. Yes, I clear caches often when working with Backdrop, as with Drupal too. The menu_router table looks fine, not that I can see inside the BLOBs. It seems similarly tidy to the other Backdrop sites I have installed (this being local for the moment).

I'll go the Devel way for the moment and keep an eye out for this happening again.

Very helpful contribution, argiepiano. Thank you.