momentjs keep getting the following error moment.js:Deprecation warning: value provided is not in a recognized RFC2822 or ISO - laravel

I am trying to integrate maddhatter laravel-fullcalendar into a laravel app, I have the calendar working on most browsers but it fails on Internet Exprorer, when I do an inspect I get the deprecation warning.
My array looks like this:
$('#calendar-wean15RN').fullCalendar({
"header":{
"left":"prev,next today",
"center":"title",
"right":"month,agendaWeek,agendaDay"
},
"eventLimit":true,
"defaultDate":"Apr 2017",
"eventColor":"#3c8dbc !important",
"eventBackgroundColor":"#3c8dbc !important",
"eventBorderColor":"#3c8dbc",
"eventTextColor":"#fff !important",
"events":[{
"id":"1557",
"title":"xxx \nHrs worked:6.00",
"allDay":"true",
"start":"2017-04-03T09:00:00+00:00",
"end":"2017-04-03T15:00:00+00:00",
"url":"\/timesheet\/1557\/edit"
}]
}
Not sure what I am doing wrong.
The full error looks like this
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: Apr 2017, _f: undefined, _strict: undefined, _locale: [object Object]
Error
at Function.createFromInputFallback (js/moment.js:314:94)
at configFromString (js/moment.js:2172:11)
at configFromInput (js/moment.js:2541:9)
at prepareConfig (js/moment.js:2524:9)
at createFromConfig (js/moment.js:2491:40)
at createLocalOrUTC (js/moment.js:2578:12)
at Function.createUTC [as utc] (js/moment.js:81:12)
at makeMoment (js/fullcalendar.js:1197:21)
at FC.moment.parseZone (js/fullcalendar.js:1154:9)
at constructor.moment (js/fullcalendar.js:11795:30)
warn # moment.js:287

Change "defaultDate":"Apr 2017" to "defaultDate":moment("Apr 2017", "MMM YYYY").
FullCalendar docs state the defaultDate 's type is Moment.
As the warning says: value provided ("Apr 2017") is not in a recognized RFC2822 or ISO format; so you have to use moment(String, String) parsing function.

As it says here:
https://fullcalendar.io/docs/current_date/defaultDate/
defaultDate should also be an ISO8601 date string.
$('#calendar-wean15RN').fullCalendar(
{"header":{"left":"prev,next today","center":"title","right":"month,agendaWeek,agendaDay"},"eventLimit":true,"defaultDate":"2017-04-03T09:00:00+00:00","eventColor":"#3c8dbc !important","eventBackgroundColor":"#3c8dbc !important","eventBorderColor":"#3c8dbc","eventTextColor":"#fff !important","events":[{"id":"1557","title":"xxx \nHrs worked:6.00","allDay":"true","start":"2017-04-03T09:00:00+00:00","end":"2017-04-03T15:00:00+00:00","url":"\/timesheet\/1557\/edit"}]
}

Related

CKEDITOR4 Mentions Plugin with ajax : javascript error

I have a javascript error using CKEDITOR 4 and the Mentions Plugin.
I can't solve this problem for 2 days, I'm stuck.
I've used the online builder to get CKEDITOR + Mentions plugin.
See my build here: https://ckeditor.com/cke4/builder/fbe187b32ec7c025e28e01a537c72c62
With the following configuration it works fine: I see the drop down list with the names : Anna, Thomas, John
CKEDITOR.config.mentions = [{feed: ['Anna', 'Thomas', 'John']}];
However, when doing an ajax call to get the data, I got a javascript error:
The script /ajax_mention.php
displays
["Anna", "Thomas", "John"]
with the following configuration :
CKEDITOR.config.mentions = [{feed: '/ajax_mention.php'}];
when I type in the editor "#anna", the names do not display
the /ajax_mention.php script is launched and displays the correct data (when I look at the "network" tab on Chrome. see screenshot)
["Anna", "Thomas", "John"]
However, this triggers a javascript error (looking at the Chrome console tab. see screenshot)
ckeditor.js?1645882460:916 Uncaught TypeError: Cannot read properties of null (reading 'addClass')
at g.selectItem (ckeditor.js?1645882460:916:473)
at d.onSelectedItemId (ckeditor.js?1645882460:912:276)
at f.q (ckeditor.js?1645882460:10:246)
at f.fire (ckeditor.js?1645882460:12:91)
at f.select (ckeditor.js?1645882460:920:294)
at f.selectFirst (ckeditor.js?1645882460:920:371)
at d.open (ckeditor.js?1645882460:910:503)
at d.modelChangeListener (ckeditor.js?1645882460:911:234)
at f.q (ckeditor.js?1645882460:10:246)
at f.fire (ckeditor.js?1645882460:12:91)
See screen copy:
https://polyglotclub.com/bug_ckeditor_mentions.jpg
screen copy
The solution was given by the Ckeditor team : see https://github.com/ckeditor/ckeditor4/issues/5107
When we use a hardcoded data in the array, such as ['Anna, 'Geralt'] the createArrayFeed() function changes the input structure from the mentioned above to:
[
{
id: 1,
name: 'Anna'
},
{
id: 2,
name: 'Geralt'
}
]
I've just adjusted data on the backend side to the structure above.

Unable to programmatically create tags in GitHub - ISO8601 timestamp is invalid

In my lumen app I'm trying to programmatically create tags a GitHub repo. My setup is working great except something is up with the tagger.date that I can't figure out. The API is telling me that the timestamp is not valid:
[Github\Exception\RuntimeException]
Invalid request.
2016-07-10T13:32:07+0000 is not a valid date-time.
However the timestamp included in the error message appears to be correctly formatted based on the documentation.
$github->git()->tags()->create(
$githubConfig['namespace'],
$githubConfig['repository'],
[
'tag' => $this->version->patchTag(),
'tagger' => [
'name' => config('github.tagger.name'),
'email' => config('github.tagger.email'),
'date' => Carbon::now()->toIso8601String()
],
'message' => 'This release was automatically published by [Game-Watcher](https://github.com/bkuhl/game-watcher).',
'object' => $masterBranch['commit']['sha'],
'type' => 'commit'
]
);
This fiddle indicates the time format is valid.
Try using Carbon::now()->toAtomString() instead.
Carbon's common formatting methods are "wrappers for the common formats provided in the DateTime class".
The documentation for DateTime::ISO8601 carries this warning:
Note: This format is not compatible with ISO-8601, but is left this way for backward compatibility reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead.
The relevant difference appears to be with the timezone offset. DateTime::ISO8601 uses +0000 for UTC, while DateTime::ATOM uses +00:00.

Migration to CRM 2016: Unable to get property 'getPageData' of undefined or null reference

After migration from CRM 2013 to CRM 2016 (On Premise), we have error messages in the browser like:
Unable to get property 'getPageData' of undefined or null reference
Unable to get property 'className' of undefined or null reference
Unable to get property 'firstChild' of undefined or null reference
The error happens in components of CRM. Any idea, what the reason could be?
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unable to get property 'getPageData' of undefined or null reference</Message>
<Line>2083</Line>
<URL>/_static/form/formcontrols.js?ver=1804820318</URL>
<PageURL>/form/page.aspx?lcid=1033&themeId=f499443d-2082-4938-8842-e7ee62de9a23&tstamp=197130723&updateTimeStamp=635905304768102438&userts=131002784247688030&ver=1804820318#etc=2&extraqs=%3fetc%3d2%26id%3d%257b7DE4DCC6-207F-E511-9528-005056A03927%257d&pagemode=iframe&pagetype=entityrecord&counter=1455804831411</PageURL>
<Function>anonymousr:Unabletogetproperty'getPageData'ofundefinedornullreference</Function>
<FunctionRaw>TypeError: Unable to get property 'getPageData' of undefined or null reference</FunctionRaw>
<CallStack>
<Function>anonymousr:Unabletogetproperty'getPageData'ofundefinedornullreference</Function>
</CallStack>
</ScriptErrorDetails>
Try suggestion provided at the end of thread - https://community.dynamics.com/crm/f/117/p/190275/482107
When do errors occur?
I' v had similar error [1] on 8.2.2.112 when pressing Next Stage on Business Process Flow. Much effort was put into debugging so wanted to document it somwhere.
Rollup field
The error was caused by rollup fields that provides SUM for Money fields. The HTML generated by CRM and javascript function didn't match.
Guilty line is within /_static/form/formcontrols.js called on line 28871:
XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode)))))).innerHTML = CrmEncodeDecode.CrmHtmlDecode((this.$5_1.$3_2).get_currencySymbol());
This one returns null and it therefore spits error: XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode
Solution
FIX 1: Enable "Use legacy form rendering" under System Settings
OR Fix 2: Remove Currency rollup fields from form.
OR Fix 3: Create non-rollup fields that get calculated with workflow or plugin.
OR Fix 4: You may do some jQuery stuff and add some empty siblings which it -
expects. Except it may show duplicate currency symbol (at least for EUR currency) - one as prefix the other one as suffix.
OR Fix 5: Most undesirable way: patch that .js yourself if you're on-premises.
Replace line 28871:
XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode)))))).innerHTML = CrmEncodeDecode.CrmHtmlDecode((this.$5_1.$3_2).get_currencySymbol());
With:
if (XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode) !== null) {
XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode)))))).innerHTML = CrmEncodeDecode.CrmHtmlDecode((this.$5_1.$3_2).get_currencySymbol());
}
[1] Error:
<ScriptErrorDetails>
<Message>Cannot read property 'firstChild' of null</Message>
<Line>0</Line>
<URL>/form/page.aspx?lcid=1033&themeId=2cf54f8a-be4d-477c-a1f5-29b894a487ca&tstamp=53798526&updateTimeStamp=636392540341784672&userts=131546192871874626&ver=-1991520363#etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b586C2C21-E8F8-E611-80F5-005056BD19EE%257d%26opened%3dgrid%26process%3dc9426a91-9fc0-4c2d-a21c-4b9d2a38a6d5%26processts%3d51389819%26rskey%3d%257b00000000-0000-0000-00AA-000010003001%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010003001%7d&counter=1510145890205</URL>
<PageURL>/form/page.aspx?lcid=1033&themeId=2cf54f8a-be4d-477c-a1f5-29b894a487ca&tstamp=53798526&updateTimeStamp=636392540341784672&userts=131546192871874626&ver=-1991520363#etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b586C2C21-E8F8-E611-80F5-005056BD19EE%257d%26opened%3dgrid%26process%3dc9426a91-9fc0-4c2d-a21c-4b9d2a38a6d5%26processts%3d51389819%26rskey%3d%257b00000000-0000-0000-00AA-000010003001%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010003001%7d&counter=1510145890205</PageURL>
<Function>anonymous(dirtyVisiblePropertyData){var$v_0=dirtyVisiblePropertyData.getKeys();for(var$v_1=0;$v_1<$v_0.length;$v_1++){var$v_2=$v_0[$v_1];if(IsNull(this.get_viewMap().get_item($v_2))){}else{try{this.get_viewMap().get_item($v_2).update(dirtyVisiblePropertyD</Function>
<FunctionRaw>function (dirtyVisiblePropertyData) {
var $v_0 = dirtyVisiblePropertyData.getKeys();
for (var $v_1 = 0; $v_1 < $v_0.length; $v_1++) {
var $v_2 = $v_0[$v_1];
if (IsNull(this.get_viewMap().get_item($v_2))) {
</FunctionRaw>
<CallStack>
<Function>anonymous(dirtyVisiblePropertyData){var$v_0=dirtyVisiblePropertyData.getKeys();for(var$v_1=0;$v_1<$v_0.length;$v_1++){var$v_2=$v_0[$v_1];if(IsNull(this.get_viewMap().get_item($v_2))){}else{try{this.get_viewMap().get_item($v_2).update(dirtyVisiblePropertyData.get_item($v_2));}catch($v_3){Mscrm.CrmDebug.fail(String.format('ExceptionencounteredupdatingUIelement{0}:{1}',$v_2,$v_3.message));catchError($v_3.message,window.location.href,0,true);}}}}</Function>
<Function>anonymous(){if(this.$AV_1){var$v_0=this.$4h_1;this.$4h_1=new(Mscrm.TurboForm.Control.TypedDictionary$1.$$(Mscrm.TurboForm.Control.PropertyBag))();this.ui.updateUI($v_0);}}</Function>
<Function>anonymous(){this.$7A_1++;var$v_0=null;if(!this.$AE_1){setPerformanceMarkerTimestamp(String.format('UIUpdate{0}StartTime',this.$7A_1));$v_0=Xrm.Internal.startMetricsStopwatch(String.format('UIUpdate{0}',this.$7A_1));$v_0.start();}this.$8w_1=false;for(var$v_1=0;$v_1<this.$2F_1.length;$v_1++){var$v_2=this.$2F_1[$v_1];if(!IsNull($v_2)){$v_2.flushVisibilityChanges();}}if($v_0){$v_0.stop();setPerformanceMarkerTimestamp(String.format('UIUpdate{0}EndTime',this.$7A_1));}window.top.TurboFormLoadStartTime=null;}</Function>
<Function>anonymous(){Mscrm.Performance.PerformanceMarkerManager.get_instance().addMarker('MDDEnd',1);try{var$v_0=Xrm.Internal.startMetricsStopwatch('PostOnLoadUIUpdate');$v_0.start();this.finishUIUpdate();$v_0.stop();}finally{this.$Ih_1();this.updateFormDirtyState();try{if(isOutlookHostedWindow()){getOutlookHostedWindow().handlePostOnLoad();}}catch($$e_1){}}}</Function>
<Function>anonymous(){var$v_0=Xrm.Internal.startMetricsStopwatch('HandlePostOnLoad');$v_0.start();if(Mscrm.TurboForm.Control.PageManager.get_instance().$L_1===this){this.get_pidRequestManager().clearRecords();Mscrm.TurboForm.Control.PageManager.get_instance().handlePostOnLoad();var$v_1=Mscrm.TurboForm.Control.PageBootstrapper.getPageState();if(!IsNull($v_1)&&$v_1.formType!==7&&!$v_1.recordId.equals(Microsoft.Crm.Client.Core.Framework.Guid.get_empty())){Mscrm.TurboForm.Control.PageBootstrapper.requestSubGridData();}this.get_pidRequestManager().requestPidPtsWithLookupService();setAttributeInWindow('FormEntityLogicalName',(this.data.getEntity())?this.data.getEntity().getEntityName()||'':'');setAttributeInWindow('FormEntityTypeCode',(this.data.getEntity()&&!Mscrm.InternalUtilities.JSTypes.isNull(this.data.getEntity().getEntityTypeCode()))?this.data.getEntity().getEntityTypeCode().toString():'');if(!Mscrm.InternalUtilities.JSTypes.isNullOrEmptyString(window.CUSTOM_ETC_LIST)&&JSON.parse(window.CUSTOM_ETC_LIST).indexOf(this.data.getEntity().getEntityTypeCode())>-1){setAttributeInWindow('IsCustomEntity','true');}else{setAttributeInWindow('IsCustomEntity','false');}if(!IsNull(window.turboHeaderScriptIncludes)){if(this.scriptIncludesSearch(window.turboHeaderScriptIncludes,'/_static/cs/articlesearchribbon/articlesearchribbon.js')){Mscrm.CrmHeader.setScriptFileForTurboForm(Mscrm.CrmUri.create('/_static/CS/ArticleSearchRibbon/ArticleSearchRibbon.js'));}}Mscrm.TurboForm.Control.PageManager.get_instance().loadActionHubIframe();window.setTimeout(this.$$d_$Ff_1,15);if(!IsNull($v_1)&&$v_1.formType!==7){Mscrm.MetricsCollector.collectAndReportClientMetrics(2);}}else{Mscrm.TurboForm.Control.PageManager.get_instance().finishUIUpdate();}$v_0.stop();}</Function>
<Function>anonymous(){returnb.apply(a,arguments)}</Function>
<Function>anonymous(c,d){for(varb=0,e=a.length;b<e;b++)a[b](c,d)}</Function>
<Function>anonymous(message){switch(message){case'TurboFormPostOnloadTimestamp':setPerformanceMarkerTimestamp('TurboFormPostOnloadTimestamp');Mscrm.Performance.PerformanceMarkerManager.get_instance().addMarker('TurboFormPostOnloadTimestamp',1);var$v_0=Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$7d_1.getHandler(String.format('MessageEventFormat_{0}',message));if(!IsNull($v_0)){$v_0();window.pageLoadedCheckForNavigateApi=true;if(!IsNull(window.parent)&&!IsNull(window.parent.parent)){window.parent.pageLoadedCheckForNavigateApi=true;window.parent.parent.pageLoadedCheckForNavigateApi=true;}}break;case'ScriptsAreLoaded':if(Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$57_1){Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$57_1=false;}var$v_1=Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$7d_1.getHandler(String.format('ScriptsAreLoaded',message));if(!IsNull($v_1)){$v_1();}break;}}</Function>
<Function>SendMessageToPageManager(message)</Function>
<Function>RunHandlerInternal(method,parameters,executionContext,executeIfAvailableOnly)</Function>
<Function>RunHandlers()</Function>
<Function>OnScriptTagLoaded(url)</Function>
<Function>anonymous(){OnScriptTagLoaded(url);}</Function>
</CallStack>
</ScriptErrorDetails>
Thanks to Andrii!
Removing a composite control in the header did the trick.
It seems to be a bug in CRM 2016, but our customers can live without this information in the header. All fine!
Kind regards,
Matthias

Codeigniter showing problem with date function

I want to insert values into db. I have a table as registration_patients. My code is:
$data = array(
'patients_first_name' => $this->input->post('first_name'),
'patients_last_name' => $this->input->post('last_name'),
'patients_email' => $this->input->post('email'),
'patients_password'=> $this->input->post('password'),
'patients_birth_date'=> date('Y-m-d', strtotime($this->input->post('day') . "-" .$this->input->post('month') . "-" . $this->input->post('year'))),
'patients_sex'=> $this->input->post('sex'),
'patients_telephone'=> $this->input->post('telephone'),
'patients_codice_fiscale'=> $this->input->post('codice_fiscale'),
'account_active'=> 0
);
return $this->db->insert('registration_patients', $data);
Now it is inserted values into database bus showing some error and warning like that
A PHP Error was encountered
Severity: Warning
Message: strtotime(): It is not safe to rely on the system's timezone
settings. You are required to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected 'Europe/London' for
'BST/1.0/DST' instead
Filename: models/doctors_model.php
Line Number: 22 and A PHP Error was encountered
Severity: Warning
Message: date(): It is not safe to rely on the system's timezone
settings. You are required to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected 'Europe/London' for
'BST/1.0/DST' instead
Filename: models/doctors_model.php
Line Number: 22
In your root_folder/index.php write date_default_timezone_set('America/New_York'); and see if the problem is solved or not. Here is the link of available timezones.

81002 - Unspecified Method, on chained payment

I'm getting the the following message on a chained adaptive payment call (via PHP). Can anyone see why?
array(5) {
["ACK"]=>
string(7) "Failure"
["L_ERRORCODE0"]=>
string(5) "81002"
["L_SHORTMESSAGE0"]=>
string(18) "Unspecified Method"
["L_LONGMESSAGE0"]=>
string(33) "Method Specified is not Supported"
["L_SEVERITYCODE0"]=>
string(5) "Error"
}
Call is being made with PHP and the data is as follows:
METHOD=PAY&VERSION=84&PWD=xxxxxxxx&USER=support_api1.handmade.com&SIGNATURE=Ai1PaghZh5FmBLCxDCTQpwGx8jB26x4ALMef45mrA1XxMjpRjp20Iz6z.OBactionType=CREATE
¤cyCode=GBP
&returnUrl=http%3A%2F%2Fwww.handmadeandunique.com%2Fsuccess.php
&cancelUrl=http%3A%2F%2Fwww.handmadeandunique.com%2Ffail.html
&feesPayer=PRIMARYRECEIVER
&memo=Test+transaction
&trackingId=ZGP-32322323s
&ipnNotificationUrl=http%3A%2F%2Fwww.handmade.com%2FIPN.php
&receiverList.receiver(0).email=jennie%40xxxxx.me.uk
&receiverList.receiver(0).amount=100
&receiverList.receiver(0).invoiceId=ZGP-32322323s
&receiverList.receiver(0).primary=true
&receiverList.receiver(0).paymentType=GOODS
&receiverList.receiver(1).email=billy-browse%40hotmail.co.uk
&receiverList.receiver(1).amount=4
&receiverList.receiver(1).invoiceId=ZGP-32322323s
&receiverList.receiver(1).primary=false
&receiverList.receiver(1).paymentType=GOODS
&BUTTONSOURCE=PP-ECWizard
You don't define a METHOD value or variable in an Adaptive Payment API call.
Here is a sample request for a Pay API call:
actionType=PAY
receiverList.receiver(0).email=x#y.com
receiverList.receiver(0).amount=100.00
currencyCode=USD
feesPayer=EACHRECEIVER
memo=Simple payment example.
cancelUrl=http://return.com/cancel.php
returnUrl=http://cancel.com/return.php
ipnNotificationUrl=http://www.notify.com//ipn-listener.php
requestEnvelope.errorLanguage=en_US
Have you checked that you are not encoding the parameters twice? Im my case that was happening though http_build_query() and some default setting which was unstable for some reason due to being changed somewhere during runtime.
Make sure you are not encoding twize, and if using http_build_query() update your function so it will be explicit on the encoding part:
from: http_build_query($requestParameters)
to: http_build_query($requestParameters,'','&')
The difference is that the last version will explicitly use & as delimiter while the first will use the default, so be sure.

Resources