-
Notifications
You must be signed in to change notification settings - Fork 19
Prefer file description field for document link text if set and available #878
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
Prefer file description field for document link text if set and available #878
Conversation
|
I've had a quick look at this - we don't need to get the description and set it as the title if the option's checked, as it's already been done by this point in the request. If use_description_as_link_text is set, returning early and not doing anything else should be enough. |
|
@rupertj thanks for having a look. use_description_as_link_text is probably true for almost every site since it has been in the default configuration, regardless of whether they have the description field or not to fill out. We do need to also see if the description is present. But maybe we can then return if it is. |
|
Some weirdness in that we only modified localgov_base but CKEditor doesn't render the description for its label as expected when the field settings for the file description are active. The default media mode being a responsive image size doesn't make sense for files - should be 'default' instead. |
|
I've tested this in H&F's site where the bug showed up and it's working well for me. I've also exposed the media name field on it and disabled the option to use the file's description and it's showing the media name for media where I've set it. There's a few spots where I think the code could be simpler and easier to follow, so I'll start a review. In general though, I'd be happy for this to be merged as-is once the tests pass. |
Based on Ru's comment, let's merge this and refactor code later if needed! Hope that's OK @rupertj :) |
Closes #871
Continutes work to render the document files for the case where configuration provided in Drupal Core and known to be used on LGD sites prefers the description field to be used for the document link.
Requires code review.
Requires robust functional testing of the display in localgov_base of:
Document media configured to use name field
Document media configured to use description field
Document media with no name or description field
Drupal file upload fields
Webform file uploads
Intended logic
Use description if " use_description_as_link_text " is set in document media manage display and description field has value.
Otherwise
Use name field with fall backs as before