Bug 19789 - Remove some indirect DBIx calls from updatedatabase
Summary: Remove some indirect DBIx calls from updatedatabase
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 20922 21931 23265 23809
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-11 07:34 UTC by Marcel de Rooy
Modified: 2020-11-30 21:44 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2017-12-11 07:34:07 UTC
Triggered by a comment on 19096.

What happens when DBIx schema does not match table design?
Add a field to schema file that does not exist => Koha::Object->new and store still works, Koha::Objects->search still works but an actual fetch by calling ->next is enough to crash.
DBD::mysql::st execute failed: Unknown column 'me.iserniet' in 'field list'
Add a field to the table but not to the schema file => Seems to work still

Dubious lines in updatedatabase
L12389 Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
This includes Koha Objects calls to Koha::SearchFields and Koha::SearchMarcMaps.
The sub add_to_search_marc_maps in Koha::SearchField puzzles me. Does this work, why is there no test associated with it ?
Any (future) new column in search fields or search marc maps may lead to a crash at 3.23.00.050

L13526 and context: Koha::Number::Price->new( $order->{rrp} )->round;
Only new calls seem to be fine. But might be tricky.

L14364 and context:
Koha::Holds->search({ found => 'W', priority => 0 });
Any future change in reserves table may lead to a crash on the next statement in 16.12.00.032.
Comment 1 Jonathan Druart 2018-06-12 16:14:42 UTC
(In reply to Marcel de Rooy from comment #0)
> L13526 and context: Koha::Number::Price->new( $order->{rrp} )->round;
> Only new calls seem to be fine. But might be tricky.

Done on bug 20922.
Comment 2 Jonathan Druart 2018-12-07 19:35:39 UTC
(In reply to Marcel de Rooy from comment #0)
> Dubious lines in updatedatabase
> L12389 Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
> This includes Koha Objects calls to Koha::SearchFields and
> Koha::SearchMarcMaps.
> The sub add_to_search_marc_maps in Koha::SearchField puzzles me. Does this
> work, why is there no test associated with it ?
> Any (future) new column in search fields or search marc maps may lead to a
> crash at 3.23.00.050

Reported on bug 21931.
Comment 3 Jonathan Druart 2019-08-05 18:32:59 UTC
(In reply to Marcel de Rooy from comment #0)
> L14364 and context:
> Koha::Holds->search({ found => 'W', priority => 0 });
> Any future change in reserves table may lead to a crash on the next
> statement in 16.12.00.032.

See bug 23265.
Comment 4 Jonathan Druart 2019-12-11 08:53:33 UTC
I think we are good for now.