Default value for due date not work
Moderators: Developer, Contributor
Default value for due date not work
Hi all,
I don't understand why not work the setting of default value for due date.
I tried many ways:
- via configuration option as below - via configuration_default_inc.php, as below
$g_due_date_default = 'today';
I also set up:
$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = REPORTER;
When I report a bug, in db table the stored value is 1 and the page show null, as below
Thanks to who will be able to help me.
Bye,
Cristian
I don't understand why not work the setting of default value for due date.
I tried many ways:
- via configuration option as below - via configuration_default_inc.php, as below
$g_due_date_default = 'today';
I also set up:
$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = REPORTER;
When I report a bug, in db table the stored value is 1 and the page show null, as below
Thanks to who will be able to help me.
Bye,
Cristian
- Attachments
-
- configuration default inc
- configuration_defaults_inc.jpg (29.54 KiB) Viewed 7682 times
Re: Default value for due date not work
See here for an explanation:
https://www.php.net/manual/en/function.strtotime.php
So you can add the following line to \core\config_inc.php:
This will give a due-date of today ( June 25th) + 5 days, giving June 30th
https://www.php.net/manual/en/function.strtotime.php
So you can add the following line to \core\config_inc.php:
Code: Select all
$g_due_date_default = '+5 days';
Re: Default value for due date not work
Hi Cas,
thanks for your anwser, but my problem is that the value will not stored in db.
Of course, my MantisBT version is 2.24.1 and as I wrote, I tried many values, i.e.:
$g_due_date_default = 'today';
in /config_defaults_inc.php and in /config/config_inc.php.
I tried also with a new file /core/config_inc.php as you wrote, but with the same result.
Why the default value not stored?
Thank you again.
Cristian
thanks for your anwser, but my problem is that the value will not stored in db.
Of course, my MantisBT version is 2.24.1 and as I wrote, I tried many values, i.e.:
$g_due_date_default = 'today';
in /config_defaults_inc.php and in /config/config_inc.php.
I tried also with a new file /core/config_inc.php as you wrote, but with the same result.
Why the default value not stored?
Thank you again.
Cristian
Re: Default value for due date not work
I will check it on my server to see if it is a bug or not.
Will let you know tomorrow
Will let you know tomorrow
Re: Default value for due date not work
Works perfectly on my instance.
Please verify the following settings also:
please change to (in config/config_inc.php):
Please verify the following settings also:
Code: Select all
$g_due_date_update_threshold = NOBODY;
$g_due_date_view_threshold = NOBODY;
Code: Select all
$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = VIEWER;
Re: Default value for due date not work
Hi cas,
I did:
[/config_defaults_inc.php]
[/core/config_inc.php]
but now I no longer see the field in frontend (I no longer see due date field):
and I didn't solve my problem because in db the value is still 1:
Maybe the system doesn't read the /core/config_inc.php file?
Please help me understand what I did wrong, give me some ideas.
Thank you,
Cristian
I did:
[/config_defaults_inc.php]
Code: Select all
$g_due_date_update_threshold = NOBODY;
$g_due_date_view_threshold = NOBODY;
Code: Select all
$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = VIEWER;
Please help me understand what I did wrong, give me some ideas.
Thank you,
Cristian
Re: Default value for due date not work
Cristian,
never change values in config_deafults_inc.php, only in config/config_inc.php
These are my values:
never change values in config_deafults_inc.php, only in config/config_inc.php
These are my values:
Not sure what happened in the past but did you also created a new issue to see how it goes?$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = VIEWER;
$g_due_date_default = '+21 days';
Re: Default value for due date not work
It doesn't .
As cas pointed out, the system reads config/config_inc.php
Re: Default value for due date not work
Hi cas,
I tried as you wrote, so in my config/config_inc.php:
but the value stored in db is always "1":
Why in db the value is "1"?
However now I see the field in the page view, but without value:
If I put manually the value I can see the right value:
Any other idea for insert the value automatically?
Thanks,
Cristian
Yes, I created the same issue and I deleted it as duplicate.
I tried as you wrote, so in my config/config_inc.php:
Code: Select all
$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = VIEWER;
$g_due_date_default = 'today';
However now I see the field in the page view, but without value:
If I put manually the value I can see the right value:
Any other idea for insert the value automatically?
Thanks,
Cristian
Re: Default value for due date not work
No more clues.
I have tested this on a vanilla installation of 2.24.1 and it works like a charm
I have tested this on a vanilla installation of 2.24.1 and it works like a charm
Re: Default value for due date not work
As a first step I recommend to
- restore original config_defaults_inc.php
- try with English language settings
Have you changed $g_datetime_picker_format or $g_normal_date_format ?
- restore original config_defaults_inc.php
- try with English language settings
Have you changed $g_datetime_picker_format or $g_normal_date_format ?
Re: Default value for due date not work
Hi atrol,
Unfortunatly, the result not changed:
I don't understand...
done
done:
Yes, but now I restored the initial values.
Unfortunatly, the result not changed:
I don't understand...
Re: Default value for due date not work
Did you remove the due_date_default setting from database ?
I suspect it's stell there what you have done on your very first sreenshot, so this value is taken and not the one from config_defaults_inc.php
Is the field "Due Date" populated with a value after clicking "Report Issue" ?
Do you see the calendar icon right beside the field ?
If not, check browser console for errors or warnings you might get.
I suspect it's stell there what you have done on your very first sreenshot, so this value is taken and not the one from config_defaults_inc.php
Is the field "Due Date" populated with a value after clicking "Report Issue" ?
Do you see the calendar icon right beside the field ?
If not, check browser console for errors or warnings you might get.
Re: Default value for due date not work
Hi atrol and cas,
I understood that was the problem:
I had entered a value in configuration option for bug_report_page_fields:
which did not allow to set the default due date correctly.
Thanks for your support!
I understood that was the problem:
I had entered a value in configuration option for bug_report_page_fields:
Code: Select all
array (
1 => 'category_id',
2 => 'summary',
3 => 'description',
)
Thanks for your support!
Re: Default value for due date not work
Is this considered fixed? I am seeing a similar issue with version 2.25.2. Here's the situation:
I recently set up a new MantisBT system using version 2.22.2 and set the following in config_inc.php:
$g_due_date_update_threshold = 10;
$g_due_date_view_threshold = 10;
$g_due_date_default = '+14 days';
This had the effect of setting the default due date 14 days out, which is what we wanted.
Then I upgraded the system from 2.22.2 to 2.25.2 to fix a different problem we were having with setting a default for a custom Date field. Basically I replaced all the files in the mantis folder with the new ones, and copied over the files from the old /config folder to the new one.
We're using same database and same customized config files, but the due date default no longer works - the due date is always blank when we open the report issues screen.
Running on a Windows platform with PHP 7.3.9 and MySQL 8.0.18.
I recently set up a new MantisBT system using version 2.22.2 and set the following in config_inc.php:
$g_due_date_update_threshold = 10;
$g_due_date_view_threshold = 10;
$g_due_date_default = '+14 days';
This had the effect of setting the default due date 14 days out, which is what we wanted.
Then I upgraded the system from 2.22.2 to 2.25.2 to fix a different problem we were having with setting a default for a custom Date field. Basically I replaced all the files in the mantis folder with the new ones, and copied over the files from the old /config folder to the new one.
We're using same database and same customized config files, but the due date default no longer works - the due date is always blank when we open the report issues screen.
Running on a Windows platform with PHP 7.3.9 and MySQL 8.0.18.