pkp / authorRequirements

A plugin for OJS
GNU General Public License v3.0
4 stars 8 forks source link

email is still compulsory in quicksubmit in ojs 3.4 #14

Open SupremeDimeji opened 9 months ago

SupremeDimeji commented 9 months ago

The email field is still compulsory when adding contributors through the quicksubmit plugin in ojs 3.4.0.3.

ewhanson commented 9 months ago

Hi @SupremeDimeji, thanks for noticing this. It looks like the QuickSubmit plugin uses the old version of the author/contributor form. I'll look into adding support for that back into the plugin.

mpbraendle commented 1 month ago

To add up: It is not only so for QuickSubmit, but also the standard submission process.

We get the following problems:

During the submission workflow, when a contributor is being added: [Tue Jul 16 23:12:55.355724 2024] [proxy_fcgi:error] [pid 1571494:tid 1571494] [client 83.76.22.66:57301] AH01071: Got error 'PHP message: Slim Application Error:\nType: Illuminate\Database\QueryException\nCode: 23000\nMessage: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null (SQL: insert into authors (email, include_in_browse, publication_id, seq, user_group_id) values (?, 1, 7400, 0, 14))\nFile: /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php\nLine: 760\nTrace: #0 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\Database\Connection->runQueryCallback()\n#1 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(546): Illuminate\Database\Connection->run()\n#2 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(498): Illuminate\Database\Connection->statement()\n#3 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/...', referer: https://www.chimia.ch/chimia/submission?id=7378

When the column email in the database is set to nullable, there is a follow-up error in a vendor library:

Got error 'PHP message: Slim Application Error:\nType: TypeError\nMessage: Symfony\Component\Mime\Address::construct(): Argument #1 ($address) must be of type string, null given, called in /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Message.php on line 244\nFile: /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/symfony/mime/Address.php\nLine: 42\nTrace: #0 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Message.php(244): Symfony\Component\Mime\Address->construct()\n#1 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Message.php(108): Illuminate\Mail\Message->addAddresses()\n#2 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(401): Illuminate\Mail\Message->to()\n#3 /var/www/virtual/ojs.chimia.ch/htdocs/ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(206): Illum...', referer: ...

So, the OJS 3.4 version of this plugin is not usable and even hampering the submission workflow. We had to disable it.

ewhanson commented 1 month ago

Hi @mpbraendle, thanks for sharing the error messages. I was unable to reproduce it locally even though it seems like I should be receiving the same error. The email column is successfully being set to null even though it looks like the table schema should have it as not null. Could you share which database/database version, PHP version, exact OJS version you're using? Thanks.

mpbraendle commented 1 month ago

Hi @ewhanson

OJS 3.4.0-5 PHP 8.0.30 MariaDB Server 10.6.17

I think, the problem is the check in the Laravel library Message.php that checks for all types of mail format errors.

ewhanson commented 1 month ago

Thanks @mpbraendle. When you run into the issue with the Laravel library class you mention and you talk about the email column being nullable, are you referring to this validation rule from the plugin:

https://github.com/pkp/authorRequirements/blob/cc40307dd99817a36a14b7f4ad4e7552fd46cd4b/AuthorRequirementsPlugin.php#L96

or have you manually set the column to be nullable in the database?

mpbraendle commented 1 month ago

For testing, I had set the database column temporarily to nullable.

This allowed to create the contributor record, however, then the Laravel Message.php complains. Also, when an empty string "" or '' is saved, the Laravel Message.php complains.

ewhanson commented 1 month ago

Hi @mpbraendle, thanks for sharing the additonal details. I have yet to be able to reproduce either the email still being required as part of the regular submission workflow or or the Laravel-related error you described. I've tried using the exact versions of OJS/mariadb you've described and still haven't been able to reproduce it.

Do you have any settings or options set up for mariadb that might be stricter than normal? That is the best guess I have at the moment unfortunately.

Edit: I don't recall the exact patch version, but I've tested it with PHP 8.0 and PHP 8.2 as well.