view · edit · sidebar · attach · print · history

Index>

20170516-virbac

Summary

  • Testing rack based virbac with BBMB 2.1.4 and SBSM 1.3.8
  • Installing the new rack based virbac on thinpower
  • Fix problem setting password
  • Keep in Mind

Commits

Index

Testing rack based virbac with BBMB 2.1.4 and SBSM 1.3.8

Folgende Tests habe ich selber mit manuell klicken ausprobiert und sie funktionieren.

  • Running bin/update_abschluss_artikel_artikel_fr_kunden
  • login as a normal user The home Warenkorb should appear with a least of product
    • visiting the following links should work
      • Warenkorb (Home)
      • Archiv
      • Schnellbestellung
        • Suche nach HPM zeigte 42 Produkt. Konnte 1 der Schnellbestätigung hinzufügen
      • Katalog
      • Abschlüsse
      • Promotionen
      • Kalkulieren (Ändern des Faktors auf 2 und Drücken auf Neu berechnen läuft)
      • Passwort ändern
      • Abmelden und anmelden mit neuem Passwort
  • login as admin user
    • Select a user
      • Changing a street address (and other fields should work). Values should persist after restarting the app
  • Wenn man als admin-Benutzer eingeloggt is
    • Set a new password for claude.meier worked and could login as Claude Meier
    • Set a new Password for rüsch worked, but produced the following error
ODBA::Stub was unable to replace #269599 from BBMB::Model::Customer:#2617
NoMethodError: undefined method `calculate_effective_prices' for nil:NilClass
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/bbmb-2.1.4/lib/bbmb/html/state/current_order.rb:21:in `init'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:223:in `block in process_rack'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:207:in `synchronize'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:207:in `process_rack'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/app.rb:119:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:49:in `_call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:37:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/content_length.rb:15:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/static.rb:149:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/common_logger.rb:33:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:49:in `_call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:37:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/common_logger.rb:33:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/chunked.rb:54:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/content_length.rb:15:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/handler/webrick.rb:86:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'
172.25.1.75 - - [16/May/2017:08:18:12 +0200] "POST /de/bbmb HTTP/1.1" 500 77607 0.0467
  • All customers should appear
  • Clicking on Umsatz should display a list of orders (total should match)
  • Search via name/id/address should work
  • Changing the language to french and back should work
  • Select a user
  • Selecting Customer Rüsch-Perk (de/bbmb/orders/customer_id/708427) and selecting the "Umsatz"-Link

produced the following backtrace

172.25.1.75 - - [16/May/2017:08:11:28 +0200] "GET /resources/bbmb/logo.gif HTTP/1.1" 200 1263 0.0014
ODBA::Stub was unable to replace BBMB::Model::Order::Position#269595 from Array:#269468
/var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:157: warning: Hash#index is deprecated; use Hash#key
NoMethodError: undefined method `quantity' for nil:NilClass
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/bbmb-2.1.4/lib/bbmb/model/order.rb:124:in `block in item_count'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/bbmb-2.1.4/lib/bbmb/model/order.rb:124:in `each'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/bbmb-2.1.4/lib/bbmb/model/order.rb:124:in `inject'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/bbmb-2.1.4/lib/bbmb/model/order.rb:124:in `item_count'
        (eval):2:in `send'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/value.rb:33:in `init'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/namedcomponent.rb:34:in `initialize'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:87:in `new'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:87:in `create'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:67:in `block in compose_list'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:65:in `each'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:65:in `each_with_index'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:65:in `compose_list'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:54:in `compose'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:129:in `init'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/template.rb:67:in `new'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/template.rb:67:in `__standard_component'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/template.rb:54:in `content'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:145:in `create'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:33:in `block in compose'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:15:in `each'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/divcomposite.rb:15:in `compose'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/state.rb:240:in `new'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/state.rb:240:in `view'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/state.rb:173:in `to_html'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:478:in `to_html'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:238:in `block in process_rack'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:207:in `synchronize'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/session.rb:207:in `process_rack'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/sbsm-1.3.8/lib/sbsm/app.rb:119:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:49:in `_call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:37:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/content_length.rb:15:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/static.rb:149:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/common_logger.rb:33:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:49:in `_call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/lint.rb:37:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/common_logger.rb:33:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/chunked.rb:54:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/content_length.rb:15:in `call'
        /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/rack-2.0.2/lib/rack/handler/webrick.rb:86:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'

Folgende Tests laufen um 8:20 nicht.

  • Wenn man als admin-Benutzer eingeloggt is
    • Generate a new password. Ein neues Passwort wird generiert. Wenn man es anzeigen lässt, wird es jedoch immer mit neuen Werten aufgefrischt.

Folgende Tests habe ich noch nicht durchgeführt:

  • Set in etc/config.yml the update_hour to the next hour and verify that the import start
    • Select a user and

