view · edit · sidebar · attach · print · history

20120926-debug-fachinfo-chapter-modification-prescription-search-style-chooser

<< 20120927-debug-loadpath-of-production-server-sbsm-update | 2012 | 20120925-style-chooser-update-fi-chapter-search >>


Summary

  • Debug Fachinfo-chapter-modification
  • Rebuild INDEX for prescription search
  • Debug SBSM for cookie

Commits

oddb.org
sbsm

Patches (sbsm)

Index


Rebuild INDEX for prescription search

In Production-Server, INEDX for prescription search was broken. Rebuild this INDEX.

ch.oddb> rebuild_indices 'oddb_package_name_with_size_company_name_and_ean13'
->

Debug SBSM user_input validation

input does not have :html_chapter.

{:chapter=>"galenic_form", :heading=>"Galenische Form und Wirkstoffmenge pro Einheit"}

user_input does not return text of html_chapter.

{:heading=>"Dosierung/Anwendung", :html_chapter=>"", :update=>nil, :flavor=>"gcc", :language=>"de", :event=>:update, :state_id=>70896300, :pointer=>#<SBSM::InvalidDataError: e_invalid_pointer>, :zone=>:drugs, :chapter=>"usage", :default_flavor=>"gcc"}

Check HTML Validation

ALLOWED_TAGS = %{a b br div font h1 h2 h3 i img li ol p pre span strong u ul}

validate checks only last element only.

 def validate(key, value)
      value = value.pop if value.is_a? Array
      return nil if value.nil?
      if value.is_a?(StringIO)
        if(@files.include?(key))
       ...
  end

:html_chapter had unexpected element as Array like this.

["<p style=...>...</span><br /></p>", ""]

src/view/fachinfo.rb

      def edit_chapter(model)
        editor = ChapterEditor.new(:html_chapter, model, @session, self)
        editor.value = model.send(@name)
        editor.label = true
        editor.css_id = "html-chapter"
        self.onsubmit = "this.html_chapter.value = dijit.byId('html-chapter').getValue();"
        editor
      end 
      def heading(model)
        HtmlGrid::InputText.new(:heading, model.send(@name), 
          @session, self)
      end 
      def hidden_fields(context)
        chapter = {'name' => 'chapter', 'value' => @name}
        html = {'name' => 'html_chapter', 'value' => ''} 
        super << context.hidden(chapter) << context.hidden(html)
      end 
commit

Update SBSM Cookie handling

I could not understand why this if statement is needed.

then I found also bug in cookie generation.

Patches

commit

Production Installation problem.

request.cookies returns Drb::DRbUnknown Object.

 undefined method `[]' for #<DRb::DRbUnknown:0x00000008dc5908>
@400000005063207a37f877e4 /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.0/lib/sbsm/session.rb:206:in `import_cookies'
@400000005063207a37f877e4 /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.0/lib/sbsm/session.rb:358:in `process'
@400000005063207a37f87bcc /var/www/oddb.org/src/util/session.rb:117:in `process'
@400000005063207a37f8c21c /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.0/lib/sbsm/session.rb:170:in `block in drb_process'
@400000005063207a37f8c604 <internal:prelude>:10:in `synchronize'
view · edit · sidebar · attach · print · history
Page last modified on December 16, 2013, at 04:34 PM