-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1523] Get supported formats extensions dynamically #1524
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please add a unit test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changes are warranted as we’re making assumptions about the file extensions inside a template file and I think it’d be better suited to put this logic inside the GP_Format
class. We could introduce a new function like get_acceptable_file_extension()
Should I add it to |
Yes, I think it'd be a good place. |
So you suggest a new |
With the exception of this list of extensions used in this PR where only the last part of the extension counts for the browser to look up, I don't see much of a use for a new method that uses the output of A different option would be adding a function to |
@akirk here's an example of what I have in mind: A
The multiple extensions like Would this make sense to add to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
misc.php
is a reasonable place since other functions also operate on GP::$formats
there.
What?
Dynamically generate the supported formats file extensions for file imports.
Why?
If a plugin adds a new file format, dynamically get all the available extensions.
How?
Use the set Formats.
Testing Instructions
Go to the project import dialog and click the button to upload.
Fix #1523