Diego
February 1, 2019, 2:43pm
22
HI! @vvucic , @asmecher , @anupent
I’m trying to add the ORCID field as required.
My OJS version is 3.1.1-4.
In the AuthorForm.inc.php file I made the following change
$this->addCheck(new FormValidatorORCID($this, ‘orcid’, ‘required’, ‘user.orcid.orcidRequired’));
In the authorForm.tpl file I added the line
orcidRequired=true
And in the userDetails.tpl file I added the two parts
Fist.
{if $orcidRequired}
{assign var=“orcidRequired” value=true}
{else}
{assign var=“orcidRequired” value=false}
{/if}
Second
{fbvElement type=“text” label=“user.orcid” name=“orcid” id=“orcid” required=$orcidRequired value=$orcid maxlength=“37” inline=true size=$fbvStyles.size.SMALL}
Even so the field did not become mandatory. What am I doing wrong?
Hi @Diego ,
I would suggest working backward from the required=...
attribute to fbvElement
to see where it stops working. I don’t see any problems in what you’ve posted, so suspect it’s probably where you’re assigning orcidRequired
to the template.
Regards,
Alec Smecher
Public Knowledge Project Team
Diego
February 1, 2019, 7:40pm
24
@asmecher I was able to solve it after your tip.
We have two options to solve.
Denying the variable
{if !$OrcidRequired }
{assign var = “orcidRequired” value = true}
{else}
{assign var = “orcidRequired” value = false}
{/ if}
or else
changing the order of conditions
{if $orcidRequired}
{assign var = “orcidRequired” value = false }
{else}
{assign var = “orcidRequired” value = true }
{/ if}
Thank you very much
Hi @asmecher and @anupent ,
How can I make affiliation/ORCID mandatory only for the corresponding author and not for all?
Best,