IRC log for #koha, 2020-12-11

All times shown according to UTC.

Time S Nick Message
00:06 koha-jenkins Project Koha_20.05_U18 build #5: STILL UNSTABLE in 55 min: https://jenkins.koha-community[…]Koha_20.05_U18/5/
00:10 koha-jenkins Project Koha_20.05_D10 build #155: NOW UNSTABLE in 39 min: https://jenkins.koha-community[…]ha_20.05_D10/155/
00:20 koha-jenkins Project Koha_20.05_U2010 build #49: STILL UNSTABLE in 45 min: https://jenkins.koha-community[…]a_20.05_U2010/49/
00:41 inlibro joined #koha
00:49 did joined #koha
00:59 koha-jenkins Project Koha_20.05_U18 build #6: STILL UNSTABLE in 52 min: https://jenkins.koha-community[…]Koha_20.05_U18/6/
01:05 koha-jenkins Project Koha_20.05_U16 build #141: STILL FAILING in 1 hr 31 min: https://jenkins.koha-community[…]ha_20.05_U16/141/
01:41 inlibro joined #koha
01:47 koha-jenkins Project Koha_20.05_U16 build #142: NOW UNSTABLE in 42 min: https://jenkins.koha-community[…]ha_20.05_U16/142/
02:41 inlibro joined #koha
03:41 inlibro joined #koha
04:42 inlibro joined #koha
05:36 margaret joined #koha
05:37 kidclamp joined #koha
05:42 inlibro joined #koha
05:49 dcook Nothing like finding Zebra bugs on a Friday afternoon...
05:54 SlackIntegration[m] joined #koha
06:04 chriss joined #koha
06:39 fridolin joined #koha
06:42 inlibro joined #koha
07:05 magnuse \o/
07:17 Oak joined #koha
07:25 reiveune joined #koha
07:25 reiveune hello
07:25 wahanui niihau, reiveune
07:28 alex_a joined #koha
07:29 alex_a Bonjour
07:29 wahanui hello, alex_a
07:31 lds joined #koha
07:39 did joined #koha
07:42 inlibro joined #koha
07:55 fridolin joined #koha
08:00 cait joined #koha
08:03 cait1 joined #koha
08:03 liliputech_asu joined #koha
08:03 cait1 good morning #koha
08:03 ashimema mornin'
08:04 liliputech_asu morning :)
08:04 liliputech_asu joined #koha
08:08 kohaputti joined #koha
08:11 ashimema jajm around?
08:12 ashimema or anyone else whose up to speed on the new translations stuff
08:12 * ashimema is trying to wrap his head around
08:13 ashimema [% tx('Published on {published_on} by {author}', { published_on = published_on, author = author }) | html %]
08:13 ashimema vs
08:14 ashimema [% t('Published on {published_on} by {author}') | html | $Expand published_on = published_on, author = author %]
08:17 ashimema hmm, I see
08:17 ashimema the later prevents double encoding
08:19 jajm ashimema, Expand is when you don't want to filter the contents of your variables
08:19 jajm for instance if published_on contains html that should not be escaped
08:19 ashimema yeah.. I had to look for further context
08:20 ashimema you already filter published_on in the BLOCK
08:20 jajm not really happy with the solution, suggestions welcome :)
08:20 * ashimema was trying to see if there was any other way..
08:20 ashimema but needed to make 100% sure he understood what it was doing first
08:20 ashimema generally I'm not against it at all
08:20 ashimema just measuring up the options to see if a new set of eyes could help shift it along
08:21 ashimema due diligence and all that ;)
08:21 ashimema next silly question..
08:22 ashimema could
08:22 ashimema [% published_on = BLOCK %][% koha_new.published_on | $KohaDates %][% END %]
08:22 ashimema not also be written as
08:22 ashimema [% published_on = koha_new.published_on | $KohaDates %]
08:22 Oak joined #koha
08:22 ashimema maybe TT doesn't work that way.. me tests
08:24 jajm ashimema, it would be great if it worked like that, but i believe that's what I tested first
08:24 ashimema I have a really vague recollection that I fixed a bug in TT itself around that.
08:26 ashimema aha.. it was SET I was thinking of
08:27 Joubu can you remind me the bug number?
08:27 ashimema bug 26392 is the one we're talking about right now
08:27 huginn Bug http://bugs.koha-community.org[…]_bug.cgi?id=26392 enhancement, P5 - low, ---, julian.maurice, Signed Off , Wrap all translatable strings in opac-main.tt
08:27 ashimema but the TT bug that got me wondering if there was a nicer way to define those $Expand things was https://github.com/abw/Template2/issues/263
08:28 ashimema I don't think it's relevant now
08:32 Joubu And, what about:
08:32 Joubu [% libraryName = BLOCK %][% Branches.GetName(branchcode) | html %][% END %]
08:32 Joubu [% t('RSS feed for {libraryName} library news') | html | $Expand libraryName = libraryName %
08:32 Joubu vs
08:32 Joubu [% t('RSS feed for {libraryName} library news') | html | $Expand libraryName = Branches.GetName(branchcode) %]
08:32 Joubu well, without the Expand then
08:32 Joubu [% t('RSS feed for {libraryName} library news') | html | libraryName = Branches.GetName(branchcode) %]
08:33 ashimema er...
08:34 ashimema I think that final one wouldn't work.. you need $Expand to get 'libraryName' into the substitution in the t() at the beggining..
08:34 ashimema don't you?
08:34 ashimema and...
08:34 ashimema the middle one.. you're loosing an html filtering of the return fo GetName(branchcode);
08:37 Joubu so the automated way offered by 20988 does not longer work
08:39 Joubu shouldn't we have the t* TT methods HTML filter by default?
08:39 Joubu with a parameter for other behaviours?
08:42 ashimema interestingly.. that TT bug I reference does appear to claim that `[% published_on = koha_new.published_on | $KohaDates %]` should work as we expect.. but calling it with an explicit SET prepended will not... but they seem to agree that's a bug
08:42 inlibro joined #koha
08:43 ashimema so.. the thing I'm really debating is are we making it harder to spot missing filters...
08:43 ashimema Joubu's middle option there I think missed filters.. i.e
08:43 ashimema `[% t('RSS feed for {libraryName} library news') | html | $Expand libraryName = Branches.GetName(branchcode) %]`
08:44 ashimema I think it would be super easy to miss that during QA and introduce potential security issues..
08:44 TimothyAlexis joined #koha
08:44 ashimema please correct me if I'm wrong.. or over/under thinking it
08:51 ashimema blimey.. I hadn't seen the comments on it over night
08:51 ashimema reading
08:52 Joubu jajm: what about having the t* methods doing the html filtering by default?
08:52 Joubu t() would not need it ofc
08:52 ashimema I wondered that
08:54 ashimema I also wondered if we could do something like
08:55 jajm Joubu, then we would need an option to turn this off, right ? Not sure we'll gain much in readability
08:55 ashimema `[% tx('Published on {published_on} by {author}', { published_on = published_on | $KohaDate, author = author | html }) | html %]`
08:55 ashimema i.e filtering the variables inline
08:56 ashimema so.. could the tx function be modified to always expect a filter passed with each variable and apply them internally..
08:56 Joubu jajm: most of the time we will need to html filter
08:56 ashimema rather than requireing the BLOCK construct?
08:57 Joubu the Expand and the 2 lines are hard to read, confusing and error prone imo
08:57 ashimema I'm not against how your doing it.. just trying to see if there are any cleaner things
08:57 ashimema that's kinda what I'm saying.. and hence my idea of inlining like above.. do you find the above any clearer Joubu?
08:57 Joubu ashimema: yes but...
08:58 Joubu what about KohaDates that takes parameters?
08:58 Joubu [% tx('Published on {published_on} by {author}', { published_on = published_on | $KohaDate, author = author | html }) | html %]
08:58 Joubu this does not work, right?
08:58 Joubu you were meaning to add another parameter, per variable, to pass the filter to use?
08:59 jajm one option I have considered is to turn filters into macro: [% published_on = html($KohaDates(mydate, options)) %]
08:59 ashimema I don't think it works.. I've not actually tried
09:00 ashimema but yes.. I was meaning "can we adapt tx to require a filter passed for each variable we pass.. so it does the filtering"
09:00 ashimema hmm.. that's not a bad idea.. though still spreads them over multiple lines right?
09:00 Joubu yes, jajm, that seems a good idea
09:00 Joubu no need to
09:01 ashimema yup.. ignore that from me
09:01 ashimema fingers faster than brain :P
09:01 ashimema so we could end up with
09:01 Joubu [% tx('Published on {published_on} by {author}', { published_on = filter(date_var, 'KohaDates', options), author = filter(author, 'html') }) | html %]
09:02 Joubu that's still ugly
09:02 ashimema `[% tx('Published on {published_on} by {author}', { published_on = $KohaDates(koha_new.published_on), author = html(koha_new.author)}) | html %]`
09:02 ashimema right?
09:02 ashimema haha
09:03 Joubu then we don't need the last html
09:03 ashimema true
09:04 ashimema `[% tx('Published on {published_on} by {author}', { published_on = $KohaDates(koha_new.published_on), author = html(koha_new.author)}) %]`
09:05 ashimema if we can manage something like that.. I'd say it's preferable to the having to use BLOCK contructs and an $Expand passthrough
09:06 ashimema simply from the being more readable/less error prone option.. I'm mostly thinking about the QA team spotting missing filters or having to double read templates to understand how formerly simple contructs now work
09:06 ashimema jajm++ for getting us this far already :)
09:06 ashimema it's good to talk
09:07 jajm we'd still need the last html filter imo, in case the translator introduces unwanted html
09:07 ashimema hum.. that's a fair point
09:08 ashimema the translator could in theory add in JS in a form of attack if they wanted to..
09:08 ashimema though... don't we actually try and catch that at translation time right now?
09:08 ashimema I'm sure I've raised it before and we ended up with a script on the translation server to spot such things...
09:08 ashimema or.. was it in the Rmaint manual.. things to check before release
09:09 ashimema either way.. I don't think it's a terrible idea to have the final html filter added
09:09 Joubu we have a check about that (the translator adding bad stuff)
09:10 Joubu and we don't deal with that currently anyway
09:12 ashimema I've linked the log of this chat in the bug so we don't loose it.
09:13 Joubu (and also the problem is that we are doing to double html filter)
09:14 ashimema fair point
09:15 ashimema html(koha_new.author) there would get a second html encode..
09:15 ashimema that certainly swings me back around to filtering inside each of the functions as required..
09:16 ashimema t() would do html.. would there really ever be a reason for a plain string to NOT want the html treatment?
09:16 ashimema my brain hurts again.. lol
09:22 Joubu @later tell oleonard can you have a look at 27200 please?
09:22 huginn Joubu: The operation succeeded.
09:22 Joubu t() does not need to be html filtered IMO
09:23 Joubu the other t* (those with variables) could be html escaped by default, with a parameter to explicitely remove it (like when we already filtered the variables)
09:23 Joubu but I think prefer the options we listed above, the one using a macro
09:24 ashimema I like the macro option the best :)
09:24 ashimema :)
09:24 Joubu we could have a TT plugin "filter"
09:24 Joubu I actually wrote the 'To' TT plugin for that purpose
09:24 ashimema jajm, are you OK having a go at that?
09:24 Joubu it conly deals with JSON so far
09:24 ashimema I didn't mean to give more work.. just help arrive at the cleanest approach
09:24 Joubu but we could have To.html(var)
09:25 Joubu To.date(date, options)
09:25 ashimema interesting
09:25 jajm ashimema, a go at what specifically ?
09:25 Joubu [% tx('Published on {published_on} by {author}', { published_on = To.date(koha_new.published_on, options), author = To.html(koha_new.author)}) %]
09:25 ashimema converting that bug to macros as discussed above as opposed to the $Expand filter you implimented?
09:25 Joubu at that ^
09:27 Joubu the (big) cons: we are loosing the "missing filter" check. I don't think we will manage to write a parser to make sure the variables are filtered correctly
09:27 jajm yep, can do that
09:27 ashimema and we'd need a QA script update to ensure QA peeps catch that tx() and friends all pass params via filters/macros as discussed
09:27 ashimema thanks :)
09:27 ashimema haha
09:28 Joubu yes, unless we force the parameters to be called with To.*
09:28 ashimema I was hypothesising.. you don't think it would be possible.. fair enough..
09:28 Joubu but we can have additional processing (we have for the facet links for instance)
09:28 did left #koha
09:28 ashimema certainly for the tx() and friends methods I don't think that would be a terrible idea
09:28 Joubu we filter things, then we display them
09:28 Joubu we can have a To.raw
09:28 Joubu yeah, and we are done
09:28 ashimema fantastic
09:28 ashimema great work team
09:29 jajm Joubu, should we create a new TT plugin then ? `To.html` is confusing: it does not convert to html, it's almost the opposite
09:34 ashimema or add the functions into the I18N one?
09:34 ashimema hmm
09:35 ashimema does that work..
09:36 Joubu I would create a new 'Filter' plugin
09:37 Joubu it's not tight to I18N
09:37 ashimema true
09:42 inlibro joined #koha
10:13 TimothyAlexis joined #koha
10:14 TimothyAlexis http://paste.koha-community.org/26448
10:14 TimothyAlexis Questions from yesterday.
10:15 TimothyAlexis Sorry, I don't even know why I added a link to that.
10:15 TimothyAlexis I'm thinking, what I've learned about Koha so far there could be something like a Koha::News::NewsItem object to use for inserting and deleting news items from the opac_news table.
10:15 TimothyAlexis Is there?
10:15 TimothyAlexis Second question: Is there a Koha namespace replacement for C4::Context->preference(<syspref>) ?
10:22 Joubu there is Koha::Config::SystemPreference[s]
10:22 Joubu but you should not use it
10:22 Joubu unless you know what you are doing
10:22 Joubu the C4::Context->preference method deals with caching
10:23 Joubu Koha::News and Koha::NewsItem are Koha::Object[s]-based, so you can usual the usual ->new->store, ->find, ->search methods
10:24 Joubu use the usual*
10:36 TimothyAlexis Joubu++
10:43 inlibro joined #koha
11:27 tcohen morning
11:33 nugged_ joined #koha
11:34 GeekRuthie_ joined #koha
11:43 inlibro joined #koha
12:20 khall joined #koha
12:26 Dyrcona joined #koha
12:43 inlibro joined #koha
13:38 lilipute1h_asu joined #koha
13:39 khall_ joined #koha
13:43 inlibro joined #koha
13:50 marie-luce joined #koha
14:04 lukeG joined #koha
14:43 inlibro joined #koha
14:51 paul_p joined #koha
14:54 bdonnahue1 joined #koha
14:56 paul_p_ joined #koha
15:07 paul_p joined #koha
15:31 paul_p joined #koha
15:34 paul_p_ joined #koha
15:44 inlibro joined #koha
15:52 fridolin left #koha
16:44 inlibro joined #koha
16:51 paul_p_ joined #koha
16:52 reiveune bye
16:52 reiveune left #koha
17:02 cait joined #koha
17:44 inlibro joined #koha
18:16 koha-jenkins Yippee, build fixed!
18:16 wahanui Congratulations!
18:16 koha-jenkins Project Koha_19.11_U18 build #274: FIXED in 41 min: https://jenkins.koha-community[…]ha_19.11_U18/274/
18:19 koha-jenkins Project Koha_19.11_D10 build #107: SUCCESS in 46 min: https://jenkins.koha-community[…]ha_19.11_D10/107/
18:20 koha-jenkins Project Koha_19.11_D8 build #346: SUCCESS in 45 min: https://jenkins.koha-community[…]oha_19.11_D8/346/
18:20 koha-jenkins Project Koha_19.11_D9 build #281: SUCCESS in 44 min: https://jenkins.koha-community[…]oha_19.11_D9/281/
18:21 Dyrcona joined #koha
18:21 koha-jenkins Yippee, build fixed!
18:21 wahanui Congratulations!
18:21 koha-jenkins Project Koha_19.11_U16 build #30: FIXED in 46 min: https://jenkins.koha-community[…]oha_19.11_U16/30/
18:44 inlibro joined #koha
18:48 koha-jenkins Project Koha_19.11_U20 build #171: SUCCESS in 1 hr 12 min: https://jenkins.koha-community[…]ha_19.11_U20/171/
18:52 koha-jenkins Project Koha_19.11_U18 build #275: SUCCESS in 36 min: https://jenkins.koha-community[…]ha_19.11_U18/275/
19:00 koha-jenkins Project Koha_19.11_D8 build #347: SUCCESS in 40 min: https://jenkins.koha-community[…]oha_19.11_D8/347/
19:05 koha-jenkins Project Koha_19.11_U16 build #31: UNSTABLE in 43 min: https://jenkins.koha-community[…]oha_19.11_U16/31/
19:17 khall joined #koha
19:43 Miguel joined #koha
19:43 Miguel hi
19:44 Guest8161 OPACHoldsIfAvailableAtPickupExceptions  en koha 18.05
19:44 inlibro joined #koha
19:44 Guest8161 OpacHiddenItemsExceptions
19:44 Guest8161 in koha 18.05
19:52 khall_ joined #koha
19:54 koha-jenkins Project Koha_19.11_U20 build #172: SUCCESS in 1 hr 5 min: https://jenkins.koha-community[…]ha_19.11_U20/172/
20:02 caroline Guest8161: that system preference is only in Koha 18.11 and up
20:04 Guest8161 there is no way to implement it in 18.05 without updating the version
20:04 Guest8161 OpacHiddenItemsExceptions
20:04 caroline I guess you could try to backport the patch
20:06 Guest8161 patch, how to install
20:10 caroline I don't know, you'd have to ask a developper
20:10 caroline or try googling
20:12 Guest8161 thanks
20:44 inlibro joined #koha
21:45 inlibro joined #koha
22:45 inlibro joined #koha
23:45 inlibro joined #koha

| Channels | #koha index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary