User tests: Successful: Unsuccessful:
Summary of Changes
If there is a minyear in the future or a maxyear in the past, this pr sets the todaybutton attribute to "false"
Testing Instructions
Take any calendar field, for examle com_content/models/forms/article.xml
Modify the field "publish_up" like this, i.e. add the attribute maxyear="-2" or minyear="+4".
<field
id="publish_up"
name="publish_up"
type="calendar"
label="JGLOBAL_FIELD_PUBLISH_UP_LABEL"
description="JGLOBAL_FIELD_PUBLISH_UP_DESC"
class="inputbox"
translateformat="true"
showtime="true"
size="22"
filter="user_utc"
minyear="+1"
/>
Open an article for editing and go the publishing tab.
Expected result
The calendar takes only Dates for the next year or later.
Actual result
If the the attribute todayButton is not explictely set to "false", there is a today button. The user can enter todays date
Apply the patch and refresh, the today button has gone
Documentation Changes Required
No
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I have tested this item
Modified administrator/components/com_content/models/forms/article.xml
using given Example. No "Today"-Button, only next Year (2018) is shown.
@franz-wohlkoenig Strange, I just tested, and with patch not only the "Today" but also the "Clear" button disappeared. Can you confirm that?
I have tested this item
Thanks for hint, @richard67. Using PR "Clear"- and "Today"-Button are not shown.
From code review this PR seems to be OK for me. I have no idea whiy it makes the "Clear" button disappear because this button is not handled in the function which is modified by this PR.
This is another issue, independent from this one. If the todaybutton is set to false, no matter which values are in maxyear and minyear, the "clear" button is net rendered.
I do not know if this is a bug or a feature ;)
How do I set the button to false for a test without this PR?
Add the attribute todaybutton="false" in any calendarfield.
I've found the concerning piece of code.
if (this.params.showsTodayBtn) {
this._nav_save = hh(JoomlaCalLocale.save, '', 100, 'a', '', 'js-btn btn btn-clear', {"data-action": "clear"});
So this seems to be a feature.
I have tested this item
Tested by modifying administrator/com_content/models/forms/article.xml (and not com_content/models/forms/article.xml as the testing instructions say) in the described way.
The fact that the "Clear" button disappears is not caused by this PR. I verified this by adding todaybutton="false" to the attibutes of the publish_down field.
@franz-wohlkoenig Can you alter your test result to "success"? We found that it is not a problem caused by this PR, see comments above and in my test result. No need to test again, there was nothing changed in this PR meanwhile.
@chmst An ugly feature from my point of view. If you think the same and will make a PR to change that, I will help with a test.
@richard67 thank you for testing. And yes, this behaviour is faulty in my opinion too. I'll open an issue.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-20 11:27:23 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
Tabs removed, thank you for the hint, @Quy.