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

Settings for journal managers #31

Merged
merged 52 commits into from
Jul 13, 2022
Merged

Settings for journal managers #31

merged 52 commits into from
Jul 13, 2022

Conversation

radekgomola
Copy link
Contributor

No description provided.

PlagiarismPlugin.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@ctgraham ctgraham left a comment

Choose a reason for hiding this comment

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

Clean read-though, untested.

@ctgraham
Copy link
Collaborator

Resolves #28, improves #23.

Copy link
Collaborator

@ctgraham ctgraham left a comment

Choose a reason for hiding this comment

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

Tested in OJS and OMP 3.3.0. Recommend squash and merge.

@joelfan
Copy link

joelfan commented Jun 27, 2022

Hi there.

We do not understand why configuration file credentials supersede the Radek-settings credentials. At least, this is what we see from the code in this pull request, if we understand well. We would suggest the opposite.

This is exactly what we tried to do with our fork. We have OJS 3.2 and we built a fork starting from plagiarism 1.0.3, and adding radek settings (thank you @radekgomola). You can find the fork here https://github.com/joelfan/plagiarism. As a matter of facts, our fork tries to get credentials from settings first. When not found, the plugin gets credentials from configuration file. By the way, we also added some magic in order to create a user in Ithenticate server, when non existent. We followed Radek instructions, they work like a stream also in OJS 3.2.
We also modified bsobbe adding user management, proxy and php8 support, find it here https://github.com/joelfan/iThenticate.

If there is interest, we can port our fork to plagiarism 1.0.5 (which is for OJS 3.3), having then new bsobbe/ithenticate, user definition when not existent, user management, proxy support, php8 support.

Thx.

@ctgraham
Copy link
Collaborator

ctgraham commented Jun 27, 2022

Hi, @joelfan . The configuration file supersedes the settings form in order to provide flexibility for installations where the administrator is different than the journal manager. For example, consider a hosting provider, where journal staff does not have access to edit the filesystem. This allows for the administrator to choose whether to force specific settings on behalf of the journal, or to allow the journal managers to configure their journal on their own. If the settings form overrides the config.inc.php file, then the administrator loses this option.

We worked on this enhancement at the PKP Sprint in Helsinki, and at that event we looked at your changes to iThenticate with interest. We were unable to find the plagiarism plugin fork, so we were unable to fully evaluate your changes.

We would like to get a better understanding of your proposed changes, but your fork marks the entire files as changed, rather than highlighting just the actual changes. See, for example:
main...joelfan:e00c15c
This is probably due to changing the line endings on the files (carriage return / linefeed pairs).

Could we work together to refactor your changes into clean pull requests, both on the plagiarism repo and on the iThenticate repo? This will help us understand the changes better and will help us know how to incorporate them.

@joelfan
Copy link

joelfan commented Jun 27, 2022

Thank you for your answer and of course we are happy to collaborate. As you might imagine, I am a collegue of bolelligallevi

I am sorry for the fork that is not easily compared as a fork. Maybe the reason is what you wrote (line feed). We are not so familiar with github, if you want you can make a more genuine fork starting from joelfan/plagiarism or please tell me how I should do the fork from asmecher/plagiarism.

Anyway, let me shortly summarize what we have done:

  • forked bsobbe/ithenticate, to add proxy and user management support. By the way, now it is php8 compatible.
  • forked pkp/plagiarism 1.0.3 (we have OJS 3.2) to add credentials in the settings (radek work) and some different logic the allows a user in the settings to be defined when not existent in ithenticate server.

That's the logic at the moment (please consider that at the moment is for plagiarism 1.0.3 because we have ojs 3.2). We have also tested the so-called sharing logic, where everything is submitted by ithenticate administrator and then shared to the user(s) that are defined in the setting. It works, but this option was stopped because there is a limit in the number of folders by a single user in ithenticate, as you know.

We are going anyway to upgrade our production OJS to 3.3 in September or October.

Thank you again and of course keep us udated.

Copy link
Member

@asmecher asmecher left a comment

Choose a reason for hiding this comment

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

Some minor changes suggested!

locale/en_US/locale.po Show resolved Hide resolved
PlagiarismPlugin.inc.php Outdated Show resolved Hide resolved
PlagiarismPlugin.inc.php Show resolved Hide resolved
$managersArray = $managers->toAssociativeArray();
$allUserIds = array_keys($managersArray);
foreach ($allUserIds as $userId) {
$notificationManager->createTrivialNotification($userId, NOTIFICATION_TYPE_ERROR, array('contents' => __('plugins.generic.plagiarism.errorMessage', array('submissionId' => $submissionid, 'errorMessage' => $message))));
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 I heard this raised already -- but I think a trivial notification probably isn't a good fit. It'll cause a toast notification that will go away, possibly before it can be read/digested, and there's no way to get it back. Maybe an email would be better as per e.g. the Paypal plugin? (The likeliest course of action will be that an editor will get an inscrutable error message and pass it on to an administrator of some kind, so maybe it should be going to the tech contact instead of all editors?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. We'd like to migrate these to Tasks instead of Trivial Notifications, but we didn't come up with an example of creating a Task in the Sprint. Error messages should be routed to Journal Managers or Administrators, depending on if the settings come from the form, or from config.inc.php. I could also imagine creating Tasks for Editors in the future as part of the review of the plagiarism check. I'd prefer to take care of this in an enhancement round after an initial merge.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Propose to handle in a new PR.

PlagiarismPlugin.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
PlagiarismSettingsForm.inc.php Outdated Show resolved Hide resolved
* @copydoc Form::execute()
*/
function execute(...$functionArgs) {
$this->_plugin->updateSetting($this->_contextId, 'ithenticate_user', trim($this->getData('ithenticate_user'), "\"\';"), 'string');
Copy link
Member

Choose a reason for hiding this comment

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

Is the trim call necessary? What if the password intentionally begins or ends with a "?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@radekgomola asserted that this was strangely needed. I have a vague memory of encountering and removing this formulation in other plugins.

Copy link
Member

Choose a reason for hiding this comment

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

Hej @radekgomola! Řekni mi co jsi našel.

README.md Show resolved Hide resolved
templates/settingsForm.tpl Outdated Show resolved Hide resolved
@ctgraham
Copy link
Collaborator

@radekgomola , I have a a PR to your repository with a response to most of Alec's review requests.

radekgomola#10

If you can review and merge to radekgomola/plagiarism, and if Alec is satisfied with the adjustments and can merge here, I can take on the following enhancements in new PRs:

  • eliminate the config.inc.php ithenticate setting.
  • converting trivial notifications to tasks.

Update README and settings description
@ctgraham
Copy link
Collaborator

@asmecher , your review comments are largely addressed, save the config.inc.php setting and trivial notification conversion, which I propose to submit as subsequent PRs. Can you take another look?

@asmecher asmecher merged commit e47bc74 into pkp:main Jul 13, 2022
@asmecher
Copy link
Member

Merged, thanks!

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.

4 participants