The problem listed below might be a result of using the Date 2 API. Another user and I have run into it in the same kind of situation. I have Date 2 installed but haven't explicitly used any date fields in any of my content types yet (was using it to play around with Calendar). Original forum message follows:

I'm testing out my site and I created an authenticated user that has the ability to create content but not to administer it (I don't want this person to have the ability to promote to front page, sticky, or any of those other options). However, when trying to create content (I have CCK enabled), I get this error when submitting the content:

The Authored on 2 2 is not valid.
Please check the Authored on values.

I have no idea what the "2 2" refers to. When I give the user access to administer nodes, problem goes away. Any ideas? Seems to be a problem with the Authored on date field...Would this have anything to do with me installing the still-in-development Date 2 module (this particular content does NOT have a CCK date field)?

Comments

karens’s picture

Do you have the Date Popup module installed? That module is altering the Authored by field to present a date popup for the date and there could be an error in that code. If that's the problem, disabling the Date Popup module should make the problem go away.

I still want to find and fix the problem, but that's a way to test if that is the source of the error.

dnguyen’s picture

That appears to be the fix/workaround. Thanks!

RdN’s picture

I need the Date popup but have no need to change the Authored date so I have commented out the two lines that call date_popup_system_date_form() until there is an official fix.

The new date and calendar are shaping up nicely.

Many thanks.

karens’s picture

Status: Active » Fixed

Found the problem and it should be fixed with latest commit. It turns out that form element is there even for people who don't have authorization to use it but marked by setting #access to FALSE, so I had to add a test for access to keep from altering those forms.

RdN’s picture

Thanks will update and remove my hack :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

skyredwang’s picture

Version: 5.x-2.x-dev » 5.x-2.0-rc
Component: Miscellaneous » Date API
Status: Closed (fixed) » Active

I am using 5.x-2.0-rc and
"The Authored on 2 2 is not valid.
Please check the Authored on values."
is still a problem for me even with Admin account. Can anyone tell me where is the patch or update?

karens’s picture

Status: Active » Fixed

If you're getting that message, you don't have the latest code. Update to the latest dev version.

p_alexander’s picture

FYI, I was trying to programmatically create new CCK nodes with drupal_execute and was receiving the same error, only on one of my CCK date fields. Disabling the date pop-up seemed to fix the problem.

p_alexander’s picture

Ah-ha. Probably works as intended as I suppose you can't use a pop-up on a programmatic submission. However, since I know the date format that is input and could easily provide that in the programmatic node creation process, it would be nice if it would allow both programmatic node creation as well as the normal user input/form-based method. In the end I switched the date CCK field to text input and switched the pop-up back on.

EDIT (after three hours of fiddling to get the above method to work! :)
Hm, switching the CCK field to text input did not work. I was using an array of dates (formatted Y-m-d) to create one node per date. For some reason it 'loses' the first date in the array. I am thinking that it's the Date module because my debug output shows that the variable holds the proper value just before the node_execute command so it must be getting wrecked somewhere in the validation. If I turn off required and just let it go, all the other dates from the array (after the first one) are entered fine. To top things off, if I switch it back to a pop-up field, then disable the pop-up module, it works fine.

If I can determine that it is indeed the Date module I'll submit a new bug.

karens’s picture

You won't get the original error with the latest dev version of the code because Date Popup isn't used there any more.

And using Date Popup on a prgrammatic submission could be tricky, it depends on how you structure it. And that is definitely a separate issue.

timb’s picture

I am still getting this error when submitting only the title field via drupal_execute. I am using date 5.x-2.0-rc, which apperas to be the most current code. It sounds like from the above comments that I can also format and submit the date myself as a work around. I will give it a try.

Sorry. I reread the above posts and realized I should get the dev version and all was good!!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.