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

[PKP-LIB][stable-3_4_0] #11011 Fix title assignment functionality #11139

Open
wants to merge 2 commits into
base: stable-3_4_0
Choose a base branch
from

Conversation

defstat
Copy link
Contributor

@defstat defstat commented Mar 19, 2025

No description provided.

$newTitles = [];

// Get the explicitely provided user titles
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Get the explicitely provided user titles
// Get the explicitly provided user titles

$newTitles[$locale] = null;
continue;
}

$newTitles[$locale] = $inputTitle;
// Check if there is a display title for the NMI. If not for this locale, explicitely define one
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Check if there is a display title for the NMI. If not for this locale, explicitely define one
// Check if there is a display title for the NMI and the given locale. If not, explicitly define one

Comment on lines +212 to +220
if (!isset($originalDisplayTitles[$locale])) {
$newTitles[$locale] = $trimmedTitle;
continue;
}

// Update title if explicitly defined or changed from default
if (isset($localizedTitlesFromDB[$locale]) || $originalDisplayTitles[$locale] !== $trimmedTitle) {
$newTitles[$locale] = $trimmedTitle;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be left as:

Suggested change
if (!isset($originalDisplayTitles[$locale])) {
$newTitles[$locale] = $trimmedTitle;
continue;
}
// Update title if explicitly defined or changed from default
if (isset($localizedTitlesFromDB[$locale]) || $originalDisplayTitles[$locale] !== $trimmedTitle) {
$newTitles[$locale] = $trimmedTitle;
}
// Update title if explicitly defined or changed from default
if (isset($localizedTitlesFromDB[$locale]) || ($originalDisplayTitles[$locale] ?? null) !== $trimmedTitle) {
$newTitles[$locale] = $trimmedTitle;
}

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