Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

D8CORE-2529: if there is a link but no content set the link to null #756

Merged
merged 3 commits into from
Sep 22, 2020

Conversation

jenbreese
Copy link
Contributor

READY FOR REVIEW

Summary

  • Remove the link when there is no content but a link is added.

Needed By (Date)

  • 9/24

Urgency

  • medium

Steps to Test

  1. Pull in this change
  2. Test in the developer directory.
  3. Try removing all the json except the link.
  4. Verify there is no empty link
  5. Try undoing it and test with the link and content.
  6. Verify there is a link around the content.

Affected Projects or Products

  • Decanter, SoE, Basic
  • Sites that use the media module.

Associated Issues and/or People

See Also

@sherakama sherakama temporarily deployed to Tugboat September 21, 2020 23:06 Destroyed
Comment on lines 35 to 37
{% if media_link is not empty and media_image_src is empty and media_audio_src is empty and media_video_src is empty %}
{% set media_link = null %}
{%- elseif media_link %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% if media_link is not empty and media_image_src is empty and media_audio_src is empty and media_video_src is empty %}
{% set media_link = null %}
{%- elseif media_link %}
{%- if media_link %}

@sherakama
Copy link
Member

Instead of the else/if statement you can do a check at the top of the template for the required values and set the media_link variable to false if the required data is not provided.

@sherakama sherakama temporarily deployed to Tugboat September 21, 2020 23:34 Destroyed
@sherakama sherakama temporarily deployed to Tugboat September 22, 2020 16:19 Destroyed
@sherakama sherakama merged commit ad570b1 into master Sep 22, 2020
@sherakama sherakama deleted the D8CORE-2529 branch September 22, 2020 16:20
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants