Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change config boolean examples #15

Closed
lmcglohon opened this issue Mar 1, 2018 · 2 comments
Closed

Change config boolean examples #15

lmcglohon opened this issue Mar 1, 2018 · 2 comments

Comments

@lmcglohon
Copy link
Contributor

Moved from Archivesspace repo (archivesspace/archivesspace#918):

From hietpasd (https://github.com/hietpasd):

Pretty minor but threw me for a loop. At least in version 2.1, I kept getting DB connection errors.

The config.rb example shows:
#AppConfig[:allow_unsupported_database] = false
#AppConfig[:allow_non_utf8_mysql_database] = false

The example output from the error log files suggest you change it to this:
AppConfig[:allow_unsupported_database] = "true"
AppConfig[:allow_non_utf8_mysql_database] = "true"

I thought it was odd that it switched from bool to string so I tried first the bool approach
AppConfig[:allow_unsupported_database] = true
AppConfig[:allow_non_utf8_mysql_database] = true

and the bool approach ended up not working. I did what the log suggested and switched it to a string and it worked.

I'd recommend making a change to the config.rb examples to use the correct syntax.

@djpillen
Copy link

djpillen commented Apr 4, 2018

Is there are reason why this is handled in this way in backend/model/db.rb?

The check for allow_non_utf8_mysql_database on L53 looks like this:

if !@opts[:skip_utf8_check] && pool.database_type == :mysql && AppConfig[:allow_non_utf8_mysql_database] != "true"

While the check for allow_unsupported_database on L38 looks like this:

if !AppConfig[:allow_unsupported_database]

It looks like this functionality was introduced in a commit way back in 2013 that added a bool config default but checked for a string in backend/model/db.rb: archivesspace/archivesspace@ab474cf#diff-542cef02fd4b9728e596a5dd45c83069

Wouldn't it make more sense to change line 53 to this, so that the bool config example is correct?

if !@opts[:skip_utf8_check] && pool.database_type == :mysql && !AppConfig[:allow_non_utf8_mysql_database]

@lmcglohon
Copy link
Contributor Author

After discussion with the technical documentation team, we decided to move this issue back to the main repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants