Skip to content
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

TMS-1034: Add default text for articles related content title #508

Merged
merged 2 commits into from
May 13, 2024
Merged

Conversation

eebbi
Copy link
Contributor

@eebbi eebbi commented May 8, 2024

Severa-ID: 2247
Severa-kuvaus: TMS-1034 Drupalista tulevista uutisista puuttuu Liittyvät sisällöt -otsikko
Task: https://hiondigital.atlassian.net/browse/TMS-1034

Description

Add default text to related content -section if the field has no value

Motivation and Context

Articles have a "related_title" field, that has the same default-value as this added text, but for the imported news that field never updates its value, which is why this change is needed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@eebbi eebbi requested a review from a team May 10, 2024 06:58
@HPiirainen HPiirainen self-assigned this May 13, 2024
Copy link
Contributor

@HPiirainen HPiirainen left a comment

Choose a reason for hiding this comment

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

Ok, tsekkaa vielä huomio

@@ -158,7 +158,7 @@ public function related() : ?array {
);

return [
'title' => get_field( 'related_title' ) ?? '',
'title' => get_field( 'related_title' ) ?? __( 'Related posts', 'tms-theme-base' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Tässä kannattaa muistaa, että jos get_field palauttaa esim. false tai tyhjän stringin, niin tuo fallback ei tule voimaan. Se asetetaan vain, jos get_field palauttaa nullin.

@eebbi eebbi merged commit aa8a50d into master May 13, 2024
1 of 2 checks passed
@eebbi eebbi deleted the TMS-1034 branch May 13, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants