i18n branch publication date error

0 views
Skip to first unread message

Claudia Jürgen

unread,
Nov 22, 2011, 9:18:23 AM11/22/11
to bibap...@googlegroups.com
Hello,

just updated to the latest i18n and noticed an error when trying to
display a work de/works/3267.

ActionView::Template::Error (undefined method `publication_date' for
#<JournalArticle:0x60805b0>):
1: -# must pass field parameter. May pass label parameter,
otherwise computed from field
2: -# for i18n we'll want to take the field name from the model
translations here instead
3: - label ||= @work.class.human_attribute_name(field)
4: - if @work.send(field).present?
5: %tr
6: %td.label #{label}:
7: %td #{@work.send(field)}
app/views/works/metadata/_generic_field.html.haml:4:in `send'
app/views/works/metadata/_generic_field.html.haml:4:in
`_app_views_works_metadata__generic_field_html_haml___1871677802_53059800_8537804'
app/views/works/_metadata.html.haml:24:in
`_app_views_works__metadata_html_haml__805315193_51603880_464030'
app/views/works/show.html.haml:25:in
`_app_views_works_show_html_haml___356056423_49382800_0'
app/views/layouts/_main_body_no_h2.html.haml:3:in
`_app_views_layouts__main_body_no_h__html_haml__1131464692_48987600_4130110'
app/views/works/show.html.haml:14:in
`_app_views_works_show_html_haml___356056423_49382800_0'


Changing
app/views/works/metadata/_metadata.html.haml

= render 'works/metadata/generic_field', :field => :publication_date
to
= render 'works/metadata/generic_field', :field =>
:publication_date_string
worked (apart from the yet missing label)


Have a nice day

Claudia


--
Claudia Juergen
Universitaetsbibliothek Dortmund
Eldorado
0231/755-4043
https://eldorado.tu-dortmund.de/

Howard Ding

unread,
Nov 22, 2011, 11:35:59 AM11/22/11
to bibap...@googlegroups.com
Thanks for catching this. It's a bit of a side effect from allowing the
publication date to be coarser than an exact day.

What's supposed to happen is for
app/views/works/metadata/_publication_date.html.haml to be rendered
instead of the generic partial. I must have messed this up in the merge
somehow.

I've pushed this up to github.

Howard

Claudia Jürgen

unread,
Nov 23, 2011, 9:29:32 AM11/23/11
to bibap...@googlegroups.com
Hello Howard,

now I'm getting a slightly different error:

ActionView::Template::Error (undefined method `publication_date_day' for
#<JournalArticle:0x67bb9b0>):
42:
43: .links
44: - unless links_array.include? 'none'
45: = links_array.collect {|link| work_action_link(link,
work, @return_path, @saved)}.compact.join(' | ').html_safe
46:
47: .clear-both
app/models/work.rb:797:in `publication_date_string'
app/models/work.rb:742:in `open_url_kevs'
app/helpers/application_helper.rb:48:in `coin'
app/helpers/application_helper.rb:26:in `link_to_findit'
app/helpers/shared_helper.rb:126:in `work_action_link'
app/views/shared/_work.html.haml:45:in
`_app_views_shared__work_html_haml__161233878_56224440_828350'
app/views/shared/_work.html.haml:45:in `collect'
app/views/shared/_work.html.haml:45:in
`_app_views_shared__work_html_haml__161233878_56224440_828350'
app/views/works/_first_works.html.haml:6:in
`_app_views_works__first_works_html_haml___1865865048_56270720_3568670'
app/views/works/_first_works.html.haml:5:in `each'
app/views/works/_first_works.html.haml:5:in
`_app_views_works__first_works_html_haml___1865865048_56270720_3568670'
app/views/works/index.html.haml:32:in
`_app_views_works_index_html_haml___1788019693_56659960_0'
app/views/layouts/_main_body_no_h2.html.haml:3:in
`_app_views_layouts__main_body_no_h__html_haml__322830375_56406920_3921790'
app/views/works/index.html.haml:17:in
`_app_views_works_index_html_haml___1788019693_56659960_0'


Claudia

--

Howard Ding

unread,
Nov 23, 2011, 10:14:56 AM11/23/11
to bibap...@googlegroups.com
Hi Claudia,

Have you run the migrations on the database?

Howard

Claudia Jürgen

unread,
Nov 23, 2011, 10:23:18 AM11/23/11
to bibap...@googlegroups.com
Hello Howard,

that was it, changed only the development db and not the production one,
but starting bibapp with phusion passenger seems to somehow assume you
are running production.

Thanx for your help

Claudia

--

Howard Ding

unread,
Nov 23, 2011, 10:25:28 AM11/23/11
to bibap...@googlegroups.com
On 11/23/2011 9:23 AM, Claudia J�rgen wrote:
> Hello Howard,
>
> that was it, changed only the development db and not the production
> one, but starting bibapp with phusion passenger seems to somehow
> assume you are running production.
>

Right. If you want passenger to run in a different environment there are
config settings for that in either your Apache or Nginx config files, or
if you're using passenger standalone I believe there is a command line
option.

Howard

Claudia Jürgen

unread,
Nov 24, 2011, 8:42:12 AM11/24/11
to bibap...@googlegroups.com
Hello,

yes setting
RailsEnv development
in httpd.conf did the trick.

Thanx again for your help

Claudia

--

Reply all
Reply to author
Forward
0 new messages