suiteCRM 7.11.2
When you edit any date field inline (in my case its in clients list) when you click the ticker or hit enter it throws a fatal error. The bug is ALSO in a demo version of suiteCRM! As described in this thread:
The error is:
Fatal error: Uncaught Error: Call to a member function format() on boolean in /XXXX/SuiteCRM/include/InlineEditing/InlineEditing.php:445
Stack trace:
#0 /XXXX/SuiteCRM/include/InlineEditing/InlineEditing.php(392): formatDisplayValue(Object(AOS_Contracts), '28/04/2019 00:0...', Array, 'save')
#1 /XXXX/SuiteCRM/include/InlineEditing/InlineEditing.php(370): getDisplayValue(Object(AOS_Contracts), 'start_date')
#2 /XXXX/SuiteCRM/modules/Home/controller.php(64): saveField('start_date', '7ede7c39-69a3-3...', 'AOS_Contracts', '28/04/2019', 'DetailView')
#3 /XXXX/SuiteCRM/include/MVC/Controller/SugarController.php(523): HomeController->action_saveHTMLField()
#4 /XXXX/SuiteCRM/include/MVC/Controller/SugarController.php(491): SugarController->do_action()
#5 /XXXX/SuiteCRM/include/MVC/Controller/SugarController.php(465): SugarController->handle_action()
#6 /home in /XXXX/SuiteCRM/include/InlineEditing/InlineEditing.php on line 445
Yet - in my case it actually saves the new date. But it yells a fatal error... My thread (made a duplicate by mistake :-( ): https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/22123-error-when-changing-date-in-client-list-view#79121
Guess expected behaviour is to just click the ticker and it should save the edited version...
When you click on save button (ticker) it says Fatal Error. But it saves a new version.
I think this should be a high priority because it prevents a rather key functionality from working...,
I follow this! Same bug here (7.11.2 too)
It works!!! Excellent! Thank you very much! You guys rock!!!
Hello.
This hotfix doesn't work for me (french dates). After validating, the field appears as 01/01/1970, but well saved if I refresh the page.
I am concerned about the usage of strtotime (english time format conversion):
include/InlineEditing/InlineEditing.php > function formatDisplayValue Ligne 427
if ($vardef['type'] === 'date') {
$value = date('Y-m-d', strtotime($value));
Although, I might miss something, but I don't see the point to reformat the dates, as it is set by the user, it is well formated (localized)...
I just commented the code related to 'datetimecombo' , 'datetime' and 'date' on formatDisplayValue function and it's working as expected. I haven't found any side effect.
@vaudoin which version are you on? Do you have these changes, also? https://github.com/salesagility/SuiteCRM/pull/6669/files
@pgorod indeed it looks much better with this version of the file ! Thanks for your feedback. 馃憤
(I use SuiteCRM 7.9.10)
Most helpful comment
It works!!! Excellent! Thank you very much! You guys rock!!!