Commit Graph

45163 Commits

Author SHA1 Message Date
Jonathan Druart 8a9fb4541b Update release notes for 21.11.26 release 2023-12-01 08:09:54 +01:00
Jonathan Druart 4ce9cb139d Increment version for 21.11.26 release
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 08:06:46 +01:00
Jonathan Druart 7230998035 [21.11] Fix xt/find-misplaced-executables.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:36:22 +01:00
Owen Leonard 2ec3649dc8 Bug 35290: (follow-up) Perltidy formatting corrections
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: fix shebang indent line

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:27:04 +01:00
David Cook 1c26397b43 Bug 35290: Sanitize field input on cataloguing/ysearch.pl
This change sanitizies the field input on cataloguing/ysearch.pl

Test plan:
0. Apply the patch and restart/reload Koha
1a. "Add marc21_field_260b.pl plugin to 260$b in the Default framework"
1b. Go to http://localhost:8081/cgi-bin/koha/admin/marc_subfields_structure.pl?
op=add_form&tagfield=260&frameworkcode=#subbfield
1c. Choose "marc21_field_260b.pl" from the dropdown next to "Plugin"
1d. Click "Save changes"
2a. "Add new record"
2b. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=
3. Click on tab "2" and scroll down to 260 "b"
4. Type in "Ori" into 260 subfield b
5. Some autocomplete suggestions should appear

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:26:49 +01:00
Aleisha Amohia 44f1d8cc74 Bug 35291: (QA follow-up) Tidying script for QA test tools
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:05:40 +01:00
David Cook 38f0f4f5b6 Bug 35291: Validate filepaths in linking files
Validate that the files in linking files are contained within the ZIP.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:05:35 +01:00
David Cook d0ca53764a Bug 35291: Don't allow symlinks for link files in cover image ZIP
There's no reason to allow symlinks for link files in cover image
ZIP files. Preventing their use prevents someone from uploading
a symlink pointing to an existing file on the Koha server.

Test plan:
0. Apply patch and restart/reload Koha
1. Create a PNG cover image
2. Create a datalink.txt file that contains something like the
following:
29,Untitled.PNG
3. Turn on "LocalCoverImages" system preference
4. Upload via http://localhost:8081/cgi-bin/koha/tools/upload-cover-image.pl
5. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Note the cover image has been uploaded

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:05:08 +01:00
Jonathan Druart 3525f0bf68 Bug 35291: Prevent leaks from FS
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-12-01 07:05:08 +01:00
Mason James 4451023126 Bug 35174: update control files for koha-l10n dependency package
to test...

 - apply patch
 - build koha-common package
 - install koha-common package, and confirm koha-l10n package is installed
2023-11-22 09:52:02 +01:00
Jonathan Druart 33a3c1cd0c Bug 35174: Don't run gulp po commands if po dir is missing
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-22 09:52:02 +01:00
Jonathan Druart ceccf6e62e Bug 35174: Add misc/translator/po to .gitignore
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-22 09:51:57 +01:00
Jonathan Druart cb36dbb26e Bug 35174: Add a warning to the about page
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-22 09:51:40 +01:00
Jonathan Druart 23b61845f3 Bug 35174: Do not explode if po dir does not exist
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-22 09:50:14 +01:00
Koha translators a1610d29c9 Bug 35174: Remove .po files from Koha 2023-11-22 09:43:20 +01:00
Danyon Sewell d8d5724c17 Fix translations for Koha 21.11.25
Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
2023-11-16 14:21:48 +13:00
Danyon Sewell 2169f4003e Revert "Fix translations for Koha 21.11.25"
This reverts commit 4945422d32.
2023-11-16 13:55:25 +13:00
Danyon Sewell a69e9b74c3 Revert "Revert "Update release notes for 21.11.25 release""
This reverts commit e7ac7ea2c3.
2023-11-16 13:54:10 +13:00
Danyon Sewell e7ac7ea2c3 Revert "Update release notes for 21.11.25 release"
This reverts commit 1f8cf02020.
reverting as additional changes were added to this commit that shouldn't
be there
2023-11-16 13:39:15 +13:00
Jonathan Druart 27c257e82b Bug 35103: Add option to gulp tasks to pass a list of tasks
You can now generate the messages.po for all languages with:
  gulp po:update --task messages

or for only es-ES
  gulp po:update --task messages --lang es-ES

It may be helpful for the "update po" script that will be used on
weblate.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-14 15:30:21 +01:00
Bernardo Gonzalez Kriegel e381372944 Bug 30476: Remove NORMARC translation files
This patch just deletes translation files left behind when removing
support for NORMARC.

To test:
1) Apply the patch
2) Verify there are no more *-marc-NORMARC.po files
   on misc/translator/po/ dir

No consequences are expected.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-11-08 15:37:11 +01:00
Bernardo Gonzalez Kriegel 3bb452eb73 Bug 30373: Enable translation of UNIMARC frameworks
This patch adds a new translation file, *-installer-UNIMARC.po

