$article->getLocalizedData('abstract') OJS 3.3.0-13

Hello.

In OJS 3.2, I used

        {if $article->getLocalizedData('abstract')}

In article_summary.tpl

But now, in OJS 3.3.0-13, $article->getLocalizedData(‘abstract’) is NULL.

Which would be the replacement? Thanks

Hi @juanito

What you probably want to do now is:

$publication = $article->getCurrentPublication(); $publication->getLocalizedData('abstract')

Because metadata is now stored at the Publication level. That’s a change that has been in place since 3.2 though so I am not sure why you haven’t run into this before.

Best
Jason

1 Like

Thank you very much @jnugent

I did, in tpl
{$article->getCurrentPublication()->getLocalizedData('abstract')|@print_r}

When an article hasn’t abstract i obtain two different results
1
or
Array ( [es_ES] => ) 1

I obtain 1 when is an old article and i have 're’saved in ojs 3.3.0-13
I obtain Array ( [es_ES] => ) 1 when is an old article and i haven’t 're’saved in ojs 3.3.0-13

I need do something like this:
{if $article->getCurrentPublication()->getLocalizedData('abstract')}

But abstract is always no null.

edited
I used this solution not clean

{$publication = $article->getCurrentPublication()}
{if  $publication->getLocalizedData('abstract')|count_characters != NULL}

Thanks Jason.