Merge branch 'maint-1.0'

* maint-1.0:
  BibUpload: FFT regression tests not to use CDS
  BibCirculation: fix regexp for dictionary checking
  BibCirculation: security check before eval
  WebStyle: fix implementation of req.get_hostname
  bibdocfile: fix documentation WRT --with-version
  BibEdit: fix crash in Ajax request
  WebSubmit: fix handling of uploaded files
  WebAccess: fix Access policy page
  BibSched: fix guess_apache_process_user_from_ps
  bibdocfile: fix parsing of complex subformats
  bibdocfile: add missing normalize_format() calls
  bibdocfile: fix cli_set_batch function
  WebAccess: fix FireRole handling integer uid
  bibdocfile: fix append WRT description/restriction
  intbitset: fix several memory leaks
  intbitset: fix never ending loop in __repr__
  bibdocfile: fix handling of embargo firerole rule
bibdocfile: check_bibdoc_authorization caseless

* check_bibdoc_authorization will now retrieve the type of
  restriction in a caseless way, so that "Role: ", "role: ", "ROLE:"
  are all "role" types of restriction. (closes #452)
Merge branch 'maint-1.0'

* maint-1.0:
  bibdocfile: check_bibdoc_authorization caseless
WebSession: improve session handling

* Do not save the session in case it does not have a session
  id (e.g. during regression tests).

* Do not create a session if not within a real HTTP request.
BibRank: make numpy optional

* If numpy is not installed, the execution of citerank methods
  will not crash, but only print a message informing the admin
  about the missing import. (closes #478)

* Also, the citerank tests will not run if numpy is not installed.
WebAccess: fix retrieving emails from firerole

* Fix acc_get_authorize_emails() to return the email list instead of
  an empty set.

* Fix acc_firerole_extract_emails() to return the egroup email address
  also.
BatchUploader: fix retrieval of recs from extoaiid

* Does necessary corrections in order to treat the result of
  find_records_from_extoaiid() as an intbitset and not a recid.
  (closes #621)
WebSubmit: fix record_search_pattern in DEMOJRN

* The check on the report number format introduced as an example in
  DEMOJRN was using a variable stored locally, that was not available
  when calling the MBI submission via a direct link; this is why
  it is changed to a check that does not require this variable.
  (closes #599)
WebAlert: fix the display of records in alerts

* In order to display the records in alerts, the CFG_SITE_NAME will
  be used as collection name, in case no better guessing of the
  collection of a record was possible.
WebSearch: fix get_fieldvalues() when recid is str

* recid might be string, so try to convert it to int in the get_fieldvalues
  function (needed for WebSubmit, major user of this function, which calls it
  in many different places with a string argument instead of int).

* Add test case to be sure that we do not remove this conversion
  in the future.
WebSearch: fix get_index_id_from_field()

* Returns 'global' index not only when input field is empty string,
  but also when field is None.
Merge branch 'maint-1.0'

* maint-1.0:
  WebSearch: fix get_index_id_from_field()
  WebSearch: fix get_fieldvalues() when recid is str
  WebAlert: fix the display of records in alerts
  WebSubmit: fix record_search_pattern in DEMOJRN
  BatchUploader: fix retrieval of recs from extoaiid
  WebAccess: fix retrieving emails from firerole
  BibRank: make numpy optional
BibIndex: fix Porter stemmer in multithread

* When PyStemmer was not installed, the global _stemmers
  dictionary was wrongly initialized thus causing stemming
  to be unavailable during WSGI request (while being
  available during indexing time). This is now fixed.

Co-authored-by: Ludmila Marian <ludmila.marian@gmail.com>
Merge branch 'maint-1.0'

* maint-1.0:
  BibIndex: fix Porter stemmer in multithread
WebSearch: fix case-insensitive collection search

* Before checking if a record is in the reclist of a collection,
  check if the collection actually exists and normalise its
  name from case-insensitive to case-sensitive.

* When trying to guess the collection of a record from the
  referer URL, test if this referer comes from the same Invenio
  installation, since URLs are similar in different installations.
WebBasket: fix missing return statement

* Add missing return statement to tmpl_public_basket_content when
  output format is not 'hb' or 'xm'.
WebBasket: fix number of items in public baskets

Co-authored-by: Nikolaos Kasioumis <nikolaos.kasioumis@cern.ch>
BibEdit: fix undefined dictionary key

* Fix missing clonedRecord key from data dictionary.
BibRecord: fix for record_get_field_instances()

* Fix record_get_field_instances() when record is None.
Merge branch 'maint-1.0'

* maint-1.0:
  BibRecord: fix for record_get_field_instances()
  BibEdit: fix undefined dictionary key
  WebBasket: fix number of items in public baskets
  WebBasket: fix missing return statement
  WebSearch: fix case-insensitive collection search