OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Empty Author Email plugin

The Plugin Gallery is a venue for users of PKP software to share their plugins.

Moderators: jmacgreg, michael, John

Forum rules
If you post a plugin here, please include information on which versions of which applications it is compatible with. Attach a tarball of the plugin (e.g. tar cvzf myPlugin-0.1.tar.gz plugins/generic/myPlugin). Thanks for contributing!

Re: Empty Author Email plugin

Postby armin » Wed May 30, 2012 3:15 am

I have found the following:
the plugin doesn't work as author -
but it works fine as editor !!
So the editor can delete a wrong or faked email-address.
Regards,
Armin.
armin
 
Posts: 2
Joined: Wed May 23, 2012 6:37 am

Re: Empty Author Email plugin

Postby rgillis » Wed May 30, 2012 7:09 am

Ramon:


I tried using the <![CDATA[]]> in the e-mail field as you suggested, but unfortunately it didn't take. Thanks for the suggestion, though.


Roger
rgillis
 
Posts: 13
Joined: Wed Sep 14, 2011 1:09 pm

Re: Empty Author Email plugin

Postby asmecher » Wed May 30, 2012 8:51 am

Hi Roger,

Just a heads-up: that trick will only work when you're using it in an import XML document.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8471
Joined: Wed Aug 10, 2005 12:56 pm

Re: Empty Author Email plugin

Postby rgillis » Wed May 30, 2012 9:55 am

Thanks, Alec.

Actually, I've never had an issue with the XML import. In most of my XML imports, the e-mail field has looked like this:
Code: Select all
<email>none</email>


For every back issue I have imported (15 or so), this field has never caused a problem. The problem that I am experiencing has to do when I have to go back and modify article metadata (in the Editor role) after having imported an issue using the XML import. I go to edit the metadata (most often the abstract or keywords), make the changes, and then an error always occurs, asking me to enter the e-mail address of the author and no longer excepting the "none" value that was originally imported into the metadata. If I want to save the changes that I've made, I'm forced to enter either a fake e-mail address, or look up the author's e-mail address, which can be time-consuming and sometime fruitless, especially when the issue was published quite some time ago and the author has changed e-mail addresses (or didn't have one at the time the article was published).

I was hoping this plugin would resolve the issue, but it doesn't seem to be working for me. Regardless, thanks for your input.
rgillis
 
Posts: 13
Joined: Wed Sep 14, 2011 1:09 pm

Re: Empty Author Email plugin

Postby asmecher » Wed May 30, 2012 12:17 pm

Hi Roger,

The easiest thing for you to do is probably to disable the email validation for authors on the metadata form. Look at classes/submission/form/MetadataForm.inc.php for the line that looks like this:
Code: Select all
$this->addCheck(new FormValidatorArrayCustom($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', create_function('$email, $regExp', 'return String::regexp_match($regExp, $email);'), array(ValidatorEmail::getRegexp()), false, array('email')));
This is the code that adds a check to the metadata form to ensure that author emails are specified and valid. If you change 'required' to 'optional' (OTOH) this should allow you to either specify a valid email, *or* leave the field blank.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8471
Joined: Wed Aug 10, 2005 12:56 pm

Re: Empty Author Email plugin

Postby JasonNugent » Thu May 31, 2012 11:25 am

Hi everyone,

I've been testing the plugin here locally for the last day or so, and I did find an issue that the new version I am attaching to this post addresses. The plugin originally looked at the state of the first author's email address field when determining whether or not to disable the validation check -- it is now agnostic about that. That shouldn't have caused a problem if you were setting all of your author email addresses to blank entries, but I changed it anyway.

I've tested it against 2.3.7 and PHP 5.3 without issue. If you install it and it doesn't work for you I suggest either doing what Alec mentioned above, or else having a look in your 'versions' database table and make sure that there is an entry for it there. If there isn't, then it didn't install correctly for some reason and you might have to create that database record by hand. You'd want to see an entry with 'EmptyAuthorEmailPlugin' in the product_class_name column.

Regards,
Jason
Attachments
emptyAuthorEmail.tar.gz
(1.58 KiB) Downloaded 148 times
JasonNugent
Site Admin
 
Posts: 863
Joined: Tue Jan 10, 2006 6:20 am

Re: Empty Author Email plugin

Postby theodore » Sun Jun 03, 2012 2:18 am

this caused me fatal error in line 22 of the php file.
so, i changed with the following, like previous version:

return Locale::translate('plugins.generic.emptyAuthorEmail.displayName');
instead of return __('plugins.generic.emptyAuthorEmail.displayName');

now no fatal error, but still no works...
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am

Re: Empty Author Email plugin

Postby theodore » Sun Jun 03, 2012 2:40 am

ok, i found it!!!!

the problem for me was that as i can't install it automatically through the ojs plagin form, i just copied the plugin folder via ftp.
this way, did not create any database... but i did know that there should be such entry.
so i now inserted the database manualy.

it works!
(as for the php code, not with return __, but with the older form)

thnx all!
theo

__________________________________________________________________
edit: i now see that by creating teh article, does not permit empty email. it only permits by editing it.
generally, i found this way very troublesome... there isn't a way to just remove the asterisk from the email area?? it can't be so difficult...

i will try alec's option and let you know!

__________________________________________________________________
edit2: this "optional" instead of "required", works just like the plugin. nth special... ok about editing the metadata, buti want to find a normal way to accept empty email by creating the article and remove also the asterisk. no need to be there...
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am

Re: Empty Author Email plugin

Postby Garant » Fri Dec 14, 2012 1:49 am

Hi!
Thank you for you plugin. It really helps
As I remember it has one bug - doesn't work with quickSubmit plugin.
Garant
 
Posts: 212
Joined: Wed May 30, 2012 8:53 am

Previous

Return to Plugin Gallery

Who is online

Users browsing this forum: No registered users and 2 guests