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
For a media created by file upload, or URL (and probably others) there will always be a "source", so the $default parameter will never be used for those media.
Shouldn't the source be used only if $default === null ?
The text was updated successfully, but these errors were encountered:
The idea here is to have "untitled" or similar only show up when we have nothing to use. Most uploaded files don't get given titles manually, so the fallback to the source gets used a lot, but we still want to pass a default so there's text like "[Untitled]" for those media that have no title and no source.
I'm probably missing something, but couldn't it be achieved by something like this:
$media->displayTitle( $media->source() )
as displayTitle returns "[Untitled]" when there is no title and $default === null
My use case is I want to display the "display title" (that is dcterms:title or the title property defined in the resource template) and if it doesn't exist I want something else than the source. I never want to display the source.
Is there a way to do this without duplicating the code of AbstractResourceEntityRepresentation::displayTitle ?
Not sure if it's a bug. I'm talking about this method:
omeka-s/application/src/Api/Representation/MediaRepresentation.php
Lines 305 to 313 in 7680b56
For a media created by file upload, or URL (and probably others) there will always be a "source", so the
$default
parameter will never be used for those media.Shouldn't the source be used only if
$default === null
?The text was updated successfully, but these errors were encountered: