Closed (duplicate)
Project:
Prepopulate
Version:
7.x-2.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2009 at 22:08 UTC
Updated:
19 Aug 2020 at 11:06 UTC
Jump to comment: Most recent
Comments
Comment #1
MatthewVance commentedOK Just a quick update, I have solved this issue on my own.
At least with the date-time field, I hacked the .module to dump the form variables just to see what was going on.
What I FOUND was the date "value" was in a different format than what was showing up in the form.
ie: in the form it showed "Feb 4 2009" but in the raw variable it showed as "2009-02-04".
After changing the format I was populating the field with, this module worked perfectly with this CCK field within a fieldset.
SO, you MIGHT have to do a bit of digging about the underlying format of your variable data before you can populate some CCK fields.
At least until the developers figure out a way to check for this type of stuff, or I do.
LOVE the module guys, keep up the great work!
Comment #2
karens commentedDate fields work so long as you pass the date to them in the right native format for the type of date you are using. Ignore the way the date looks in the form, it's the way the date is stored in the database that you need:
1) Date field: YYYY-MM-DDTHH:MM:SS
2) Datetime field: YYYY-MM-DD HH:MM:SS
3) Datestamp field: 1234567899
Comment #3
ff1 commentedComment #5
dirksonii commentedUpon further reflection, you did sort of say how you did it here. Sort of.
Comment #6
bryanhirsch commentedIn case this can save anybody else some time, I was having trouble prepopulating this: field_bed_occupied_datestamp[0][value][date].
The full input element I'm trying to prepopulate with a datestamp looks like this:
Here's the trick:
1. As mentioned above, you need to use the format that your database is using (which you select when you create the CCK field, in my case datestamp, which is a UNIX timestamp)
2. You have to drop [date] from the name. I don't know why it works like this. But it works.
Example:
mydomain.com/node/add/some-node-type?edit[field_bed_occupied_datestamp][0][value]=1254628800
prepopulates the date field with: 10/30/09.
Comment #7
bryanhirsch commentedDate and Datetime work fine. But Datestamp is misbehaving. After spending all morning with this, here's what I know...
These work:
?edit[field_bed_occupied_date][0][value]=2009-07-23T00:00:00
?edit[field_bed_occupied_datetime][0][value]=2009-07-23 00:00:00
Both of these prepopulate my date field with 7/23/09.
This doesn't:
?edit[field_bed_occupied_datestamp][0][value]=1248321600
I know I just posted a few hours ago saying datestamp works fine. Here's what I missed: The query above will populate the date field with something. But the thing getting prepopulated is wrong. It seems to be the date from the formatting help text below the input box. No mater what datestamp I put as a parameter, the field is getting prepopulated with 10/30/09.
Comment #8
jbrauer commentedNew formatting is required and examples of date fields are specifically listed now in #883980: New field formats are necessary in Prepopulate 6.x-2.x. Please give that a look and if it doesn't resolve the issue comment there.
Comment #9
judy07 commentedHelp ~ I have a problem, my date's part of edit-field-date-input-0-value-datepicker-popup-0 so my url, then I changed the following way ~ but to pass by value can not pass in the past
I am in the following ways, but to no avail
http://XXX.xxx.xxx/node/add/blog?edit[field_date_input][0][value_datepic...
http://drupaltaiwan.org/files/get-date.PNG
Comment #10
manoloka commentedHi there,
For me is not working at all, also tried without the "T" between date and time
https://sub.mysite.org/node/add/evento&edit[field_event_booking][und][0]...
this will open https://sub.mysite.org/node/add on form at all
I've also tried this one:
https://sub.mysite.org/node/add/evento&edit[field_event_booking][und][0]...
with the exactly same results opening https://sub.mysite.org/node/add no form at all
I realize that when I add the "&" to https://sub.mysite.org/node/add/evento it sends me right to https://sub.mysite.org/node/add
I think there must be a problem or am I doing something wrong?
Thanks
Manolo