Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread Magnus Enger
Oops, looks like we have created two things with very similar names:

https://wiki.koha-community.org/wiki/Developers_Handbook
https://wiki.koha-community.org/wiki/Developer_handbook

The second one was started by me to try and tie together all the pages
in the wiki that a developer should know.

Coule we rename one of them?

Best regards,
Magnus

On 13 September 2016 at 12:19, Kyle Hall  wrote:
> On Mon, Sep 12, 2016 at 7:38 PM, David Cook 
> wrote:
>>
>> I didn’t even know Koha::Exceptions was a thing! How does it work? Wasn’t
>> Kyle going to work on some sort of developer handbook so there would be a
>> central repository of guidelines/patterns?
>
>
> You can find it here:
> https://wiki.koha-community.org/wiki/Developers_Handbook
>
> It doesn't have any documentation on using Exceptions, and that would
> definitely be a good addition. I feel like it's a bit "messy" as I started
> it by using the coding guidelines as a base, but it's not a bad start! If
> anyone wants to work on it, please do!
>
>>
>>
>>
>> I read the Koha Coding Guidelines many moons ago, but it would be nice to
>> know when there are updates. Since I’m not as active in the community these
>> days, I don’t know if I have much of a say over things anymore, but it would
>> be good to be informed of updates to the guidelines, so that a person can
>> contribute more efficiently when one does contribute.
>>
>>
>>
>> TryCatch requires Moose while Try::Tiny is lightweight, but I guess we’re
>> going down the Moose rabbit hole anyways these days? Doesn’t TryCatch just
>> do try/catch/catch instead of if/elsif/elsif?
>
>
> I had thought TryCatch's use of Moose would be a deal-breaker ( at least
> until Koha is officially plack-only ), but after inspecting the code, I
> don't believe it actually uses Moose. It does use packages in the Moose
> namespace, but it doesn't appear to use Moose itself, though it's possible I
> didn't go far enough down the rabbit hole. At this point I think I'm in
> favor of TryCatch instead of Try::Tiny do to it's ability to catch multiple
> types of exceptions and it's avoidance of messing with error handlers.
>
> Kyle
>
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-devel] Call for News: September 2016 Newsletter

2016-09-13 Thread kohanews

Fellow Koha users ~

I'm collecting news for the September newsletter. Send anything 
noteworthy to:


k o h a news AT gmail dot com

News criteria:
---
** For events **:

- Please include dates for past events. If I can't find dates I may not 
add it.

- Announcements for future events with dates T.B.A. are fine ...Eg., Kohacon
- For past events --  one month back is the cut-off  ***. * News 
items can be of any length.


* Images are fine
* Anything and everything Koha.
* Submit by the 26th of the month.

If you are working on an interesting project or development related to
Koha, please let me know and I'll include it in the development section.

--
Chad Roseburg
Editor, Koha Community Newsletter

___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread David Cook
According to MetaCPAN*, TryCatch has a dependency on Moose:
https://metacpan.org/pod/TryCatch

It's in the META.yml and Makefile:
https://metacpan.org/source/ASH/TryCatch-1.003002/META.yml
https://metacpan.org/source/ASH/TryCatch-1.003002/Makefile.PL

So you're going to have a hard time building TryCatch without Moose, even if
you build a custom Debian package, I imagine.

