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

TOPIC:

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

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

Please Log in or Create an account to join the conversation.

Last edit: by jamalsed.

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

the date field is not saving when i use the dd.mm.yyyy format

Please Log in or Create an account to join the conversation.

Last edit: by jamalsed.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

Hi admin,

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

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Are you using unix type ?
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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 following user(s) said Thank You: jamalsed

Please Log in or Create an account to join the conversation.

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

Thank you very much now its working .

Please Log in or Create an account to join the conversation.

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

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

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

PHP Version 5.4.7

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

hi admin,

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

Thank you

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

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();

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.146 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started