User tests: Successful: Unsuccessful:
Pull Request for Issue #15251
Minor changes to the calendar script that allow reinitialising the calendar
Apply this patch
Go to Administrator and edit an existing article.
Open the browser inspector and inspect the button of the Start Publishing field.
Then change data-show-others="1" to "0"
Then run this in the browser's console:
JoomlaCalendar.init(document.querySelector('.field-calendar'));
the cal should reinitialise, to confirm open it again you should see the table without the days for prev/next month
Alternative test method (only js, also a hint how to do this client side):
Apply this patch
Go to Administrator and edit an existing article.
Open the browser console and copy/paste the following commands
document.getElementById('jform_publish_up_btn').setAttribute('data-show-others', 0);
JoomlaCalendar.init(document.querySelector('.field-calendar'));
the cal should reinitialise, to confirm open it again you should see the table without the days for prev/next month
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript |
Labels |
Added:
?
|
Category | JavaScript | ⇒ | JavaScript Unit Tests |
I've tested this patch following the instruction above. And it works as decribed.
But as much as I see, it does not resolve the issue. The calendars in our programs are not reinizialised. So please let me know what we have to change in our programs.
After changing the code, the calendar is initialised. But ina format which is not expected.
@chmst let's say that ajax success returns a date, all you have to do is set the appropriate attribute and initialise the calendar again. A dummy code (using jQuery):
/** For value we target the input **/
var newDate = "2010-01-01 00:00:00"; /** This comes from AJAX request **/
/** For calendar attributes we target the input id + `_btn` **/
jQuery('#'jform_publish_up_btn').attr('data-show-others', 0);
/** The field node **/
$field = jQuery('#jform_publish_up');
/** The calendar node **/
$calElement = $field.parent('.field-calendar');
/** Resetting attributes **/
$field.val(newDate);
$field.data('alt-value', newDate);
/** Reinitialise **/
JoomlaCalendar.init($calElement[0]); /** $calElement[0] will return the vanilla node!!! **/
Is this any helpful? If something still unclear let me know
The test case is still very easy:
Ajax request => call: #15251 (comment)
In 3.6 the calender works, in 3.7 not...
@bembelimen in 3.7 this code is the equivalent https://gist.github.com/dgt41/88a1a5fda0e88ff07e0723d85118fdba
It's still not B/C, wrong date format etc.
To be crystal clear here, I am happy if we find a way to handle the problem but I will not delay the release for this problem.
You are the boss ;) It works for me after I've adapted my programs for setting attributes in JHtml and replacing the calendar setup in js.
So for me the patch is successfull but the issue (b/c break) is a fact.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-23 14:33:16 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
I'm going to create a FAQ page based on the infos above when i'm back at home. Thanks for the work here!
Thanks to all - I am saved :)
So will the original issue reopened again? Because the b/c is still not fixed...
@bembelimen don't worry, I'm creating a PR that will cover the B/C break here, gimme 5 mins
@bembelimen please test #15489
The drone error has nothing to do with this change I'm going to send a new PR for this. Thanks @dgt41