verbb / field-manager

Field Manager is a Craft CMS plugin to make it easy to manage your fields and field groups.
MIT License
199 stars 16 forks source link

"unused" indicator is completely inaccurate #87

Closed darylknight closed 1 year ago

darylknight commented 2 years ago

Describe the bug

The admin/field-manager section is showing 99% of my fields as unused.

Here's the listing: image

And here's a page that is using some of those fields: image

Steps to reproduce

  1. Open the field manager

Craft CMS version

4.2.2

Plugin version

3.0.2

Multi-site?

No

Additional context

I've just installed the plugin, not upgraded from Craft 3

engram-design commented 2 years ago

Strange, I can't replicate that on my end whatsoever. The logic for this is pretty simple too where so long as a field exists in the fieldlayoutfields table (as in, it's been added to a field layout somewhere) then it's "used".

darylknight commented 1 year ago

Anything I can do to help troubleshoot this? It's still happening. Some fields correctly say they're used, but lots of them I know are in use and are reported as Unused

engram-design commented 1 year ago

Hmmm, short of sending through your database (which you're most welcome to, if you can to web at verbb.io), I'm not sure.

For the ones that say they've been marked as unused, but you know they are - are they in Neo, Vizy/etc fields, or just in sections? Wondering if you can provide an example where we can track it all the way through your install, and cross-reference against the database with field layouts, in case I'm missing something obvious.

darylknight commented 1 year ago

Fun fact - this has just randomly stopped happening and everything is fine again. Weird! Thanks Josh - I'll ping you again if I can replicate. No idea why it wasn't / was working...

image

tomkiss commented 1 year ago

This is happening for me, i have 60 odd fields and all but 2 or 3 are saying unused.

This happened immediately after a Craft 4 upgrade. Have tried uninstalling and reinstalling, clearing caches - made no difference.

Very odd. Happy to send over a database dump if its helpful.

engram-design commented 1 year ago

That's pretty odd indeed! If you're able to shoot a database to support@verbb.io we can take a look at what's going on...

engram-design commented 1 year ago

Thanks for the export! It looks like this is due to your craft_fieldlayoutfields database table being out of date, compared to the serialized field layout element data that is in craft_fieldlayouttabs. That's why for entry types the fields are in there, but Field Manager will use the former database tables to look up against fields.

Re-saving your entry types and sections kick this into gear.