redmine_highlightjs
redmine_highlightjs copied to clipboard
1.0.2 code theme /my/account 404 Error
ActiveRecord::RecordNotFound (Couldn't find all CodeThemeUserSettings with 'id': (first, {:conditions=>["user_id = ?", 1]}) (found 0 results, but was looking for 2)):
lib/redmine/hook.rb:119:in `block (2 levels) in render_on'
lib/redmine/hook.rb:117:in `map'
lib/redmine/hook.rb:117:in `block in render_on'
lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
lib/redmine/hook.rb:61:in `each'
lib/redmine/hook.rb:61:in `block in call_hook'
lib/redmine/hook.rb:58:in `tap'
lib/redmine/hook.rb:58:in `call_hook'
lib/redmine/hook.rb:167:in `call_hook'
app/views/my/account.html.erb:34:in `block in _cc579177290608748590be8a74c21b3f'
app/helpers/application_helper.rb:1027:in `labelled_form_for'
app/views/my/account.html.erb:14:in `_cc579177290608748590be8a74c21b3f'
@marilawang: You problably missed db migration after upgrade, newer version introduces ability to set up theme per user and You seems to miss that.
I have run
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
Did that created "code_theme_user_settings" table in db? I just checked again 2.4, 2.6 and 3.1 and it works everywhere without error
Not work too
Migrating redmine_highlightjs (Syntax highlighting with highlightjs)...
== 2 CreateCodeThemeUserSettings: migrating ===================================
-- create_table(:code_theme_user_settings)
-> 0.4642s
== 2 CreateCodeThemeUserSettings: migrated (0.4645s) ==========================
Error:
ActiveRecord::RecordNotFound (Couldn't find all CodeThemeUserSettings with 'id': (first, {:conditions=>["user_id = ?", 1]}) (found 0 results, but was looking for 2)):
What versions are You running now?
1.0.2
What Ruby & Redmine version? :) I just checked and it's working on redmine2.4 + ruby 2.1.5
Environment:
Redmine version 3.1.1.stable
Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux]
Rails version 4.2.4
Environment production
Database adapter PostgreSQL
Plugin v1.0.1 work, v1.0.2 not
Krakozaber: plugin v.1.0.1 don't have option to redefine theme by user in his account settings, and Your error is about that option. On my tested versions error is not raised when nothing is found, so I didn't needed to catch it. I'll take some time to make plugin compatible to work with code review, and try to reproduce this, it should be easy to fix, but I need to see it :)
I was able to reproduce that and to fix it (I hope) Please review it :) (v1.0.3)
Hello people! I had the same issue.
Well, looking carefully the redmine migration, the tables were not created. Without them, when processing the account details page, an db error is masked by 404 error.
The reason? In the installation instructions of the main page, the plugin directory name is missing the letter "t" in the name: "redmine_highlighjs" should be "redmine_highlightjs".
To solve the problem, please follow these commands (at the redmine dir):
- Force uninstall the plugin:
$rake redmine:plugins:migrate NAME=redmine_highlightjs VERSION=0 RAILS_ENV=production
- Change the dir name:
$mv plugins/redmine_highlighjs/ plugins/redmine_highlightjs
- Execute the plugin migrations:
$bundle exec rake redmine:plugins:migrate RAILS_ENV=production
- Restart http server
I have already changed the README.md on my fork and submitted an pull request. I think that will solve the problem.