view · edit · sidebar · attach · print · history

Index>

20140325-fix-ajax-search-2

Summary

  • Fix Ajax search on chrome and Internet explorer

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • Search nach Anwendung (indications), z.B. Konjunktivitis, does not report all occurrences in the section "Anwendung" of Fachinfo. Probably index is corrupted or not set up correctly.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • vagrant-oddb.org: cleanup installation for yus with ruby 1.8, logrotate.conf and local vhosts for tests

---

Fix Ajax search on chrome and Internet explorer

Continuing searching the error from yesterday. Fixed some problems. When creating Javascipt-code from the ruby classes I forgot to replace \ by \\ plus some minor errors. Now there are still some tests failing when running the smoketest for chromium and firefox.

Looking at the bin/oddbd I find the following stack-trace

error in SBSM::Session#to_html: /de/gcc/search/zone/drugs/search_query/Losartan/search_type/st_sequence?
NoMethodError
undefined method `disable_patinfo' for "NAME":String
/var/www/oddb.org/src/model/sequence.rb:209:in `has_patinfo?'
/var/www/oddb.org/src/model/package.rb:101:in `has_patinfo?'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/view/additional_information.rb:383:in `patinfo'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/list.rb:67:in `block in compose_list'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/list.rb:65:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/list.rb:65:in `each_with_index'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/list.rb:65:in `compose_list'
/var/www/oddb.org/src/view/drugs/resultlist.rb:337:in `block in compose_list'
/var/www/oddb.org/src/view/drugs/resultlist.rb:332:in `each'
/var/www/oddb.org/src/view/drugs/resultlist.rb:332:in `compose_list'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/list.rb:54:in `compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/list.rb:129:in `init'
/var/www/oddb.org/src/view/drugs/resultlist.rb:271:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `new'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `create'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'
/var/www/oddb.org/src/view/drugs/result.rb:126:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `new'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `content'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'
/var/www/oddb.org/src/view/publictemplate.rb:60:in `init'
/var/www/oddb.org/src/view/resulttemplate.rb:29:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `new'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `view'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:181:in `to_html'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:447:in `to_html'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:173:in `block in drb_process'
<internal:prelude>:10:in `synchronize'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:171:in `drb_process'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
ODDB::View::Drugs::RootResultList::COMPONENTS[[5, 0]] in create(patinfo)
ODDB::View::Drugs::ResultComposite::COMPONENTS[[0, 2]] in create(ODDB::View::Drugs::RootResultList)
ODDB::View::Drugs::Result::COMPONENTS[[0, 2]] in create(content)
error in SBSM::Session#http_headers: /de/gcc/search/zone/drugs/search_query/Losartan/search_type/st_sequence?
NoMethodError
undefined method `disable_patinfo' for "NAME":String

Fixing this error by testing first whether the elements respond_to?(:has_patinfo?).

Now chrome and firefox pass all tests (except the known failing with sinovial when called via show/reg).

But I am wondering whether it is a good sign that I have the following errors when running the tests with chrome

#<Selenium::WebDriver::Error::StaleElementReferenceError: stale element reference: element is not attached to the page document
  (Session info: chrome=32.0.1700.123)
  (Driver info: chromedriver=2.9.248304,platform=Linux 3.12-0.bpo.1-amd64 x86_64)>
/opt/src/oddb.org/spec/interactions_spec.rb:66:in `block in add_one_drug_to_interactions'
/opt/src/oddb.org/spec/interactions_spec.rb:65:in `upto'
/opt/src/oddb.org/spec/interactions_spec.rb:65:in `each'
/opt/src/oddb.org/spec/interactions_spec.rb:65:in `add_one_drug_to_interactions'
/opt/src/oddb.org/spec/interactions_spec.rb:232:in `block (3 levels) in <top (required)>'
/opt/src/oddb.org/spec/interactions_spec.rb:232:in `each'

Testing with internet explorer shows, that we have the following errors:

  • In home_interactions/ adding a new receipt does nothing
  • In rezept it is possible to add a second drug, but the frames do not work as they should
  • Adding a third drug replaces the second drug

Setting up watir-tests for internet explorer requires the following surgery:

  • require 'watir' instead of 'watir-webdriver' for :ie
  • under windows you must manually delete an old screenshot with the same name.
  • you cannot work when watir tests are running, as ie always claims the focus
  • tests run (at least im my setup) way slower than under linux
  • use Gemfile.watir. Adding a helper script run_ie_watir_tests.cmd
  • cannot install racc without development kit. Therefore removing it from the Gemfile.watir.

When running the watir tests from IE I get the following error in bin/oddbd

NameError
uninitialized constant ODDB::Migel::Product
/var/www/oddb.org/src/view/drugs/centeredsearchform.rb:320:in `heading'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:143:in `create'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:33:in `block in compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `compose'
session 125 self.class ODDB::Session unparsed /
error in SBSM::Session#to_html: /
NameError

Pushed some minor changes:

Pushed now the real fix Fix ajax on chrome. Fix home_interactions without trailing slash. Must update to dojo-1.9.3 on thinpower (same procedure as described in http://dev.ywesee.com/Niklaus/20140319-add-interactions-to-prescription-2#upgrade-dojo). Seems okay, as verified by a javascript console

console.log(dojo.version.toString());
1.9.3 (fd52c96) VM1208:2
undefined
console.log(window.location);
Location {replace: function, assign: function, ancestorOrigins: DOMStringList, origin: "http://ch.oddb.org", hash: ""…}
 VM1209:2
undefined

TODO: for tomorrow are fixes (in this order) for

  1. both interactions for B01AA04: Phenprocoumon <=> M01AG01: Mefenaminsäure Erhöhtes Blutungsrisiko must be shown, regardsless in which order we added the medicaments, e.g. http://ch.oddb.org/de/gcc/home_interactions/7680317061142,7680353520153,7680193950301 (or only Ponstan and Marcoumar http://ch.oddb.org/de/gcc/rezept/ean/7680353520153,7680193950301)
  2. in the rezept there is a superfluos white space between the header an the interaction (if there an interaction)
  3. The field remark is (wrongly) pushed to the right, when we have large remarks. E.g http://ch.oddb.org/de/gcc/rezept/ean/7680353520153,7680193950301
  4. Printing a rezept does not work
  5. csv export of rezept does not work
view · edit · sidebar · attach · print · history
Page last modified on March 25, 2014, at 05:42 PM