To test:
1. On top of all previous patches
2. Apply this patch
3. Create (or update) some language
Ej.
    misc/translation/translate create xx-YY

    verify new file misc/translation/po/xx-YY-installer-UNIMARC.po
4. Install new language
    misc/translation/translate install xx-YY

    verify new dirs:
        installer/data/mysql/xx-YY/marcflavour/unimarc/{mandatory,optional}

5. Repeat install procedure selecting xx-YY language and UNIMARC
   verify all frameworks are present

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-11-08 15:35:23 +01:00
Jonathan Druart c22aa12c05 Update yarn.lock 2023-11-08 15:23:30 +01:00
Owen Leonard f5a69c5714 Bug 32978: Replace node-sass with dart-sass
'npm install' fails in ktd on aarch64, giving unsupported architecture error for node-sass.

This patch addresses this by replacing node-sass with dart-sass, updating our gulpfile
accordingly. Some corrections have been made to SCSS to fix warnings
raised during the build process.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Works like a charm. Great work oleonard! Tested on Apple M1, e.g. aarch64.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I removed some useless formatting changes in the gulpfile, and the
yarn.lock changes as well.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 15:22:40 +01:00
Julian Maurice ca6da9297d Bug 35079: Replace --force-extract by --generate-pot={always,auto,never}
This restores the original behaviour of always building the POT file
in order to not break existing workflows
Option --force-extract is deleted in favor of a new option
--generate-pot that can have 3 values:

* always: always build the POT file. This is the default value
* auto: build the POT file only if it does not exist
* never: never build the POT file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-08 15:18:42 +01:00
Julian Maurice 6391781a9a Bug 35079: Rebuild POT files only if necessary or asked explicitely
By default, gulp tasks po:create and po:update won't rebuild the POT
files if they already exist.
Both tasks gained a new option --force-extract to rebuild them
unconditionally

This makes it possible to create/update PO files for multiple languages
sequentially without rebuilding the POT file for each language.
For instance:

    gulp po:update --lang fr-FR
    # do something with the PO files
    gulp po:update --lang en-GB
    # ...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-11-08 15:18:42 +01:00
danyonsewell 1f8cf02020 Update release notes for 21.11.25 release
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-11-01 04:14:30 +00:00
Danyon Sewell b6f9d97bf9 Increment version for 21.11.25 release
Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
2023-11-01 16:37:28 +13:00
Danyon Sewell 4945422d32 Fix translations for Koha 21.11.25
Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
2023-11-01 16:35:12 +13:00
Koha translators 2b4922c886 Translation updates for Koha 21.11.25
Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
2023-11-01 15:45:47 +13:00
Jonathan Druart 8c1a48a768 Bug 35024: Do not wrap translations
PO files wrap differently depending on versions.

Looks like (thanks Julian!) it's coming from libunistring, between 0.9.10 and 1.0 I am seeing a change in how the strings in the PO files are wrapped.

Debian 11 (using libunistring 0.9):
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s %sÉté"
"%s %s %sAut%s %s %sHiv%s %s %s %s"

Debian 12, Ubuntu 22.04(using libunistring 1.0)
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s "
"%sÉté%s %s %sAut%s %s %sHiv%s %s %s %s"

It *could* come from this changes:
https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=NEWS;h=5a43ddd7011d62a952733f6c0b7ad52aa4f385c7;hb=HEAD
   * The functions u*_possible_linebreaks and u*_width_linebreaks now make it
     easier to work with strings that contain CR-LF sequences: In this case,
     in the returned array, it will return UC_BREAK_CR_BEFORE_LF followed by
     UC_BREAK_MANDATORY (instead of twice UC_BREAK_MANDATORY).

The command used is:
% msgmerge --backup=off --quiet -F --update misc/translator/po/fr-FR-staff-prog.po misc/translator/Koha-staff-prog.pot

No matter the value of --width.

One solution is to use --no-wrap, and never wrap :)

I sent an email to the list about this suggestion https://lists.katipo.co.nz/pipermail/koha/2023-October/060143.html

Test plan:
% gulp po:update --lang LANG

And notice that the lines are no wrapped anymore.

Note that in master there were already not wrapped (?)
commit edd378f4d1
Translation updates for Koha 23.05.00

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-11-01 02:33:26 +00:00
Jonathan Druart e5a617c7df Bug 35043: Do not have \n or \t appear in PO files
This is a trick, so that we won't have to deal with \t in PO files.
\n is not a problem, but it seems consistent to use the same method for
both.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-11-01 02:32:42 +00:00
Jonathan Druart d53685463e Bug 35043: Use Locale::PO->quote
We have our own "quote_po" sub that is stating that Locale::PO::quote
is buggy because it does not deal with quoting new lines correctly.
However it seems that it is fixed now.

Ideally we could use Locale::PO::quote everywhere, but it does not
escape tab characters:
  $string =~ s/\\(?!t)/\\\\/g;           # \t is a tab

This means the following:
msgid "Tabulation (\\t)"
msgstr "Tabulation (\\t)"
become:
-msgid "Tabulation (\t)"
-msgstr "Tabulation (\t)"

And we are seeing the following on Weblate:
https://snipboard.io/BjQmDC.jpg

Note that Locale::PO has not been updated since 2014...

The real problem behind this is that we have 2 methods to quote strings.
At first glance it seems that Locale::PO::quote was not used before, but
with the introduction of the koha-i18n project we will have scripts that
will use Locale::PO->save_file_fromarray, which uses Locale::PO->quote
=> Those scripts will be used on the translation server for post
processing (security reason, marking potential XSS strings as fuzzy).

Test plan:
0. Do not apply the patch
1. gulp po:update --lang LANG # Replace LANG with your favorite language
   code
2. git commit -a -m"init PO files"
3. Apply this patch
4. Repeate 1.
5. git diff
   => The change is about the "Tabulation" and "New line" strings from
      tools/csv-profiles.tt
6. Translate them (replace the \t and \n with %s) and remove the fuzzy
   flag
7. install the template: cd misc/translator && perl translate install
   LANG
8. Enable the language, use it and go to the "Nouveau profil CSV" view
   => Notice that the \t and \n are correctly displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-11-01 02:32:38 +00:00
Jonathan Druart 711dcfbd0b Bug 34959: Sort PO files correctly
The PO files are not sorted when we update them which leads to
unnecessary changes that are commited: hard to see differences and
make git index grow superfluously.

Test plan:
0. Do not apply this patch
1. gulp po:update --lang es-ES
2. git commit -a -m"First PO update"
3. Run again the gulp update command
4. git diff
=> You have a lot of changes generated here, the po:update is not
idempotent.

5. Apply this patch
6. Run the gulp update command
7 git commit -a -m"PO update after 34959"
8. Run the gulp update command
9. git diff
=> No changes are generated

Note that this patch will all the entries by files, and per line
numbers.
It fixes a bug in some condition, where we add information/context about
the string. For instance search for "For the first occurrence" in the
file. Prior to this patch this was not correct, we didn't add info about
the first occurrence (but whichever in the list).

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-11-01 02:31:41 +00:00
Jonathan Druart d252bdcd65 Bug 34959: Remove unused sub
Nothing special here, this sub is not used and we can remove it.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2023-11-01 02:31:08 +00:00
danyonsewell 99230d0163 Bug 35146 - Missing db_revs file for Koha 21.11.24
Adding missing revs file.
2023-11-01 02:27:51 +00:00
Tomas Cohen Arazi c9e2e9aa4f
Add missing db_rev for 21.11.24
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-17 15:33:41 -03:00
Aleisha Amohia 1541364cb6 Bug 35009: Remove merge conflict markers from tools/scheduler.pl
To test:

Confirm tests pass with patch applied t/00-merge-conflict-markers.t

Sponsored-by: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-10-09 22:11:09 +00:00
Jonathan Druart c0077606ea Bug 30524: Remove tests
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-10-09 22:10:59 +00:00
danyonsewell cff66f740d Update release notes for 21.11.24 release
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-09-29 00:31:10 +00:00
Danyon Sewell df3374ec2f Increment version for 21.11.24 release
Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
2023-09-29 13:21:16 +13:00
Danyon Sewell f8887ebe42 Fix translations for Koha 21.11.24
Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
2023-09-29 13:21:15 +13:00
Koha translators 5d3be1b913 Translation updates for Koha 21.11.24 2023-09-29 13:21:15 +13:00
Jonathan Druart d29660038f Bug 34369: Fix 'Did you mean'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-09-29 13:21:11 +13:00
David Cook 1b59140cca Bug 34369: Require CSRF token for updating system preferences
This patch adds the requirements that updating a system preference
requires a CSRF token. (Also, adding and deleting local system preferences.)

0. Apply patch
1. koha-plack --reload kohadev
2. Add local system preference
3. Update local system preference
4. Delete local system preference
5. Update normal system preference
6. Note no errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-09-29 13:21:11 +13:00
David Cook dbe14261ec Bug 34349: Validate/escape inputs for task scheduler
This change validates and escapes inputs for task scheduler.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/tools/scheduler.pl
3. Input a time a minute in the future and leave the date blank
4. Choose an existing report and output format
5. Type a malicious string which is also a valid email address
into the Email field
6. Click "Save"
7. Note that the job is added but the Email is wrapped in single
quotes
8. Try using a non-malicious email address with a single quote.
9. Note that the single quote is escaped, so that it will still
be used by runreport.pl

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed pars for $email =~ regex, removed old commented lines.
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-09-29 13:21:11 +13:00
danyonsewell dfe2bfbcd1 Update release notes for 21.11.23 release
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-08-04 03:11:56 +00:00
danyonsewell d31c0e7b97 Increment version for 21.11.23 release
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-08-04 02:37:51 +00:00
danyonsewell 1f71daa902 Fix translations for Koha 21.11.23
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-08-04 02:24:35 +00:00
danyonsewell 007498d977 Merge remote-tracking branch 'translate/21.11.23-translate-20230803' into 21.11.x-security
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
2023-08-04 01:28:58 +00:00