Skip to content

"find_or_default" error when reloading with some plugins which use "deface" gem in Redmine 5.1 environmentย #67

@sanak

Description

@sanak

I encountered the following error when reloading with some plugins which use deface gem in Redmine 5.1-stable branch environment.

RuntimeError (There's no setting named plugin_redmine_message_customize):
  
app/models/setting.rb:361:in `find_or_default'
plugins/redmine_message_customize/app/models/custom_message_setting.rb:6:in `find_or_default'
plugins/redmine_message_customize/config/locales/custom_messages/ar.rb:1:in `load_rb'
plugins/redmine_custom_fields_groups/app/overrides/issues.rb:2:in `new'
plugins/redmine_custom_fields_groups/app/overrides/issues.rb:2:in `<module:Issues>'
plugins/redmine_custom_fields_groups/app/overrides/issues.rb:1:in `<top (required)>'
plugins/redmine_custom_fields_groups/init.rb:29:in `require_relative'
plugins/redmine_custom_fields_groups/init.rb:29:in `<top (required)>'
lib/redmine/plugin_loader.rb:31:in `load'
lib/redmine/plugin_loader.rb:31:in `run_initializer'
lib/redmine/plugin_loader.rb:108:in `each'
lib/redmine/plugin_loader.rb:108:in `block in load'

But, I couldn't find which plugin side causes the error, because deface side seems to require some hacks.
(But, sorry. I haven't checked the details about deface side yet... ๐Ÿ™‡๐Ÿ’ฆ)
https://github.com/jbbarth/redmine_base_deface/blob/master/init.rb#L13-L39

If someone know what could be the cause, telling us is really helpful... ๐Ÿ™ ๐Ÿ™‡โ€โ™‚๏ธ

Here is my minimum reproducible steps in one of our plugins which use deface gem.

  1. Setup env
    git clone [email protected]:redmine/redmine.git -b 5.1-stable redmine-message-customize
    cd redmine-message-customize
    # Create and adjust config/database.yml (We are using "postgresql" adapter)
    cd plugins
    git clone [email protected]:farend/redmine_message_customize.git
    git clone [email protected]:gtt-project/redmine_custom_fields_groups.git
    cd ../
    bundle install
    bundle exec rake db:create
    bundle exec rake db:migrate
    bundle exec rake db:fixtures:load
    bundle exec rake redmine:plugins:migrate
  2. Launch rails server
    bundle exec rails s -b 0
  3. Open http://localhost:3000 with a browser, then login and move to /projects path.
  4. Modify message customize plugin's ja locale file.
    --- a/config/locales/ja.yml
    +++ b/config/locales/ja.yml
    :
    -  label_default_messages: ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒกใƒƒใ‚ปใƒผใ‚ธใ‚’็ขบ่ชใ™ใ‚‹
    +  label_default_messages: ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒกใƒƒใ‚ปใƒผใ‚ธใ‚’็ขบ่ชใ™ใ‚‹123
  5. Reload the browser, then you will see the description top error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions