As mentioned in https://mail.google.com/mail/u/0/#inbox/15149ab97f6289aa in the Evidentia LNF a search for Duodopa® should result in all drugs containing the trademark on top (using the <normal> sort algorithms), then the rest.
Creating a watir test. Testing only whether the first product listed contains Duodopa in its name. Testing all, would be take more time to program.
Now the Watir test pass. Must show whether we broke other unit and watir tests. Evidentia has a problem with NON-SL before SL entries. I must rethink the test to consider the fact, that we search by galenic groups first. Fixed this problem. Must fix unit test test/test_model/search_result.rb, too.
Looking into who I can install xvfb under gentoo/funtoo, to be able to run watir tests withouy being distracted by chromium windows. As stated in https://wiki.gentoo.org/wiki/X_server xvfb is by default not installed. Will look whether I will need the changes from https://gist.github.com/joshdevins/1588066 to make xvfb work. Called USE="xvfb" emerge xorg-server
Pushed commit Trademarks first for evidentia
When going from the Fachinfo-Link at home 3 step to details of changes, then clicking in the snapback, the last click to home does not go back to home, but the last search. This must be fixed. Eg.
The difference is that following the backlink removes the part show from the URL. Why?
Added a watir test to catch errors with linking to home. Fixed the problem. Running now all unit and watir tests to ensure that I broke nothing.
Pushed commit Fix links to home for changelog, which contains also some fixes for watir-tests.
In order to fix it I had to add in the class FachinfoDocumentChangelogs < View::PrivateTemplate
the following line SEARCH_HEAD = View::SelectSearchForm
. This made the search_query and search_type item display.
Added a watir test in the spec/smoketest_spec.rb, too. Pushed commit Display search_type for change_logs, too
We got the following e-mail
Plugin: ODDB::XlsExportPlugin Error: ArgumentError Message: comparison of ODBA::Stub with ODBA::Stub failed Backtrace: (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `sort' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/src/model/sequence.rb:186:in `factored_compositions' (druby://localhost:10005) /var/www/oddb.org/src/model/sequence.rb:124:in `comparables' (druby://localhost:10005) /var/www/oddb.org/src/model/package.rb:213:in `comparables' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/generics_xls.rb:96:in `block in export_generics' (druby://localhost:10005) /var/www/oddb.org/src/model/sequence.rb:183:in `each' (druby://localhost:10005) /var/www/oddb.org/src/model/sequence.rb:183:in `each_package' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/src/model/registration.rb:155:in `block in each_package' (druby://localhost:10005) /var/www/oddb.org/src/model/registration.rb:154:in `each_value' (druby://localhost:10005) /var/www/oddb.org/src/model/registration.rb:154:in `each_package' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/src/util/oddbapp.rb:711:in `block in each_package' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `each_value' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/src/util/oddbapp.rb:710:in `each_package' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/generics_xls.rb:94:in `export_generics' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:112:in `block in export_generics_xls' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:253:in `call' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:253:in `block in safe_export' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/tempfile.rb:316:in `open' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:252:in `safe_export' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:110:in `export_generics_xls' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' /var/www/oddb.org/src/plugin/xls_export.rb:22:in `export_generics' /var/www/oddb.org/src/util/updater.rb:122:in `block in export_generics_xls' /var/www/oddb.org/src/util/updater.rb:549:in `call' /var/www/oddb.org/src/util/updater.rb:549:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:120:in `export_generics_xls' /var/www/oddb.org/src/util/updater.rb:307:in `update_bsv_followers' /var/www/oddb.org/src/util/updater.rb:208:in `run' jobs/import_daily:13:in `block in <module:Util>' /var/www/oddb.org/src/util/job.rb:40:in `call' /var/www/oddb.org/src/util/job.rb:40:in `run' jobs/import_daily:12:in `<module:Util>' jobs/import_daily:11:in `<module:ODDB>' jobs/import_daily:10:in `<main>'
By adding some debugging output I was able to localize the culprit, as shown with this bin/admin snippet
registration('56828').sequence('01').comparables -> comparison of ODBA::Stub with ODBA::Stub failed ch.oddb> registration('56828').name_base -> InductOs 1.5 mg/ml ch.oddb> registration('56828').active? -> true ch.oddb> registration('56828').public? -> true
Must show, whether we have several of them or not. Must rerun export, as I forgot to log the exportd, too. But the exporter generated a correct data/downloads/generics.xls.zip. Willl continue tomorrow.