You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a function CoolUtils::canEdit() which determines if a specific mime type is supported for edit mode in the Collabora editor.
This uses a hard-coded list of read-only mime types.
This information could be extracted from the discovery, but the only place it is called we don't have the discovery.xml. Requesting it as this time would introduce a lag, short of caching it.
Given that this list is the intersection of the set of file types that Drupal recognize as office files and the one we support only as import in COOL, and that it may no change often, this looked like the simplest solution to not offer to edit files Collabora Online doesn't know how to edit.
This information could be extracted from the discovery, but the only place it is called we don't have the discovery.xml. Requesting it as this time would introduce a lag, short of caching it.
Good point.
It happens when we build urls.
Actually we do consider caching the discovery.xml, but have not done it yet. I want to do it in a dedicated PR, because we need to be careful when that cache needs to be cleared / invalidated.
At that point it's a question whether we would be ok with a possible lag on a cold cache first time visit.
Given that this list is the intersection of the set of file types that Drupal recognize as office files and the one we support only as import in COOL, and that it may no change often, this looked like the simplest solution to not offer to edit files Collabora Online doesn't know how to edit.
Alright, going to keep the behavior as is for now.
I wanted to convert this into a service but then it seemed so one-off and arbitrary that I could not think of a good name.
But we can come up with something.
@hfiguiere
There is a function
CoolUtils::canEdit()
which determines if a specific mime type is supported for edit mode in the Collabora editor.This uses a hard-coded list of read-only mime types.
I wonder if this is how it has to be, OR if the same information should be extracted from the discovery.xml.
The text was updated successfully, but these errors were encountered: