After importing a UTF-8 based CSV file some entries are displayed with funny characters e.g
Breaking in the method link of lib/bbmb/html/view/catalogue.rb shows that the category is effectly
The import problem was easy to fix. But I remarked that the imported ABSCHLUSS.CSV is not a correctly UTF-8 encoded file. Eg. I found the line
705878,"K▄TTEL","Oey","300270","Cobiotic N 6x100 ml","01.01.2017","31.12.2017",30,0,30,92.70
Pushed commit Handle CSV files with different encodings
Starting work to use new Rack-based SBSM version. Change virbac and virbac-yus services to use Ruby 2.4.0. This seems to work without any problem.
Pushed a tag before_rack to easen following the changes. Virbac is quite different from davaz, as we use here viral states. Must create an Rack app. I am able to start it with
bundle exec rackup config.ru after having add lib/bbmb/util/app.rb and a few items for logging and yus in my local
Must understand the errors shown now in log/2017/02/24/app_log. Adapted service virbac.bbmb.ch to use rack.Added a host virbac_rack.ngiger.ch to /etc/hosts and created an apache config. Analysing the error
[14545:14545:0224/120906.582694:ERROR:navigation_entry_screenshot_manager.cc(141)] Invalid entry with unique id: 1916 seen in
/var/www/virbac.bbmb.ch/log/2017/02/24/access_log after visiting http://virbac_rack.ngiger.ch/. Added the apache config as etc/samples/virbac_rack.bbmb.ch.conf.
Fixed loading of config file. Adding a log entry to see, which config file was loaded. Tried to set the cookie-name to 'virbac.bbmb'. This did not work. Looks like the viral states are not visited. After adding the parameter
session_class: BBMB::Html::Util::Session, for the RackInterface the viral states begins to thow errors.
Okay. It looks like that I have to add the functionality of bbmb/bin/bbmbd to my Rack app.
Now I am having problems restoring from the ODBA. Backtrace is
/var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/marshal.rb:15:in `load': undefined class/module Encoding::Character:: (ArgumentError) from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/marshal.rb:15:in `load' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:629:in `restore' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:319:in `block in fetch_or_restore' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:314:in `fetch_or_do' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:318:in `fetch_or_restore' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:66:in `block in bulk_restore' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:63:in `each' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:63:in `bulk_restore' from /var/www/virbac.bbmb.ch/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:417:in `prefetch' from /home/niklaus/git/bbmb/lib/bbmb/persistence/odba.rb:42:in `<module:BBMB>' from /home/niklaus/git/bbmb/lib/bbmb/persistence/odba.rb:14:in `<top (required)>' from /var/www/virbac.bbmb.ch/lib/bbmb/util/app.rb:22:in `require' from /var/www/virbac.bbmb.ch/lib/bbmb/util/app.rb:22:in `old_bbmbd' from /var/www/virbac.bbmb.ch/lib/bbmb/util/app.rb:67:in `initialize' from /var/www/virbac.bbmb.ch/config.ru:18:in `new'
This is a problem because the BBMB server still uses the sbsm/drbserver, which is no longer present in the newer SBSM version. Added it. Now I see the (expected)
FEHLER: Relation »target_id_bbmb_model_product_ean13« existiert bereits for all.
Porting bbmb to use SBSM with rack. Updated Gemfile, etc. Most stuff was easy. But the only remaining error puzzles me.
1) Error: BBMB::Util::TestServer#test_inject_order__customer_by_ean13: NoMethodError: undefined method `async' for #<BBMB::Util::App:0x0055e1393df228> /home/niklaus/git/bbmb/lib/bbmb/util/server.rb:59:in `inject_order' /home/niklaus/git/bbmb/test/util/test_server.rb:99:in `test_inject_order__customer_by_ean13'
Now the unit tests complete. Pushing to branch with_rack Updated to use SBSM with rack >= 1.3.6. incomplete and Added async. Still many failing unit test