Why do you need to change the formats widget type from checkboxes to radios?

Created on 18 September 2018, over 6 years ago
Updated 21 December 2024, about 2 months ago

First of all, thanks for a great module!
I am developing KML/KMZ export and I decided to just add two encoders to the existing infrastructure and not create yet another superfluous display type plugin. Ideally, my encoders are supposed to work from both REST export and Views data export and potentially any other export display plugin inherited from either.
I almost got it running but I encountered an unusual problem with Views data export.
For some reason Views data export changes the widget type for "formats" in Views UI from the REST export's default checkboxes (allowing multiple formats to be selected for a single display) to radios, offering the following explanation:

        // Change format to radios instead, since multiple formats here do not
        // make sense as they do for REST exports.

Well, for my use case multiple formats totally make sense because kmz is basically zipped kml, and I was planning to use the same views display for both with the kmz encoder simply zipping the file before sending it to the client.
I tried to revert the widget type change in my own module hook and it seems to work, but it turns out that your submitOptionsForm() then botches the save and I can see no way of suppressing it or overriding it without creating my own display type plugin which I am trying to avoid.
So the questions are:
1. Could you please clarify why exactly "multiple formats here do not make sense"? As it looks to me, the module here goes to some lengths to REMOVE existing functionality (multiple formats) for no clear reason, but of course I might be missing something.
2. Could you suggest a way of overriding your module's submitOptionsForm() method from my module without changing your module code? I could just patch your module but that would mean yet anothert patch to maintain forever and a problem with releasing my own module to the community when it's ready.
Of course, I can use the core REST export but I like your module's additional functionality like suggesting a tokenized file name for download and attachability to other displays, so that would be a loss.

💬 Support request
Status

Fixed

Component

Code

Created by

🇷🇺Russia marassa Moscow

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024