プロジェクト

全般

プロフィール

Vote #68913

完了

Wiki fails to find pages with cyrillic characters using postgresql

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
開始日:
2011/01/07
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
30
issue_org_id:
7245
author_id:
26094
assigned_to_id:
0
comments:
14
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
20
ステータス-->[Closed]

説明

hello

I have updated my redmine from version 1.0.3 to version 1.0.5 (revision 4651) as write on Guide, but my wiki pages was deleted...

I looked postgres database, and found all my pages in it.

They also appear on the page table of contents.

But they dont work :(.
I traced that not displays (and does't create) only pages containing:
uppercase symbols
special chars (",' etc)

Now i rename all my pages to new right, but what to do in the future? or how can I solve the problem?

I write to "forum":http://www.redmine.org/boards/1/topics/20596.

My versions:

first ~ # ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
first ~ # rails -v
Rails 2.3.5
first ~ # postgres --version
postgres (PostgreSQL) 8.4.4
first redmine.iso.vc # svn update
At revision 4651

rack 1.0.1
redmine 1.0.5 r4651


journals

There is no database migration and no change in wiki controller/model in 1.0-stable, so I don't have a clue.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> There is no database migration and no change in wiki controller/model in 1.0-stable, so I don't have a clue.

May be problem in new version of i18n?

<pre>
gem install i18n -v=0.4.2
</pre>

--------------------------------------------------------------------------------
I don't think so.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> There is no database migration and no change in wiki controller/model in 1.0-stable, so I don't have a clue.

hello!

today i retest my redmine. I copy my backup and try to update it. That i see:
<pre>
first /vhosts # cp -R redmine.iso.vc.bak redmine.iso.vc.bak.test
first /vhosts # cd redmine.iso.vc.bak.test
first redmine.iso.vc.bak.test # svn update > upd.txt
first redmine.iso.vc.bak.test # cat upd.txt | grep wiki
U test/unit/wiki_test.rb
U test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
U test/unit/lib/redmine/wiki_formatting/macros_test.rb
U test/unit/lib/redmine/wiki_formatting.rb
U test/unit/wiki_redirect_test.rb
U test/unit/wiki_content_test.rb
U test/unit/wiki_page_test.rb
U test/functional/wikis_controller_test.rb
U test/functional/wiki_controller_test.rb
U app/models/wiki.rb
U app/controllers/wiki_controller.rb
U app/views/wiki/history.rhtml
U app/views/wiki/diff.rhtml
</pre>

I don't spec in svn/ruby, but i see that wiki is updated...

--------------------------------------------------------------------------------
And that i'am find in repository:
http://www.redmine.org/projects/redmine/repository/diff/trunk/app/models/wiki.rb?rev=4430&rev_to=3632

I think than this changes are bad.
May be problem in russian locale?

My lates version (1.0.3) revision is:
<pre>
first redmine.iso.vc.bak.test # svn info
Path: .
URL: http://redmine.rubyforge.org/svn/trunk
Repository Root: http://redmine.rubyforge.org/svn
Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 4388
Node Kind: directory
Schedule: normal
Last Changed Author: jplang
Last Changed Rev: 4388
Last Changed Date: 2010-11-08 01:38:10 +0300 (Пнд, 08 Ноя 2010)
</pre>
--------------------------------------------------------------------------------
Yes, it took place on my installation too (from 1.0.2 to 1.1.0), editing wiki pages will result in failure

<pre>
I18n::MissingInterpolationArgument (missing interpolation argument in "'%{page}' wiki页面已更\346\226\260" ({:id=>"Contacts"} given)):
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/i18n-0.4.2/lib/i18n/backend/base.rb:174:in `interpolate_without_deprecated_syntax'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/i18n-0.4.2/lib/i18n/backend/base.rb:46:in `translate'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/i18n-0.4.2/lib/i18n.rb:160:in `t'
lib/redmine/i18n.rb:13:in `l'
app/models/mailer.rb:198:in `wiki_content_updated'
app/models/wiki_content_observer.rb:25:in `after_update'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/observer.rb:185:in `notify_observers'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/observer.rb:184:in `each'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/observer.rb:184:in `notify_observers'
app/controllers/wiki_controller.rb:123:in `update'

</pre>
--------------------------------------------------------------------------------
After several attempts, I found an error:
problem in method .downcase - they don'n work with russian locale...

I am now looking for a solution...
--------------------------------------------------------------------------------
Artem Malahov wrote:
> After several attempts, I found an error:
> problem in method .downcase - they don'n work with russian locale...
>
> I am now looking for a solution...

For me solution is:
# install gem unicode
<pre>
first models # gem install unicode
</pre>
# replace code in /app/models/wiki.rb from
<pre>
# find the page with the given title
def find_page(title, options = {})
title = start_page if title.blank?
title = Wiki.titleize(title).downcase
page = pages.first(:conditions => ["LOWER(title) LIKE ?", title])
if !page && !(options[:with_redirect] == false)
# search for a redirect
redirect = redirects.first(:conditions => ["LOWER(title) LIKE ?", title])
page = find_page(redirect.redirects_to, :with_redirect => false) if redirect
end
page
end
</pre>
to
<pre>
# find the page with the given title
def find_page(title, options = {})
require 'unicode'
title = start_page if title.blank?
#title = Wiki.titleize(title).downcase
title = Unicode::downcase(Wiki.titleize(title))
page = pages.first(:conditions => ["LOWER(title) LIKE ?", title])
if !page && !(options[:with_redirect] == false)
# search for a redirect
redirect = redirects.first(:conditions => ["LOWER(title) LIKE ?", title])
page = find_page(redirect.redirects_to, :with_redirect => false) if redirect
end
page
end
</pre>
--------------------------------------------------------------------------------
Another option would be to let the database to the job:

page = pages.first(:conditions => ["LOWER(title) LIKE LOWER(?)", title])

Tested OK with postgresql and cyrillic.
--------------------------------------------------------------------------------
Changing affected version since 1.0.5 *stable* is not affected.
--------------------------------------------------------------------------------
Fix committed in r4680 in trunk. Please, can you confirm the fix?
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> Fix committed in r4680 in trunk. Please, can you confirm the fix?

yes. i update my revision and got a changes! Thank you!
--------------------------------------------------------------------------------
Merged in 1.1-stable in r4728.
Thanks for the feedback.
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョン1.1.1_30 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0