TracyDebugger icon indicating copy to clipboard operation
TracyDebugger copied to clipboard

Deletion warning when adding options to Select Options field

Open Toutouwai opened this issue 5 years ago • 5 comments

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.

Toutouwai avatar Feb 24 '20 04:02 Toutouwai

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?

adrianbj avatar Feb 24 '20 05:02 adrianbj

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

Toutouwai avatar Feb 24 '20 06:02 Toutouwai

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?

adrianbj avatar Feb 24 '20 17:02 adrianbj

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.

Toutouwai avatar Feb 24 '20 20:02 Toutouwai

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

Sorry for stealing your screencast :)

adrianbj avatar Feb 24 '20 20:02 adrianbj