OJS - Global Search

Is there any way to insert a form for a global search? When I try to search with no journal selected I received the error:

Open Journal Systems
\##user.authorization.journalDoesNotPublish##

I’m using pt_BR locate.

Hi @arturluizbr,

What version of OJS are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

I’m using master branch.

Hi @arturluizbr,

Unfortunately we can’t provide much support for the master branch until it reaches beta or perhaps final 3.0 release levels; it’ll be unstable until then.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

There is still the same problem with the released OJS3.

OJS2 used to have a search link on the site level which opened a form enabling to do a search in all journals of the site.

Now we do not have that link anymore and if you try domain.fi/index/search, you get the error mentioned in the first post: user.authorization.journalDoesNotPublish

So, are there any plans to provide a site level search like the one in OJS2?

Hi @asmecher,

I looked into this issue and the error message comes from

Basically the search page demands a context and getContext does not return anything on site level. Now, I do not know what is a good solution here, but I did this in function OjsJournalMustPublishPolicy:

parent::AuthorizationPolicy(‘user.authorization.journalDoesNotPublish’);
$context = $request->getContext();
if (is_a($context, ‘Context’)) {
$this->_context = $context;
} else {
$this->_context = $request->getSite();
}

This works, meaning that domain.fi/index/search will open and also works returning global search results from the site.

However, does this create problems elsewhere?

The second thing with the global search is that now there is no journal path in templates/frontend/objects/article_summary.tpl, so even though I get global results, the article path does not work.

I was thinking that you could add {assign var=journalPath value=$article->getContextId()} and the use that ID to get the actual journal path, but is there some easier way?

1 Like

Hi all,

I’ve filed this for consideration in our github issues tracker.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

In version 3.0.2.0 the following error is still encountered when performing a search: ## user.authorization.journalDoesNotPublish ##

But when you access a magazine, the search works perfectly.

Hi @robertogbfilho,

The issue linked above is filed against OJS 3.1, meaning the fix/change will be released in that version.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello there,

We never used OJS before, so we made a fresh install on OSJ (Version 3.1.0.0 (october 31, 2017 - 11:10 ). And I cannot find a way to make avaiable a global search across all journals. This is not a ‘native’ feature configurable in the front-end?

Thanks for your consideration,

Att

Hi @hugobci,

If your OJS URL is http://my-site.com/ojs/index.php/myJournal, where myJournal is one of your journals, you should see a site-wide listing of all journals at http://my-site.com/ojs/index.php/index. If you add /search to the end, i.e. http://my-site.com/ojs/index.php/index/search, you should see a site-wide search form.

Regards,
Alec Smecher
Public Knowledge Project Team

3 Likes

Hi! Thankyou, this worked very well!
http://periodicos.ufabc.edu.br/index.php/index/search
Can you point me to how-to add this search to front page of the periodicals portal? Maybe this is something relate to theme?