As for the source code
(https://metacpan.org/source/ASH/TryCatch-1.003002/lib/TryCatch.pm), I see
Moose::Util::TypeConstraints, which uses a few Moose::* packages which Zeno
has pointed out. It also requires Class::MOP, which appears to load some
Moose XS with the XSLoader (https://metacpan.org/source/Class::MOP#L32). And
actually... if you look at Moose::Exporter... that's part of the Moose
package: https://metacpan.org/source/ETHER/Moose-2.1805, so you need to
install "Moose" if you're going to get Moose::Exporter and
Moose::Deprecated.

If you see the TODO for TryCatch, you'll see it's on the TODO list to split
out the Moose dependency: https://metacpan.org/pod/TryCatch#TODO

*I always use MetaCPAN these days when I'm tracking Perl dependencies since
it does a lot of autodiscovery and it's just a nicer interface than CPAN. 

David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St
Ultimo, NSW 2007
Australia

Office: 02 9212 0899
Direct: 02 8005 0595


> -Original Message-
> From: koha-devel-boun...@lists.koha-community.org [mailto:koha-devel-
> boun...@lists.koha-community.org] On Behalf Of Tajoli Zeno
> Sent: Tuesday, 13 September 2016 9:42 PM
> To: koha-devel 
> Subject: Re: [Koha-devel] Coding patterns discussion
> 
> Hi,
> 
> Il 13/09/2016 12:19, Kyle Hall ha scritto:
> > TryCatch requires Moose while Try::Tiny is lightweight, but I guess
> > we're going down the Moose rabbit hole anyways these days? Doesn't
> > TryCatch just do try/catch/catch instead of if/elsif/elsif?
> >
> >
> > I had thought TryCatch's use of Moose would be a deal-breaker ( at
> > least until Koha is officially plack-only ), but after inspecting the
> > code, I don't believe it actually uses Moose. It does use packages in
> > the Moose namespace, but it doesn't appear to use Moose itself, though
> > it's possible I didn't go far enough down the rabbit hole.
> 
> reading the code of TryCatch I see that it use:
> Moose::Util::TypeConstraints
> that it use:
>Moose::Exporter;
>Moose::Deprecated
>that they use:
>  Moose::Util::MetaRole
>  Moose::Util
>  Try::Tiny
> 
> So in fact:
> -- Installing  TryCatch we install also  Try::Tiny
> -- We need to create an ad hoc debian package, the debian standard package
> uses Moose.
> -- Try::Tiny is in this package:
> https://packages.debian.org/jessie/libtry-tiny-perl, version 0.22 it is
enough
> ?
> 
> 
> Bye
> Zeno Tajoli
> 
> --
> Zeno Tajoli
> /SVILUPPO PRODOTTI CINECA/ - Automazione Biblioteche
> Email: z.taj...@cineca.it Fax: 051/6132198
> *CINECA* Consorzio Interuniversitario - Sede operativa di Segrate (MI)
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/


___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread David Cook
Hi Jonathan,

Unfortunately, I doubt that I'll ever be able to attend a dev meeting.

Australia/Sydney
21 UTC = 7am
19 UTC = 5am
7 UTC =  5pm

Of course, looking at the times for others, I see that the times for Europe 
aren't always that desirable either.  

Europe/Paris
21 UTC = 11pm
19 UTC = 9pm
7 UTC = 9am

Pacific/Auckland
21 UTC = 10am
19 UTC = 8am
7 UTC = 8pm

America/Los_Angeles
21 UTC = 2pm
19 UTC = 12pm
7 UTC = 12am

And I doubt it's worthwhile changing one of the meeting times to be inclusive 
of Australians, as there probably aren't that many of us. In fact, I'm sure 7am 
and 5pm aren't too bad for some Australians, but for me those are times where 
I'm with my family and not at a computer, so maybe I'm just the exception.

As Katrin said, there are always the meeting minutes and adding a "watch" on 
the wiki page. Even if I can't contribute, I can at least keep track of what's 
discussed that way. 

David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St
Ultimo, NSW 2007
Australia

Office: 02 9212 0899
Direct: 02 8005 0595


> -Original Message-
> From: koha-devel-boun...@lists.koha-community.org [mailto:koha-devel-
> boun...@lists.koha-community.org] On Behalf Of Jonathan Druart
> Sent: Tuesday, 13 September 2016 5:19 PM
> To: koha-devel 
> Subject: Re: [Koha-devel] Coding patterns discussion
> 
> Next dev meeting is on September 28:
> https://wiki.koha-
> community.org/wiki/Development_IRC_meeting_28_September_2016
> 
> 2016-09-12 19:32 GMT+01:00 Tomas Cohen Arazi :
> > I've been looking at our coding patterns, and noticed we haven't
> > discussed/agreed on some stuff. Which is a good oportunity to just do
> > it, now the Koha:: namespace is being filled with cool old-code
> > rewrites with lots of test coverage.
> >
> > - Transactions on heavy business functions that should definitely be
> > wrapped inside a transaction.
> >
> > Running
> >   $ cd Koha ; git grep txn
> > is just sad.
> >
> > - Little use of Exceptions in Koha. We introduced them, but still
> > don't extend its use. Maybe related to the next item.
> >
> > I think we should keep general exceptions (like
> > Koha::Exceptions::ObjectNotFound) in the general Koha::Exceptions
> namespace.
> > But move the package-specific ones into its own file. To aid
> > maintenance. A good candidate are Koha::Exceptions::Virtualshelves
> >
> > - We don't use a Try/Catch library. It would make it easier to use
> > Koha::Exceptions with a nice syntax.
> >
> > There are a couple interesting libraries: Try::Tiny and TryCatch. [1]
> > I prefer the latter because the type check seems nicer to write and
> > eval (instead of an if/ifelse cascade checking ref($exception) eq
> 'Something'.
> >
> > I have my opinions on this items, and it would be great to discuss it
> > openly. There's code in bugzilla waiting for QA, and it'd be great to
> > have some consensus on how to organize the code for the future.
> >
> > Regards
> >
> > [1] http://search.cpan.org/~ether/Try-Tiny-0.27/lib/Try/Tiny.pm and
> > http://search.cpan.org/~ash/TryCatch-1.003002/lib/TryCatch.pm
> >
> > --
> > Tomás Cohen Arazi
> > Theke Solutions (https://theke.io)
> > ✆ +54 9351 3513384
> > GPG: B2F3C15F
> >
> > ___
> > Koha-devel mailing list
> > Koha-devel@lists.koha-community.org
> > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> > website : http://www.koha-community.org/ git :
> > http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/ git : http://git.koha-
> community.org/ bugs : http://bugs.koha-community.org/


___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Migrate/Upgrade from 2.2.3 to latest.

2016-09-13 Thread Michael Hafen
I think the problem there is that the code column is declared as 'DEFAULT
NULL', where in the permissions table it is declared as 'NOT NULL'.  And
the foreign key constraints require an index, as I recall.  It seems that
since no primary key is declared it's trying to make one using all the
columns, but can't because of the code column.  I think if you change the
code column declaration to match how it's declared in the permissions table
that will fix the query.

On Tue, Sep 13, 2016 at 9:34 AM, Rodrigo Santellan 
wrote:

> I found out that on the upgrade 3.00.00.068 the script for creating the
> table permissions is wrong:
>
> DBD::mysql::db do failed: All parts of a PRIMARY KEY must be NOT NULL; if
> you need NULL in a key, use UNIQUE instead [for Statement "CREATE TABLE
> `permissions` (
> `module_bit` int(11) NOT NULL DEFAULT 0,
> `code` varchar(30) DEFAULT NULL,
> `description` varchar(255) DEFAULT NULL,
> PRIMARY KEY  (`module_bit`, `code`),
> CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`module_bit`)
> REFERENCES `userflags` (`bit`)
> ON DELETE CASCADE ON UPDATE CASCADE
>   ) ENGINE=InnoDB DEFAULT CHARSET=utf8"] at updatedatabase.pl
> line 1273.
> DBD::mysql::db do failed: Cannot add foreign key constraint [for Statement
> "CREATE TABLE `user_permissions` (
> `borrowernumber` int(11) NOT NULL DEFAULT 0,
> `module_bit` int(11) NOT NULL DEFAULT 0,
> `code` varchar(30) DEFAULT NULL,
> CONSTRAINT `user_permissions_ibfk_1` FOREIGN KEY
> (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
> ON DELETE CASCADE ON UPDATE CASCADE,
> CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY
> (`module_bit`, `code`)
> REFERENCES `permissions` (`module_bit`, `code`)
> ON DELETE CASCADE ON UPDATE CASCADE
>   ) ENGINE=InnoDB DEFAULT CHARSET=utf8"] at updatedatabase.pl
> line 1281.
>
> Has anybody has the correct definition of the table permissions?
>
> Regards.
>
> On Tue, Sep 13, 2016 at 11:35 AM, Rodrigo Santellan 
> wrote:
>
>> Hi,
>>
>> I have changed: 3.00.00.053 to remove the constraint to labels_templates
>> and now it goes smooth on that part. I'll add more logging when the db
>> query are executed because there are some tables like permissions that are
>> not created.
>>
>> Thanks a lot!
>>
>> On Tue, Sep 13, 2016 at 4:29 AM, Jonathan Druart <
>> jonathan.dru...@bugs.koha-community.org> wrote:
>>
>>> It has been removed by
>>> commit c102b61ef58dc34860e8acf6cab6bd9a96dae0a1
>>> Date:   Mon Jan 4 14:18:01 2010 -0500
>>> [26/30] Updating kohastructure.sql to reflect changes introduced
>>> in Patron Card Creator work
>>>
>>> But indeed these changes have not been put in the updatedatabase.pl
>>> file.
>>> You can ignore this table.
>>>
>>> 2016-09-13 0:02 GMT+01:00 Michael Hafen :
>>> > There's also update 61 which references the labels_templates table.
>>> You'd
>>> > have to omit that one too.
>>> > That table is gone, but I don't know when it gets dropped.  I looked
>>> through
>>> > updatedatabase.pl and didn't see it get dropped.  So I don't know.
>>> If you
>>> > are aiming for a recent release then it should be ok to omit the table
>>> and
>>> > those two updates.
>>> >
>>> > On Mon, Sep 12, 2016 at 1:04 PM, Rodrigo Santellan <
>>> rsantel...@gmail.com>
>>> > wrote:
>>> >>
>>> >> Passing the conditions in true (1 == 1 ) on lines 2623 and 3418 I'm
>>> able
>>> >> to pass further on the updatedatabase.pl
>>> >>
>>> >> But the problems are on migrating to 3.00.00.053 the definitions that
>>> are
>>> >> needed on that table are on 3.00.00.059. My intuition says to change
>>> the
>>> >> order, but I have to be honest that I don't know the consequences and
>>> >> according to the IRC chat the table labels_templates is gone.
>>> >>
>>> >> Should I ommit them both?
>>> >>
>>> >> Thanks!
>>> >>
>>> >> On Mon, Sep 12, 2016 at 1:56 PM, Michael Hafen <
>>> michael.ha...@washk12.org>
>>> >> wrote:
>>> >>>
>>> >>> Have you looked in the /installer/data/mysql directory at the
>>> >>> labels_upgrade.pl and patroncards_upgrade.pl scripts.  I think
>>> those where
>>> >>> supposed to be run by the updatedatabase.pl script, but I seem to
>>> recall
>>> >>> having trouble with that myself.
>>> >>>
>>> >>> On Mon, Sep 12, 2016 at 7:07 AM, Rodrigo Santellan <
>>> rsantel...@gmail.com>
>>> >>> wrote:
>>> 
>>>  Hi,
>>> 
>>>  I'm trying to do a migration or upgrade from koha 2.2.3 to koha 3. I
>>>  know is a daunting task that I have embarked but I'm trying to
>>> bring back a
>>>  library to the latest updates of the community.
>>> 
>>>  So far this are the steps I have done:
>>>  1 - I dump an empty schema of the DB and create a new one with the
>>> name

Re: [Koha-devel] Migrate/Upgrade from 2.2.3 to latest.

2016-09-13 Thread Rodrigo Santellan
I found out that on the upgrade 3.00.00.068 the script for creating the
table permissions is wrong:

DBD::mysql::db do failed: All parts of a PRIMARY KEY must be NOT NULL; if
you need NULL in a key, use UNIQUE instead [for Statement "CREATE TABLE
`permissions` (
`module_bit` int(11) NOT NULL DEFAULT 0,
`code` varchar(30) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY  (`module_bit`, `code`),
CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`module_bit`)
REFERENCES `userflags` (`bit`)
ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8"] at updatedatabase.pl
line 1273.
DBD::mysql::db do failed: Cannot add foreign key constraint [for Statement
"CREATE TABLE `user_permissions` (
`borrowernumber` int(11) NOT NULL DEFAULT 0,
`module_bit` int(11) NOT NULL DEFAULT 0,
`code` varchar(30) DEFAULT NULL,
CONSTRAINT `user_permissions_ibfk_1` FOREIGN KEY
(`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY
(`module_bit`, `code`)
REFERENCES `permissions` (`module_bit`, `code`)
ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8"] at updatedatabase.pl
line 1281.

Has anybody has the correct definition of the table permissions?

Regards.

On Tue, Sep 13, 2016 at 11:35 AM, Rodrigo Santellan 
wrote:

> Hi,
>
> I have changed: 3.00.00.053 to remove the constraint to labels_templates
> and now it goes smooth on that part. I'll add more logging when the db
> query are executed because there are some tables like permissions that are
> not created.
>
> Thanks a lot!
>
> On Tue, Sep 13, 2016 at 4:29 AM, Jonathan Druart <
> jonathan.dru...@bugs.koha-community.org> wrote:
>
>> It has been removed by
>> commit c102b61ef58dc34860e8acf6cab6bd9a96dae0a1
>> Date:   Mon Jan 4 14:18:01 2010 -0500
>> [26/30] Updating kohastructure.sql to reflect changes introduced
>> in Patron Card Creator work
>>
>> But indeed these changes have not been put in the updatedatabase.pl file.
>> You can ignore this table.
>>
>> 2016-09-13 0:02 GMT+01:00 Michael Hafen :
>> > There's also update 61 which references the labels_templates table.
>> You'd
>> > have to omit that one too.
>> > That table is gone, but I don't know when it gets dropped.  I looked
>> through
>> > updatedatabase.pl and didn't see it get dropped.  So I don't know.  If
>> you
>> > are aiming for a recent release then it should be ok to omit the table
>> and
>> > those two updates.
>> >
>> > On Mon, Sep 12, 2016 at 1:04 PM, Rodrigo Santellan <
>> rsantel...@gmail.com>
>> > wrote:
>> >>
>> >> Passing the conditions in true (1 == 1 ) on lines 2623 and 3418 I'm
>> able
>> >> to pass further on the updatedatabase.pl
>> >>
>> >> But the problems are on migrating to 3.00.00.053 the definitions that
>> are
>> >> needed on that table are on 3.00.00.059. My intuition says to change
>> the
>> >> order, but I have to be honest that I don't know the consequences and
>> >> according to the IRC chat the table labels_templates is gone.
>> >>
>> >> Should I ommit them both?
>> >>
>> >> Thanks!
>> >>
>> >> On Mon, Sep 12, 2016 at 1:56 PM, Michael Hafen <
>> michael.ha...@washk12.org>
>> >> wrote:
>> >>>
>> >>> Have you looked in the /installer/data/mysql directory at the
>> >>> labels_upgrade.pl and patroncards_upgrade.pl scripts.  I think those
>> where
>> >>> supposed to be run by the updatedatabase.pl script, but I seem to
>> recall
>> >>> having trouble with that myself.
>> >>>
>> >>> On Mon, Sep 12, 2016 at 7:07 AM, Rodrigo Santellan <
>> rsantel...@gmail.com>
>> >>> wrote:
>> 
>>  Hi,
>> 
>>  I'm trying to do a migration or upgrade from koha 2.2.3 to koha 3. I
>>  know is a daunting task that I have embarked but I'm trying to bring
>> back a
>>  library to the latest updates of the community.
>> 
>>  So far this are the steps I have done:
>>  1 - I dump an empty schema of the DB and create a new one with the
>> name
>>  koha3.
>>  2 - Apply the update22to30.pl
>>  3 - Import all the tables I could, the one that not been deleted.
>>  4 - Run updatedatabase.pl
>> 
>>  And now I'm stuck there, I'm missing the table: labels_templates and
>> the
>>  table printers_profile is different.
>> 
>>  I have asked on the IRC channel and they say that table
>> labels_templates
>>  is gone on 3.18.
>> 
>>  I'm heading on a good direction? Or I should do a clean install and
>> then
>>  try to import all the old data?
>> 
>>  I will appreciate any help! Thanks in advance!
>> 
>>  Regards.
>> 
>>  Rodrigo Santellán.
>> 
>>  

[Koha-devel] Hackfest in Marseille = last call to register !

2016-09-13 Thread Paul Poulain

Hello Koha !

A reminder: the hackfest in Marseille will take place in a few weeks 
(oct 10th - 14th), it's time to register 


*How to register*: drop me an email

*What can I do at the hackfest*: anything useful for the Koha community 
: testing, documenting, learning, teaching, discovering,...


*How much does it cost*: it's free (just count 15€ per lunch, we 
organize it. Veggie welcomed)


*Who will I meet*: almost everyone active in the community (chris, we 
miss you): 20+ librarians. Some great developers (random order, sorry if 
I forgot some) Owen, Brendan, Tomas, Mirko, Katrin, Magnus, Jonathan. 
The people from Koha Gruppo Italiano who convince Ebsco to fund us every 
year. All BibLibre staff, 5 of ByWaterSolutions staff, 2 of ptfs-europe 
staff,


"Wow, that's a lot of people !" Yes, we have already 54 registrations. 
But don't worry, this year, we have an additional room just next door 
that can welcome 12-16 persons, so we still have some empty seats!


--
Paul Poulain, Associé-gérant / co-owner
BibLibre, Services en logiciels libres pour les bibliothèques
BibLibre, Open Source software and services for libraries

___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Migrate/Upgrade from 2.2.3 to latest.

2016-09-13 Thread Rodrigo Santellan
Hi,

I have changed: 3.00.00.053 to remove the constraint to labels_templates
and now it goes smooth on that part. I'll add more logging when the db
query are executed because there are some tables like permissions that are
not created.

Thanks a lot!

On Tue, Sep 13, 2016 at 4:29 AM, Jonathan Druart <
jonathan.dru...@bugs.koha-community.org> wrote:

> It has been removed by
> commit c102b61ef58dc34860e8acf6cab6bd9a96dae0a1
> Date:   Mon Jan 4 14:18:01 2010 -0500
> [26/30] Updating kohastructure.sql to reflect changes introduced
> in Patron Card Creator work
>
> But indeed these changes have not been put in the updatedatabase.pl file.
> You can ignore this table.
>
> 2016-09-13 0:02 GMT+01:00 Michael Hafen :
> > There's also update 61 which references the labels_templates table.
> You'd
> > have to omit that one too.
> > That table is gone, but I don't know when it gets dropped.  I looked
> through
> > updatedatabase.pl and didn't see it get dropped.  So I don't know.  If
> you
> > are aiming for a recent release then it should be ok to omit the table
> and
> > those two updates.
> >
> > On Mon, Sep 12, 2016 at 1:04 PM, Rodrigo Santellan  >
> > wrote:
> >>
> >> Passing the conditions in true (1 == 1 ) on lines 2623 and 3418 I'm able
> >> to pass further on the updatedatabase.pl
> >>
> >> But the problems are on migrating to 3.00.00.053 the definitions that
> are
> >> needed on that table are on 3.00.00.059. My intuition says to change the
> >> order, but I have to be honest that I don't know the consequences and
> >> according to the IRC chat the table labels_templates is gone.
> >>
> >> Should I ommit them both?
> >>
> >> Thanks!
> >>
> >> On Mon, Sep 12, 2016 at 1:56 PM, Michael Hafen <
> michael.ha...@washk12.org>
> >> wrote:
> >>>
> >>> Have you looked in the /installer/data/mysql directory at the
> >>> labels_upgrade.pl and patroncards_upgrade.pl scripts.  I think those
> where
> >>> supposed to be run by the updatedatabase.pl script, but I seem to
> recall
> >>> having trouble with that myself.
> >>>
> >>> On Mon, Sep 12, 2016 at 7:07 AM, Rodrigo Santellan <
> rsantel...@gmail.com>
> >>> wrote:
> 
>  Hi,
> 
>  I'm trying to do a migration or upgrade from koha 2.2.3 to koha 3. I
>  know is a daunting task that I have embarked but I'm trying to bring
> back a
>  library to the latest updates of the community.
> 
>  So far this are the steps I have done:
>  1 - I dump an empty schema of the DB and create a new one with the
> name
>  koha3.
>  2 - Apply the update22to30.pl
>  3 - Import all the tables I could, the one that not been deleted.
>  4 - Run updatedatabase.pl
> 
>  And now I'm stuck there, I'm missing the table: labels_templates and
> the
>  table printers_profile is different.
> 
>  I have asked on the IRC channel and they say that table
> labels_templates
>  is gone on 3.18.
> 
>  I'm heading on a good direction? Or I should do a clean install and
> then
>  try to import all the old data?
> 
>  I will appreciate any help! Thanks in advance!
> 
>  Regards.
> 
>  Rodrigo Santellán.
> 
>  ___
>  Koha-devel mailing list
>  Koha-devel@lists.koha-community.org
>  http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
>  website : http://www.koha-community.org/
>  git : http://git.koha-community.org/
>  bugs : http://bugs.koha-community.org/
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> Michael Hafen
> >>> Washington County School District Technology Department
> >>> Systems Analyst
> >>>
> >>
> >
> >
> >
> > --
> > Michael Hafen
> > Washington County School District Technology Department
> > Systems Analyst
> >
> >
> > ___
> > Koha-devel mailing list
> > Koha-devel@lists.koha-community.org
> > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> > website : http://www.koha-community.org/
> > git : http://git.koha-community.org/
> > bugs : http://bugs.koha-community.org/
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
>
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread Tajoli Zeno

Hi,

Il 13/09/2016 12:19, Kyle Hall ha scritto:

TryCatch requires Moose while Try::Tiny is lightweight, but I guess
we’re going down the Moose rabbit hole anyways these days? Doesn’t
TryCatch just do try/catch/catch instead of if/elsif/elsif?


I had thought TryCatch's use of Moose would be a deal-breaker ( at least
until Koha is officially plack-only ), but after inspecting the code, I
don't believe it actually uses Moose. It does use packages in the Moose
namespace, but it doesn't appear to use Moose itself, though it's
possible I didn't go far enough down the rabbit hole.


reading the code of TryCatch I see that it use:
Moose::Util::TypeConstraints
that it use:
  Moose::Exporter;
  Moose::Deprecated
  that they use:
Moose::Util::MetaRole
Moose::Util
Try::Tiny

So in fact:
-- Installing  TryCatch we install also  Try::Tiny
-- We need to create an ad hoc debian package, the debian standard
package uses Moose.
-- Try::Tiny is in this package: 
https://packages.debian.org/jessie/libtry-tiny-perl, version 0.22 it is 
enough ?



Bye
Zeno Tajoli

--
Zeno Tajoli
/SVILUPPO PRODOTTI CINECA/ - Automazione Biblioteche
Email: z.taj...@cineca.it Fax: 051/6132198
*CINECA* Consorzio Interuniversitario - Sede operativa di Segrate (MI)
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread Kyle Hall
On Mon, Sep 12, 2016 at 7:38 PM, David Cook 
wrote:

> I didn’t even know Koha::Exceptions was a thing! How does it work? Wasn’t
> Kyle going to work on some sort of developer handbook so there would be a
> central repository of guidelines/patterns?
>

You can find it here:
https://wiki.koha-community.org/wiki/Developers_Handbook

It doesn't have any documentation on using Exceptions, and that would
definitely be a good addition. I feel like it's a bit "messy" as I started
it by using the coding guidelines as a base, but it's not a bad start! If
anyone wants to work on it, please do!


>
>
> I read the Koha Coding Guidelines many moons ago, but it would be nice to
> know when there are updates. Since I’m not as active in the community these
> days, I don’t know if I have much of a say over things anymore, but it
> would be good to be informed of updates to the guidelines, so that a person
> can contribute more efficiently when one does contribute.
>
>
>
> TryCatch requires Moose while Try::Tiny is lightweight, but I guess we’re
> going down the Moose rabbit hole anyways these days? Doesn’t TryCatch just
> do try/catch/catch instead of if/elsif/elsif?
>

I had thought TryCatch's use of Moose would be a deal-breaker ( at least
until Koha is officially plack-only ), but after inspecting the code, I
don't believe it actually uses Moose. It does use packages in the Moose
namespace, but it doesn't appear to use Moose itself, though it's possible
I didn't go far enough down the rabbit hole. At this point I think I'm in
favor of TryCatch instead of Try::Tiny do to it's ability to catch multiple
types of exceptions and it's avoidance of messing with error handlers.

Kyle
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Migrate/Upgrade from 2.2.3 to latest.

2016-09-13 Thread Jonathan Druart
It has been removed by
commit c102b61ef58dc34860e8acf6cab6bd9a96dae0a1
Date:   Mon Jan 4 14:18:01 2010 -0500
[26/30] Updating kohastructure.sql to reflect changes introduced
in Patron Card Creator work

But indeed these changes have not been put in the updatedatabase.pl file.
You can ignore this table.

2016-09-13 0:02 GMT+01:00 Michael Hafen :
> There's also update 61 which references the labels_templates table.  You'd
> have to omit that one too.
> That table is gone, but I don't know when it gets dropped.  I looked through
> updatedatabase.pl and didn't see it get dropped.  So I don't know.  If you
> are aiming for a recent release then it should be ok to omit the table and
> those two updates.
>
> On Mon, Sep 12, 2016 at 1:04 PM, Rodrigo Santellan 
> wrote:
>>
>> Passing the conditions in true (1 == 1 ) on lines 2623 and 3418 I'm able
>> to pass further on the updatedatabase.pl
>>
>> But the problems are on migrating to 3.00.00.053 the definitions that are
>> needed on that table are on 3.00.00.059. My intuition says to change the
>> order, but I have to be honest that I don't know the consequences and
>> according to the IRC chat the table labels_templates is gone.
>>
>> Should I ommit them both?
>>
>> Thanks!
>>
>> On Mon, Sep 12, 2016 at 1:56 PM, Michael Hafen 
>> wrote:
>>>
>>> Have you looked in the /installer/data/mysql directory at the
>>> labels_upgrade.pl and patroncards_upgrade.pl scripts.  I think those where
>>> supposed to be run by the updatedatabase.pl script, but I seem to recall
>>> having trouble with that myself.
>>>
>>> On Mon, Sep 12, 2016 at 7:07 AM, Rodrigo Santellan 
>>> wrote:

 Hi,

 I'm trying to do a migration or upgrade from koha 2.2.3 to koha 3. I
 know is a daunting task that I have embarked but I'm trying to bring back a
 library to the latest updates of the community.

 So far this are the steps I have done:
 1 - I dump an empty schema of the DB and create a new one with the name
 koha3.
 2 - Apply the update22to30.pl
 3 - Import all the tables I could, the one that not been deleted.
 4 - Run updatedatabase.pl

 And now I'm stuck there, I'm missing the table: labels_templates and the
 table printers_profile is different.

 I have asked on the IRC channel and they say that table labels_templates
 is gone on 3.18.

 I'm heading on a good direction? Or I should do a clean install and then
 try to import all the old data?

 I will appreciate any help! Thanks in advance!

 Regards.

 Rodrigo Santellán.

 ___
 Koha-devel mailing list
 Koha-devel@lists.koha-community.org
 http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
 website : http://www.koha-community.org/
 git : http://git.koha-community.org/
 bugs : http://bugs.koha-community.org/
>>>
>>>
>>>
>>>
>>> --
>>> Michael Hafen
>>> Washington County School District Technology Department
>>> Systems Analyst
>>>
>>
>
>
>
> --
> Michael Hafen
> Washington County School District Technology Department
> Systems Analyst
>
>
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread Jonathan Druart
Next dev meeting is on September 28:
https://wiki.koha-community.org/wiki/Development_IRC_meeting_28_September_2016

2016-09-12 19:32 GMT+01:00 Tomas Cohen Arazi :
> I've been looking at our coding patterns, and noticed we haven't
> discussed/agreed on some stuff. Which is a good oportunity to just do it,
> now the Koha:: namespace is being filled with cool old-code rewrites with
> lots of test coverage.
>
> - Transactions on heavy business functions that should definitely be wrapped
> inside a transaction.
>
> Running
>   $ cd Koha ; git grep txn
> is just sad.
>
> - Little use of Exceptions in Koha. We introduced them, but still don't
> extend its use. Maybe related to the next item.
>
> I think we should keep general exceptions (like
> Koha::Exceptions::ObjectNotFound) in the general Koha::Exceptions namespace.
> But move the package-specific ones into its own file. To aid maintenance. A
> good candidate are Koha::Exceptions::Virtualshelves
>
> - We don't use a Try/Catch library. It would make it easier to use
> Koha::Exceptions with a nice syntax.
>
> There are a couple interesting libraries: Try::Tiny and TryCatch. [1] I
> prefer the latter because the type check seems nicer to write and eval
> (instead of an if/ifelse cascade checking ref($exception) eq 'Something'.
>
> I have my opinions on this items, and it would be great to discuss it
> openly. There's code in bugzilla waiting for QA, and it'd be great to have
> some consensus on how to organize the code for the future.
>
> Regards
>
> [1] http://search.cpan.org/~ether/Try-Tiny-0.27/lib/Try/Tiny.pm and
> http://search.cpan.org/~ash/TryCatch-1.003002/lib/TryCatch.pm
>
> --
> Tomás Cohen Arazi
> Theke Solutions (https://theke.io)
> ✆ +54 9351 3513384
> GPG: B2F3C15F
>
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Coding patterns discussion

2016-09-13 Thread Katrin

H David,

the coding guidelines are in effect as documented on the wiki:

https://wiki.koha-community.org/wiki/Coding_Guidelines

Changes and additions are discussed regularly at the development 
meetings and documented in the meeting minutes. You can also 'watch' the 
wiki page to get informed whenever the page is changed. At the moment I 
think we don't use Moose in Koha.


Hope this helps,

Katrin


On 13.09.2016 01:38, David Cook wrote:


I didn’t even know Koha::Exceptions was a thing! How does it work? 
Wasn’t Kyle going to work on some sort of developer handbook so there 
would be a central repository of guidelines/patterns?


I read the Koha Coding Guidelines many moons ago, but it would be nice 
to know when there are updates. Since I’m not as active in the 
community these days, I don’t know if I have much of a say over things 
anymore, but it would be good to be informed of updates to the 
guidelines, so that a person can contribute more efficiently when one 
does contribute.


TryCatch requires Moose while Try::Tiny is lightweight, but I guess 
we’re going down the Moose rabbit hole anyways these days? Doesn’t 
TryCatch just do try/catch/catch instead of if/elsif/elsif?


David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

Office: 02 9212 0899

Direct: 02 8005 0595

*From:*koha-devel-boun...@lists.koha-community.org 
[mailto:koha-devel-boun...@lists.koha-community.org] *On Behalf Of 
*Tomas Cohen Arazi

*Sent:* Tuesday, 13 September 2016 4:32 AM
*To:* koha-devel 
*Subject:* [Koha-devel] Coding patterns discussion

I've been looking at our coding patterns, and noticed we haven't 
discussed/agreed on some stuff. Which is a good oportunity to just do 
it, now the Koha:: namespace is being filled with cool old-code 
rewrites with lots of test coverage.


- Transactions on heavy business functions that should definitely be 
wrapped inside a transaction.


Running

  $ cd Koha ; git grep txn

is just sad.

- Little use of Exceptions in Koha. We introduced them, but still 
don't extend its use. Maybe related to the next item.


I think we should keep general exceptions (like 
Koha::Exceptions::ObjectNotFound) in the general Koha::Exceptions 
namespace. But move the package-specific ones into its own file. To 
aid maintenance. A good candidate are Koha::Exceptions::Virtualshelves


- We don't use a Try/Catch library. It would make it easier to use 
Koha::Exceptions with a nice syntax.


There are a couple interesting libraries: Try::Tiny and TryCatch. [1] 
I prefer the latter because the type check seems nicer to write and 
eval (instead of an if/ifelse cascade checking ref($exception) eq 
'Something'.


I have my opinions on this items, and it would be great to discuss it 
openly. There's code in bugzilla waiting for QA, and it'd be great to 
have some consensus on how to organize the code for the future.


Regards

[1] http://search.cpan.org/~ether/Try-Tiny-0.27/lib/Try/Tiny.pm 
 and 
http://search.cpan.org/~ash/TryCatch-1.003002/lib/TryCatch.pm 



--

Tomás Cohen Arazi

Theke Solutions (https://theke.io )
✆+54 9351 3513384
GPG: B2F3C15F



___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/