if you try to order a book via an external source (SRU search) the order button is not working if you are using an non-english language z3950_search_21.0501003.js:133 Uncaught TypeError: Cannot read property 'document' of null at HTMLAnchorElement.<anonymous> (z3950_search_21.0501003.js:133) at HTMLTableElement.dispatch (jquery-2.2.3.min_21.0501003.js:3) at HTMLTableElement.r.handle (jquery-2.2.3.min_21.0501003.js:3) bug confirmed by (11:44:25) Joubu: It's caused by 23302, link it with that bug number when you have opened the new one
Created attachment 123244 [details] [review] Bug 28773: (bug 23302 follow-up) Fix add order from z3950 search results For translated interface. Using 'Order' (the button text) was not a good idea as the interface can be translated :)
This is my try but I am not happy with it. Letting Mark having his try!
Honestly - I wouldn't have done it differently, and if so only worse. But I tested it and it works now. On my behalf I'd sign it off, thx a lot
Created attachment 123277 [details] [review] Bug 28773: (bug 23302 follow-up) Fix add order from z3950 search results For translated interface. Using 'Order' (the button text) was not a good idea as the interface can be translated :) Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Marcel, can you QA this one please?
(In reply to Jonathan Druart from comment #5) > Marcel, can you QA this one please? Sure
(In reply to Jonathan Druart from comment #1) > For translated interface. > > Using 'Order' (the button text) was not a good idea as the interface can > be translated :) Hmm. The problem is not the button text, but the title attribute. Some attributes are also translated: <li><a class="chosen" data-action="order" href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]" title="Bestellung"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li> xgettext.pl contains: if ( $a =~ /title|value|alt|content|placeholder|aria-label/ ) { But your patch resolves the bug with another (untranslated) attribute.
We only have an existing inconsistency where Order is translated via tp but MARC and Card are going via the regular translation path.
WARNING: OUT OF SCOPE Just strolling into I18N, I am seeing this: sub _expand { my ($text, %vars) = @_; my $re = join '|', map { quotemeta $_ } keys %vars; $text =~ s/\{($re)\}/defined $vars{$1} ? $vars{$1} : "{$1}"/ge; Can this be true?
Created attachment 123291 [details] [review] Bug 28773: (bug 23302 follow-up) Fix add order from z3950 search results For translated interface. Using 'Order' (the button text) was not a good idea as the interface can be translated :) Signed-off-by: Mark Hofstetter <koha@trust-box.at> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Just wait
Created attachment 123292 [details] [review] Bug 28773: (QA follow-up) Additional changes The work of the first patch was not yet finished. [1] Similar changes to template for Cataloging and Authorities [2] Made a better distinction now between short title on button and long title on menu and modal [3] The short title parameter removes need for previewed var [4] To keep related code closer, moved the dataPreview hidden code Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Julian, Could you have a look at comment9 ? How do you get the result with defined $x evaluated ?
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.03
Depends on Bug 23302 not in 20.11.x