-
Notifications
You must be signed in to change notification settings - Fork 44
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
[FINNA-1545] Show all component parts' original languages #3134
base: dev
Are you sure you want to change the base?
Conversation
foreach ($this->stripTrailingPunctuation($this->getFieldArray('979', ['i'])) as $lang) { | ||
$result[] = $lang; | ||
foreach ($this->stripTrailingPunctuation($this->getFieldArray('979', ['h', 'i'])) as $lang) { | ||
$lang = explode(' ', $lang) ?? $lang; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explode:n tulos ei voi olla null, vaan se on aina array.
foreach ($this->stripTrailingPunctuation($this->getFieldArray('979', ['h', 'i'])) as $lang) { | ||
$lang = explode(' ', $lang) ?? $lang; | ||
if (is_array($lang)) { | ||
foreach ($lang as $lng) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Käytä array_merge
:ä tai spread operatoria luupin sijaan.
@@ -2652,8 +2652,9 @@ public function getOriginalLanguages() | |||
$result[] = $this->stripTrailingPunctuation($this->getSubfield($field, 'h')) ?? ''; | |||
} | |||
} | |||
foreach ($this->stripTrailingPunctuation($this->getFieldArray('979', ['i'])) as $lang) { | |||
$result[] = $lang; | |||
foreach ($this->stripTrailingPunctuation($this->getFieldArray('979', ['h', 'i'])) as $lang) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vasta nyt tuli mieleen, että kannattaa antaa getFieldArray:lle concat-parametriksi false, niin se ei yhdistä osakenttiä, eikä tartte explodea.
No description provided.