adrianbj / TracyDebugger

The ultimate debugging and development tool for ProcessWire
https://adrianbj.github.io/TracyDebugger/
GNU General Public License v2.0
87 stars 13 forks source link

Deletion warning when adding options to Select Options field #47

Open Toutouwai opened 4 years ago

Toutouwai commented 4 years ago

Not sure why Tracy would affect a Select Options field in this way, but I've noticed that I get a warning about deleting options when I am adding options to a new Select Options field that does not yet have any options.

Screencast:

options

When Tracy is disabled I don't get this notice when adding options.

adrianbj commented 4 years ago

Hi @Toutouwai - I've actually noticed this myself a couple of times lately, but never figured out what was causing it. That said, I can't reproduce now at all, so not sure where to start at the moment.

My hunch is that it might be related to the RequestInfo panel getting the field's settings - does the problem go away with that panel disabled?

Toutouwai commented 4 years ago

Yes, it does seem to be the RequestInfo panel that's involved.

adrianbj commented 4 years ago

OK, so I sort of have it narrowed down.

Strangely it doesn't happen on my local dev the same way - instead the redirect version of the RequestInfo panel returns an error, but on the remote servers I tested, I get the same result as you.

The initial trigger is that panel's call to $field->getExportData(). I have traced it through to the Select Options field's attempt to populate $deletedOptionIDs

I feel like this is something that Ryan needs to fix in either the core getExportData() method, or some of the logic in the Select Options field around when to display the field deletion dialog.

Any thoughts before I post an issue for him?

Toutouwai commented 4 years ago

Great that you've been able to track down the cause.

I can't think why exporting the config of a Select Options field should cause the deletion warning so it does sound like an issue Ryan should look at.

Thanks.

adrianbj commented 4 years ago

Thanks @Toutouwai - submitted new issue for Ryan here: https://github.com/processwire/processwire-issues/issues/1097

Sorry for stealing your screencast :)