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

Multiple author affiliations #10460

Open
wants to merge 136 commits into
base: main
Choose a base branch
from

Conversation

GaziYucel and others added 30 commits September 20, 2024 14:33
classes/author/Author.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@bozana bozana left a comment

Choose a reason for hiding this comment

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

Hi @GaziYucel, thanks a lot for the good work and improvements!
I left a few comments.
I believe, that having the ROR object in an affiliation would make it easier to deal with names in different locales, e.g. we will not need to worry about setting ROR default name to the affiliation name with the submission locale, and also getting getLocalizedAffiliations... should be easier. I am only not sure how that would work with the ui-library... Let me know what do you think...

@@ -182,7 +182,7 @@ public function initData()
$data = [
'givenName' => $author->getGivenName(null), // Localized
'familyName' => $author->getFamilyName(null), // Localized
'affiliation' => $author->getAffiliation(null), // Localized
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm... This file is used in the quickSubmit plugin. I do not think we can use the new affiliationField UI component there :-( I/we need to think how to solve it best...

@@ -225,7 +225,7 @@ public function execute(...$functionParams)
$author->setGivenName(array_map('trim', $this->getData('givenName')), null);
$author->setFamilyName($this->getData('familyName'), null);
$author->setPreferredPublicName($this->getData('preferredPublicName'), null);
$author->setAffiliation($this->getData('affiliation'), null); // localized
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note for myself: For this file as well. It is only used in quickSubmit plugin and we need to see how to solve the new affiliations there for 3.5

@GaziYucel
Copy link
Contributor Author

Hi @bozana,

I made a change in the database for rors/ror_settings.

I have made more performance tests on my shared hosting. Not sure if my hoster did some downgrades in my hosting, but I found it less performant as my tests before for lookups of rors through the UI. This is due to several sql "like" lookups in rors.ror / ror_settings.setting_value.

I added an extra column to rors, namely "search_phrase", where I concatenate the ROR iD (without https://ror.org/) and names during the import. The lookup is now done through a single like only on this column.
With this change, I see a performance bump of 3 - 4 times (before 1,5s > after 0.2 - 0.5ms). The other side of the coin is that the table rors have grown from 20 to 30 MB.

/**
* Get cleaned name, e.g. remove NO_LANG_CODE, set required locale
*/
public function getNameCleaned(?string $requiredLocale = null): mixed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this method to return the names with 'no_lang_code' cleaned. This is used in Affiliation::fromRow. I find this cleaner than mixing this in Affiliation Object.

@bozana
Copy link
Collaborator

bozana commented Jan 13, 2025

@asmecher, if I make ask you about that performance issue @GaziYucel mentions above -- what would be a good way to proceed/test/solve... ?
Thanks a lot!

@asmecher
Copy link
Member

@bozana and @GaziYucel, would a partial index on the setting_value solve the problem? I'd prefer this if it's feasible, as it doesn't require us to duplicate the data. We use this approach with publication_settings e.g. so that titles can be searchable.

https://github.com/pkp/pkp-lib/blob/c5ebc057b122ca01fa174e156734fdc7ae1dcb91/classes/migration/install/SubmissionsMigration.php#L90..L96

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.

5 participants