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

Fix linked resources interface #2173

Merged
merged 7 commits into from
Apr 18, 2024
Merged

Conversation

jimsafley
Copy link
Member

This is an attempt to fix the linked resources resource page block, specifically the redundant select options and inconsistency between the select menu and the results.

@jimsafley jimsafley requested a review from zerocrates April 4, 2024 16:39
// The shared label is translatable if at least one of the individual
// labels is a property label. A shared label is not translatable if
// all the individual labels are alternate labels.
if (isset($results[$result['property_id']][$label]['label_is_translatable'])) {
Copy link
Member

Choose a reason for hiding this comment

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

I think it might be a little clearer/simpler to do it like this:

if ($labelIsTranslatable) {
   $results[$result['property_id']][$label]['label_is_translatable'] = true;
}

to replace all of what's up here, and then down when building $subjectValueProperties below do

'label_is_translatable' => $data['label_is_translatable'] ?? false,

So you only ever set label_is_translatable to the $results if it's true, then if it's missing (so it was never true for that shared label) you just mark it false when returning. And then you don't have to be checking if the flag is already set for the current label every time through the loop.

@zerocrates zerocrates merged commit 0761ab9 into develop Apr 18, 2024
5 checks passed
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