Trying to debug the error when displaying the Umsatz for 708427

[1] pry(#<BBMB::Model::Order>)> error
=> #<NoMethodError: undefined method `quantity' for nil:NilClass>
[2] pry(#<BBMB::Model::Order>)> @positions.size
=> 4
[3] pry(#<BBMB::Model::Order>)> @positions
ODBA::Stub was unable to replace BBMB::Model::Order::Position#269595 from Array:#269468
ODBA::Stub was unable to replace BBMB::Model::Order::Position#269594 from Array:#269468
ODBA::Stub was unable to replace BBMB::Model::Order::Position#269596 from Array:#269468
ODBA::Stub was unable to replace BBMB::Model::Order::Position#269597 from Array:#269468
=> [nil, nil, nil, nil]
[9] pry(#<BBMB::Model::Order>)> ODBA.cache.fetch(269595)
ODBA::OdbaError: Unknown odba_id 269595
from /var/www/virbac_rack.bbmb.ch/vendor/bundle/ruby/2.4.0/gems/odba-1.1.2/lib/odba/cache.rb:639:in `restore_object'

But fixing this error just goes a little bit farther, because the position itself is no longer valid. Should I replace it with an empty position?

Pushed commit Added some more manual tests

Reloaded the database again. Manual tests for displaying customer 708427 Umsatz and numerical total were successfull. Running bin/update_abschluss_artikel_artikel_fr_kunden. It finished without problems. Looking at 708427 I was able to see the umsatz by article and the orders, where the order/order_id/708427-162 did not have any items.

Installing the new rack based virbac on thinpower

The following tasks are completed:

  • Install Ruby 2.4.0 on fastpower (Copying /usr/local/src/gen_ruby_240 from thinpower)
  • Update virbac-yus to Ruby 2.3.1 ad /usr/local/bin/yusd is also used by sandoz.bbmb.ch-yus, I use also Ruby 2.3.1 and not 2.4.0 for it
  • Adapt etc/*.yml. It looks for me that we do not need to make any changes

Pending

  • Install virbac with bundle install and Ruby 2.4.0
    • sudo -u bbmb git pull https://github.com/ngiger/virbac.bbmb.ch.git
    • sudo -u bbmb /usr/local/bin/bundle-240 install --without debugger
    • Testing whether it starts without problems sudo -u bbmb /usr/local/bin/bundle-240 exec rackup. This leads to problem, as it cannot create a log directory Permission denied @ rb_sysopen - /var/www/virbac.bbmb.ch/log/2017/05/16/app_log. The directory /var/www/virbac.bbmb.ch/log/2017/05/16 belongs to the root user. This must be fixed by changing the CustomLog in the apache config to use also the bbmb user. E.g. replace |CustomLog by |sudo -u bbmb /usr/sbin/cronolog
    • sudo chown -R bbmb:bbmb log
    • Now sudo -u bbmb /usr/local/bin/bundle-240 exec rackup starts successfully
  • Adapt Apache config
  • sudo /etc/init.d/apache2 reload

Folgende Tests habe ich selber mit manuell klicken auf virbac.bbmb.ch ausprobiert und sie funktionieren.

  • login as a normal user The home Warenkorb should appear with a least of product
    • visiting the following links should work
      • Warenkorb (Home)
      • Archiv
      • Schnellbestellung
        • Suche nach HPM zeigte 42 Produkt. Konnte 1 der Schnellbestätigung hinzufügen
      • Katalog
      • Abschlüsse
      • Promotionen
      • Kalkulieren (Ändern des Faktors auf 2 und Drücken auf Neu berechnen läuft)
      • Passwort ändern
      • Abmelden und anmelden mit neuem Passwort
  • login as admin user
    • Select a user (claude & perk)
    • Umsatz -> Artikel und Total -> Bestellung funktionieren.

Fix problem setting password

Pushed commit Fix sorting customers by last_login

Found also that SBSM.warn was used inside lib/sbsm/state.rb but not implmented anywhere. Fixed with commit Fixed and tested SBSM.warn and SBSM.error

Added some debug statements to see whether updater and invoicer start at 12 00. Pushed commits

Result: Updater will start at the specified hours. Invoicer will

 start on first day of next month (15 days from now). At the moment there is no easy way to force running the invoicer at an earlier day/hour.

Pushed Bumped version to 2.1.6

As admin user setting the password for a user work. Generating a new one however has the problem that trying to display it start a loop which can be interrupte on firefox, but not on chrome. Must fix this problem.

By placing a binding.pry for POST requests in lib/sbsm/app.rb I was able to see, that the requests for the show_pass were mostly identical, e.g parameter like cookie match). Only some Ruby object-id do not match. Looking at the implementation I find that it is one of the rare view which have the VOLATILE constant set to true. Is this something I do not handle yet correctly in the rack based SBSM?

The state changes. Here some log entries

DEBUG -- : session.rb:373:in `logout' logout "/" setting @state 70204269719000 BBMB::Html::State::Login remember nil SBSM::UnknownUser
DEBUG -- : session.rb:217:in `block in process_rack' active_state.trigger state 70204269719000 BBMB::Html::State::Login remember nil
DEBUG -- : session.rb:226:in `block in process_rack' Changing from 70204269719000 to state BBMB::Html::State::Login 70204269719000 remember nil  SBSM::UnknownUser
DEBUG -- : session.rb:217:in `block in process_rack' active_state.trigger state 70204269003620 BBMB::Html::State::Customers remember nil
DEBUG -- : session.rb:226:in `block in process_rack' Changing from 70204269719000 to state BBMB::Html::State::Customers 70204269003620 remember nil  BBMB::Html::Util::KnownUser

"POST /de/bbmb HTTP/1.1" 200 10924 2.1983
session.rb:217:in `block in process_rack' active_state.trigger state 70204194367780 BBMB::Html::State::Customer remember nil
session.rb:226:in `block in process_rack' Changing from 70204269003620 to state BBMB::Html::State::Customer 70204194367780 remember nil  BBMB::Html::Util::KnownUser
session.rb:217:in `block in process_rack' active_state.trigger state 70204194367780 BBMB::Html::State::Customer remember nil
session.rb:226:in `block in process_rack' Changing from 70204194367780 to state BBMB::Html::State::Customer 70204194367780 remember nil  BBMB::Html::Util::KnownUser

"POST /de/bbmb HTTP/1.1" 200 5751 1.7063
session.rb:217:in `block in process_rack' active_state.trigger state 70204281411940 BBMB::Html::State::ShowPass remember nil
session.rb:230:in `block in process_rack' Stay in volatile state 70204281411940 BBMB::Html::State::ShowPass
session.rb:217:in `block in process_rack' active_state.trigger state 70204194367780 BBMB::Html::State::Customer remember nil
session.rb:226:in `block in process_rack' Changing from 70204194367780 to state BBMB::Html::State::Customer 70204194367780 remember nil  BBMB::Html::Util::KnownUser

"POST /de/bbmb HTTP/1.1" 200 5751 17.2648
session.rb:217:in `block in process_rack' active_state.trigger state 70204279803720 BBMB::Html::State::ShowPass remember nil
session.rb:230:in `block in process_rack' Stay in volatile state 70204279803720 BBMB::Html::State::ShowPass
session.rb:217:in `block in process_rack' active_state.trigger state 70204194367780 BBMB::Html::State::Customer remember nil
session.rb:226:in `block in process_rack' Changing from 70204194367780 to state BBMB::Html::State::Customer 70204194367780 remember nil  BBMB::Html::Util::KnownUser

"POST /de/bbmb HTTP/1.1" 200 5751 10.9499
session.rb:217:in `block in process_rack' active_state.trigger state 70204277991800 BBMB::Html::State::ShowPass remember nil
session.rb:230:in `block in process_rack' Stay in volatile state 702042779

Moved some methods (start_service) for the App class from virbac to bbmb. Now I am able to change the email-address the user 4039, but when trying to change the email-address of the 702329 I get the error => #<Yus::DuplicateNameError: Duplicate name: balber@bluewin.ch>

Pushed commit

When trying to the the (old) e-Mail address for customer 702329 I get the following error message

Ihre Eingaben konnten nicht gespeichert werden da Angaben fehlen oder nicht korrekt sind.
Bitte ergänzen Sie die rot gekennzeichneten Felder.
Das Benutzerprofil wurde nicht gespeichert!
Es gibt bereits ein Benutzerprofil für diese Email-Adresse

I must find a way to work around the database problem. In the pry session it was easy to set the email attribute of the given customer to the name wrongly returned as duplicate entry. After setting the password I was able to login as this user, but the old orders are gone, but I could still see Quotas and over 10 promotions. Looks like the orders were really damaged.

But I think it would be better to see, whether I can get the admin interface working again.

Zeno found another error. Eg. it is easily possible to set the customer 4325 the e-mail address of another customer. This may not happen.

Using the old virbac to try to understand how it worked before. See in a a pry session that in lib/bbmb/util/server.rb @ line the autosession is defined like this.

[2] pry(#<BBMB::Util::Server>)> session2 =  BBMB.auth.autosession(BBMB.config.auth_domain) 
DRb::DRbRemoteError: undefined method `call' for nil:NilClass (NoMethodError)
from (druby://127.0.01:12003) /usr/local/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/yus-1.0.4/lib/yus/server.rb:22:in `autosession'

Looks like we have two implementations to change the email: rename_user in lib/bbmb/html/state/customer.rb @ line 91 and update_user lib/bbmb/util/server.rb @ line 62. This is wrong! Will be fixed tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on May 16, 2017, at 05:22 PM