---
We must present a different view when payment via paypal is accepted for a PowerUser.
Fix was not difficult. See
First I must fix downloading and importing the analyses where swissmedic changed the format from xls to xlsx.
Remarked that the the columns G (taxnote, aka Kommentar) and H (labareas, aka Fach-Bereich) are always empty. Zeno checks whether this is itentional or not. Kommentar/Fach-Bereich were present in the old *.xls format.
Fixing an error handling the latest file(s). Adapted parsing rows to xlsx. Parsing goes fast, but updating afterwards takes a long time. Using ODBA.cache.transaction to delete_all_analysis_group makes used time go down from 90 seconds to 7 seconds. Will try it for update_group_position, too.
Killed update_analyses after almost two hours of running.
When I run now the update_analysis_group inside a transaction I get
failsafe rescued ArgumentError < StandardError wrong number of arguments (0 for 1) /var/www/oddb.org/src/util/oddbapp.rb:327:in `create_analysis_group' /var/www/oddb.org/src/util/persistence.rb:216:in `issue_create' /var/www/oddb.org/src/util/oddbapp.rb:110:in `block in create' /var/www/oddb.org/src/util/failsafe.rb:10:in `call' /var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe' /var/www/oddb.org/src/util/oddbapp.rb:109:in `create' /var/www/oddb.org/src/command/create.rb:11:in `execute' /var/www/oddb.org/src/util/oddbapp.rb:663:in `execute_command' /var/www/oddb.org/src/util/oddbapp.rb:1448:in `create' /var/www/oddb.org/src/plugin/analysis.rb:136:in `update_group' /var/www/oddb.org/src/plugin/analysis.rb:52:in `block (2 levels) in update_group_position' /var/www/oddb.org/src/plugin/analysis.rb:50:in `each' /var/www/oddb.org/src/plugin/analysis.rb:50:in `block in update_group_position' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:559:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:559:in `block in transaction' /usr/local/lib/ruby/site_ruby/1.9.1/dbi/handles/database.rb:209:in `transaction' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:39:in `block in method_missing' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:29:in `next_connection' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:38:in `method_missing' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:555:in `transaction' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:560:in `transaction' /var/www/oddb.org/src/plugin/analysis.rb:49:in `update_group_position' /var/www/oddb.org/src/plugin/analysis.rb:39:in `update' /var/www/oddb.org/src/util/updater.rb:217:in `block in update_analysis' /var/www/oddb.org/src/util/updater.rb:497:in `call' /var/www/oddb.org/src/util/updater.rb:497:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:215:in `update_analysis' jobs/update_analysis: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/update_analysis:12:in `<module:Util>' jobs/update_analysis:11:in `<module:ODDB>' jobs/update_analysis:10:in `<main>' undefined method `oid' for #<ArgumentError: wrong number of arguments (0 for 1)>
Found the culprit. Fixing the error.
Got the following error yesterday when calling spec/paypal_spec.rb
ODDB-Client-Error: method `method_missing' called on terminated object (0x0000000be44c28 flags=0x0 klass=0x0) NotImplementedError (druby://localhost:10000) /var/www/oddb.org/src/model/fachinfo.rb:91:in `localized_name' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10000) /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:349:in `name' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:143:in `create' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:33:in `block in compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `each' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:12:in `block in compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:10:in `each' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:10:in `each_with_index' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divlist.rb:10:in `compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:140:in `new' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:140:in `create' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:33:in `block in compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `each' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/divcomposite.rb:13:in `compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' (druby://localhost:10000) /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:412:in `new' (druby://localhost:10000) /var/www/oddb.org/src/view/drugs/centeredsearchform.rb:412:in `rss_feeds_left' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' (druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:62:in `new' (druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:62:in `content' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' (druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:59:in `init' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:245:in `new' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:245:in `view' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:181:in `to_html' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/session.rb:447:in `to_html' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/session.rb:173:in `block in drb_process' (druby://localhost:10000) <internal:prelude>:10:in `synchronize' (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/session.rb:171:in `drb_process' (druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' (druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform' (druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' (druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop' (druby://localhost:10000) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:163:in `drb_process' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:66:in `process' /var/www/oddb.org/doc/index.rbx:21:in `<top (required)>' /usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `load' /usr/lib64/ruby/1.9.1/apache/ruby-run.rb:53:in `handler' ODDB-Client-Error: method `method_missing' called on terminated object (0x0000000be44c28 flags=0x0 klass=0x0)
Trying to reproduce the error today. The error does not occur again, but I see that granting PowerUser in a PayPal return does not exactly what I want. Adding @session.yus_set_preference(invoice.yus_name, 'poweruser_duration', invoice.max_duration)
as in ipn.rb.
Remarked that in bin/admin create_poweruser does not work as there is no place where a class PowerUser is defined. Probably this concept was never really implemented in all details. The method was created in 2005. Class PowerUser was removed from src/model/user.rb in 2008 without changing any unit tests.
Corrected watir spec test to not visit the unlimited access link, which leads to an appdown.html error. A new PowerUser can visit as many drugs as he wants, but for downloading the results of a CSV he must pay via paypal. I don't know whether this corresponds to expected business model. Running all spec tests before pushing my commits.
Pushed commit Fix paypal checkout for csv and download