Bug 22155

Summary: biblio_metadata.marcflavour should be renamed 'schema'
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: DatabaseAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, kyle, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 22159    
Bug Blocks: 22144    
Attachments: Bug 22155: DB update
Bug 22155: DB update
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema
Bug 22155: DB update
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema
Bug 22155: DB update
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema
Bug 22155: DB update
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema

Description Tomás Cohen Arazi 2019-01-17 16:27:59 UTC
If we are thinking of supporting other metadata schemas, the 'marcflavour' field should be renamed 'schema'. This is what the Koha::MetadataRecord class does already.
Comment 1 David Cook 2019-01-18 01:51:46 UTC
I totally agree.
Comment 2 Tomás Cohen Arazi 2019-01-18 01:55:30 UTC
Created attachment 84175 [details] [review]
Bug 22155: DB update
Comment 3 Tomás Cohen Arazi 2019-01-18 02:34:10 UTC
Created attachment 84176 [details] [review]
Bug 22155: DB update
Comment 4 Tomás Cohen Arazi 2019-01-18 02:34:22 UTC
Created attachment 84177 [details] [review]
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema

This patch makes the code using Koha::Biblio::Metadata->marcflavour use
->schema instead for all interactions.

To test:
- Update the DB structure:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Notice all the places in which biblio_metadata is used
  $ cd kohaclone
  $ git grep biblio_metadata
=> SUCCESS: They all use `schema` instead of marcflavour
- Notice all the places that use Koha::Biblio::Metadata:
  $ git grep Koha::Biblio::Metadata
=> SUCCESS: They all use the schema attribute when they used to use
marcflavour
- Run all the modified tests and scripts
=> SUCCESS: We are all good
- Sign off :-D

Note: while this seems like a minor change, the places in which plain
SQL is used really require understanding the queries and how they are
used, because some query results might be passed to some other method
that in turn uses the marcflavour attribute. I of course took that into
account but errare humanum est :-D
Comment 5 Tomás Cohen Arazi 2019-01-18 10:40:14 UTC
Created attachment 84182 [details] [review]
Bug 22155: DB update
Comment 6 Tomás Cohen Arazi 2019-01-18 10:40:22 UTC
Created attachment 84183 [details] [review]
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema

This patch makes the code using Koha::Biblio::Metadata->marcflavour use
->schema instead for all interactions.

To test:
- Update the DB structure:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Notice all the places in which biblio_metadata is used
  $ cd kohaclone
  $ git grep biblio_metadata
=> SUCCESS: They all use `schema` instead of marcflavour
- Notice all the places that use Koha::Biblio::Metadata:
  $ git grep Koha::Biblio::Metadata
=> SUCCESS: They all use the schema attribute when they used to use
marcflavour
- Run all the modified tests and scripts
=> SUCCESS: We are all good
- Sign off :-D

Note: while this seems like a minor change, the places in which plain
SQL is used really require understanding the queries and how they are
used, because some query results might be passed to some other method
that in turn uses the marcflavour attribute. I of course took that into
account but errare humanum est :-D
Comment 7 Kyle M Hall 2019-01-18 15:20:31 UTC
Created attachment 84200 [details] [review]
Bug 22155: DB update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall 2019-01-18 15:26:03 UTC
Created attachment 84201 [details] [review]
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema

This patch makes the code using Koha::Biblio::Metadata->marcflavour use
->schema instead for all interactions.

To test:
- Update the DB structure:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Notice all the places in which biblio_metadata is used
  $ cd kohaclone
  $ git grep biblio_metadata
=> SUCCESS: They all use `schema` instead of marcflavour
- Notice all the places that use Koha::Biblio::Metadata:
  $ git grep Koha::Biblio::Metadata
=> SUCCESS: They all use the schema attribute when they used to use
marcflavour
- Run all the modified tests and scripts
=> SUCCESS: We are all good
- Sign off :-D

Note: while this seems like a minor change, the places in which plain
SQL is used really require understanding the queries and how they are
used, because some query results might be passed to some other method
that in turn uses the marcflavour attribute. I of course took that into
account but errare humanum est :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Katrin Fischer 2019-01-20 12:26:20 UTC
Created attachment 84244 [details] [review]
Bug 22155: DB update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2019-01-20 12:26:24 UTC
Created attachment 84245 [details] [review]
Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema

This patch makes the code using Koha::Biblio::Metadata->marcflavour use
->schema instead for all interactions.

To test:
- Update the DB structure:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Notice all the places in which biblio_metadata is used
  $ cd kohaclone
  $ git grep biblio_metadata
=> SUCCESS: They all use `schema` instead of marcflavour
- Notice all the places that use Koha::Biblio::Metadata:
  $ git grep Koha::Biblio::Metadata
=> SUCCESS: They all use the schema attribute when they used to use
marcflavour
- Run all the modified tests and scripts
=> SUCCESS: We are all good
- Sign off :-D

Note: while this seems like a minor change, the places in which plain
SQL is used really require understanding the queries and how they are
used, because some query results might be passed to some other method
that in turn uses the marcflavour attribute. I of course took that into
account but errare humanum est :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Nick Clemens 2019-01-31 13:38:56 UTC
Awesome work all!

Pushed to master for 19.05
Comment 12 David Cook 2019-02-01 00:39:59 UTC
(In reply to Nick Clemens from comment #11)
> Awesome work all!
> 
> Pushed to master for 19.05

Nick is a champion :3.
Comment 13 Martin Renvoize 2019-02-01 15:33:36 UTC
Enhancement, will not be backported at this time to  18.11.x series.