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

error webm too long shows max length set in config.php and not instance-config.php #404

Closed
PVNFU-28 opened this issue Feb 14, 2021 · 4 comments · Fixed by #411
Closed

error webm too long shows max length set in config.php and not instance-config.php #404

PVNFU-28 opened this issue Feb 14, 2021 · 4 comments · Fixed by #411

Comments

@PVNFU-28
Copy link

I set the webm max length to 300 seconds on my instance-config.php file but when a user uploaded a webm longer than 300 seconds it still said "The uploaded webm is longer than 120 seconds"
So I thought maybe I have to copy the error config to instance-config.php so it detects the new length cap but even after that and a rebuild it still said 120 seconds, so I went to the config.php file and changed the 120 seconds cap to 300 seconds and now it works but I don't think this is intended as the config.php file says "WARNING: This is a project-wide configuration file and is overwritten when upgrading to a newer version of Tinyboard. Please leave this file unchanged"

@ctrlcctrlv
Copy link
Member

Are you using the new Composer-enabled version? I have a feeling this line:

"classmap": ["inc/"],

Is causing your problem. Config file loading order shouldn't be left up to composer.

@h00j
Copy link

h00j commented Feb 14, 2021

@panfu28, do you only have this problem with $config['webm']['max_length'], or is the whole inc/instance-config.php file not loading? The composer autoload doesn't affect how the configs are loaded - the logic is still the same in loadConfig():

require 'inc/instance-config.php';

@PVNFU-28
Copy link
Author

PVNFU-28 commented Feb 16, 2021

I haven't tested on the composer-enabled version. I've only had this problem with the $config['webm']['max_length'] line.
Someone suggested replacing the webmtoolong line with
$config['error']['webmtoolong'] = _('The uploaded webm is longer than %d seconds.');
but I haven't tested it yet.

@PVNFU-28
Copy link
Author

Okay, tested and replacing
$config['error']['webmtoolong'] = _('The uploaded webm is longer than ' . $config['webm']['max_length'] . ' seconds.');
with
$config['error']['webmtoolong'] = _('The uploaded webm is longer than %d seconds.');
Fixes the issue, will make PR

PVNFU-28 added a commit to PVNFU-28/vichan that referenced this issue Feb 17, 2021
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

Successfully merging a pull request may close this issue.

3 participants