Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: [FIXED] Date field not saving

Date field not saving 06 Aug 2013 08:23 #10694

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Hi,

i have a problem to submit the date to database, i have a form in (cooperate support project) when i submit the data, the date of birth is not saved (ps1.jpg),



then when i tried to save again it show me that there are to date field are not saved (ps2.jpg)



Thank you
Last Edit: 06 Aug 2013 10:12 by jamalsed.
The administrator has disabled public write access.

Date field not saving 07 Aug 2013 09:47 #10703

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
the date field is not saving when i use the dd.mm.yyyy format
Last Edit: 07 Aug 2013 09:48 by jamalsed.
The administrator has disabled public write access.

Date field not saving 07 Aug 2013 15:35 #10706

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.

The problem was linked to the use of UNIX format.

The modified files are in :
- save() function of the concerned model.
- a small change in helpers/date.php
Coding is now a piece of cake
The administrator has disabled public write access.

Date field not saving 08 Aug 2013 14:36 #10718

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Hi admin,

thank you for your help, unfortunately the problem is still, also the other date fields are saving wrong date

The administrator has disabled public write access.

Date field not saving 08 Aug 2013 14:49 #10719

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Are you using unix type ?
Coding is now a piece of cake
The administrator has disabled public write access.

Date field not saving 08 Aug 2013 15:16 #10720

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Ok, I got it.

Fixed now.

There was also an issue in the range filter for those dates.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: jamalsed

Date field not saving 08 Aug 2013 16:18 #10721

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Thank you very much now its working .
The administrator has disabled public write access.

Date field not saving 12 Aug 2013 09:24 #10748

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Hi admin,

i think the date is working in Unix and Apple server but now i am trying in windows server so it doesn't work,



in this picture i just modified the "Date of Joint" by remove the Unix format, so the date doesn't change and the other date fields are not saved.

Best Regards
The administrator has disabled public write access.

Date field not saving 12 Aug 2013 10:23 #10751

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Are you sure ?

Unix is a format. Not really important being on Windows, Apple or Linux...
I think it is a problem on your PHP version.

Wich php are you using ?
Coding is now a piece of cake
The administrator has disabled public write access.

Date field not saving 12 Aug 2013 11:04 #10752

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
PHP Version 5.4.7
The administrator has disabled public write access.

Date field not saving 12 Aug 2013 11:14 #10753

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I cannot test it for the moment because I have not access to my virtual machines for the moment (holidays abroad).

I give you a clue to test and debug that.

The last call before to save the datas is the save() function in your model.

There you can dump $data at the end and see how are your datas.
//HERE
echo('<pre>');print_r($data);echo('</pre>');
exit();

if (parent::save($data)) {
	return true;
}
return false;
Thanks for your help. then if you find the issue, I will fix it today in Cook.
Coding is now a piece of cake
The administrator has disabled public write access.

Date field not saving 13 Aug 2013 06:48 #10773

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
hi admin,

i didn't find the file, can you guide me please to the file? :)

Thank you
The administrator has disabled public write access.

Date field not saving 14 Aug 2013 20:31 #10777

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Pick up the name of the table you are editing (ITEM ALIAS)

You seems to be in the FRONT.


So...
site/com_xxxx/models/[item_model_alias].php

This is your model file.
Find the save() function and try the code I gave to you to have a look on the value just BEFORE to store in database.
With this, we can determine better how are formated the dates.
Coding is now a piece of cake
The administrator has disabled public write access.

Date field not saving 18 Aug 2013 11:57 #10802

  • jamalsed
  • jamalsed's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
i found

if (parent::save($date)) {
return true;
}
return false;

but i didn't find code (below) in this file
echo('<pre>');print_r($data);echo('</pre>');
exit();
The administrator has disabled public write access.

Date field not saving 18 Aug 2013 12:39 #10803

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This is the code you have to write (temporaly) to see your datas.

In this way it is possible to read what is sent to the database.
(Well, it is not the last call before physical db storage, but the last one executed by you cook component. The rest is Joomla native and should work)
Coding is now a piece of cake
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.099 seconds

Get Started