help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Error on creating new event: Call to a member function format() on bool
- creativeideashu
- Topic Author
- Offline
- New Member
- Posts: 1
- Thanks: 0
Error on creating new event: Call to a member function format() on bool
1 year 5 months ago
Hy all!
The situation:
I've upgraded my old Joomla 3 site to Joomla 4. After the upgrade I made a clean install of JEM and imported the old datas.
If I want create a new event:
I've got a Call to a member function format() on bool error when I would like to create a new event with start date.
If I create without start date the save process completed successfully.
Status:
The problem only appears in "Hungarian" language. If I use my webshit with english admin lang everything works fine.
You have to know Hungarian localization uses "Y-m-d" date format instead of "d-m-Y" or "m-d-Y". It could be the source of problem.
VERSIONS:
Joomla! Version 4.3.3
JEM: Latest version: 4.0.0
URL:
/administrator/&layout=edit&id=0
CALLSTACK:
Call stack
# Function Location
1 () JROOT/libraries/src/Form/Field/:401
2 Joomla\CMS\Form\Field\CalendarField->filter() JROOT/libraries/src/Form/:1047
3 Joomla\CMS\Form\Form->filter() JROOT/libraries/src/Form/:991
4 Joomla\CMS\Form\Form->process() JROOT/libraries/src/MVC/Model/:213
5 Joomla\CMS\MVC\Model\FormModel->validate() JROOT/libraries/src/MVC/Controller/:622
6 Joomla\CMS\MVC\Controller\FormController->save() JROOT/libraries/src/MVC/Controller/:678
7 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_jem/:54
8 require_once() JROOT/libraries/src/Dispatcher/:71
9 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/:73
10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/:361
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/:143
12 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/:186
13 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/:293
14 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/:61
15 require_once() JROOT/administrator/:32
The situation:
I've upgraded my old Joomla 3 site to Joomla 4. After the upgrade I made a clean install of JEM and imported the old datas.
If I want create a new event:
I've got a Call to a member function format() on bool error when I would like to create a new event with start date.
If I create without start date the save process completed successfully.
Status:
The problem only appears in "Hungarian" language. If I use my webshit with english admin lang everything works fine.
You have to know Hungarian localization uses "Y-m-d" date format instead of "d-m-Y" or "m-d-Y". It could be the source of problem.
VERSIONS:
Joomla! Version 4.3.3
JEM: Latest version: 4.0.0
URL:
/administrator/&layout=edit&id=0
CALLSTACK:
Call stack
# Function Location
1 () JROOT/libraries/src/Form/Field/:401
2 Joomla\CMS\Form\Field\CalendarField->filter() JROOT/libraries/src/Form/:1047
3 Joomla\CMS\Form\Form->filter() JROOT/libraries/src/Form/:991
4 Joomla\CMS\Form\Form->process() JROOT/libraries/src/MVC/Model/:213
5 Joomla\CMS\MVC\Model\FormModel->validate() JROOT/libraries/src/MVC/Controller/:622
6 Joomla\CMS\MVC\Controller\FormController->save() JROOT/libraries/src/MVC/Controller/:678
7 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_jem/:54
8 require_once() JROOT/libraries/src/Dispatcher/:71
9 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/:73
10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/:361
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/:143
12 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/:186
13 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/:293
14 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/:61
15 require_once() JROOT/administrator/:32
Please Log in or Create an account to join the conversation.
Re: Error on creating new event: Call to a member function format() on bool
1 year 5 months ago - 1 year 5 months ago
Hello creativeideashu
Sorry for late answher, was on a Road Trip.
Yes im tested it on a Brand New System (JEM4.0.1DEV & Joomla 4.3.3 with Hungary Language Pack from Joomla 4.3.3).
Result, like your message: Hiba történt. 0 Call to a member function format() on bool
So i could reproduce it with Hungary Language if this helps..
Best Regards, Marcel
Sorry for late answher, was on a Road Trip.
Yes im tested it on a Brand New System (JEM4.0.1DEV & Joomla 4.3.3 with Hungary Language Pack from Joomla 4.3.3).
Result, like your message: Hiba történt. 0 Call to a member function format() on bool
So i could reproduce it with Hungary Language if this helps..
Best Regards, Marcel
Last edit: 1 year 5 months ago by pctech.
Please Log in or Create an account to join the conversation.
Re: Error on creating new event: Call to a member function format() on bool
1 year 2 months ago
Hello.
Same here.
I debugged a bit and found it it's in libraries/src/Form/Field/
There is a $value = DateTime::createFromFormat($this->filterFormat, $value)->format('Y-m-d H:i:s'); where $this->filterFormat is y-m-d, but $value is in Y-m-d format. If I set $this->filterFormat to Y-m-d, it does work well
Same here.
I debugged a bit and found it it's in libraries/src/Form/Field/
There is a $value = DateTime::createFromFormat($this->filterFormat, $value)->format('Y-m-d H:i:s'); where $this->filterFormat is y-m-d, but $value is in Y-m-d format. If I set $this->filterFormat to Y-m-d, it does work well
The following user(s) said Thank You: ernst67
Please Log in or Create an account to join the conversation.
Re: Error on creating new event: Call to a member function format() on bool
1 year 1 month ago
JEM doesn't use this format (y-m-d) in its code by default.
This format is defined in Joomla as DATE_FORMAT_JS1 into language\en-gB\joomla.ini, but JEM doesn't use DATE_FORMAT_JS1 string too.
In the strange, but in call stack log isn't any JEM file. It could be any plugin installed in Joomla because Joomla 4 & 5 doesn't use this DATE_FORMAT_JS1 string or 'y-m-d' format.
This format is defined in Joomla as DATE_FORMAT_JS1 into language\en-gB\joomla.ini, but JEM doesn't use DATE_FORMAT_JS1 string too.
In the strange, but in call stack log isn't any JEM file. It could be any plugin installed in Joomla because Joomla 4 & 5 doesn't use this DATE_FORMAT_JS1 string or 'y-m-d' format.
Please Log in or Create an account to join the conversation.
Time to create page: 0.646 seconds