Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drupal node_save created time #45

Closed
fufu7755 opened this issue Jan 27, 2018 · 3 comments
Closed

drupal node_save created time #45

fufu7755 opened this issue Jan 27, 2018 · 3 comments

Comments

@fufu7755
Copy link

Hello, there are questions to ask you.
When I create a node using node_save, I want to change the created time. I use "created: 1322428031" to set the value of the created, but it does not work. How do I set it up?
Thank you.

@signalpoint
Copy link
Owner

@fufu7755 It's not possible from the client side, you'll have to do something on the back end (in a custom Drupal module) to make that happen. Probably hook_node_insert() is what you're looking for.

@fufu7755
Copy link
Author

Thank you for your reply!
Another problem I have about field_images. A few days ago when I upload pictures, drupal gave me a warning:
Notice: Undefined offset: 0 in image_field_widget_form () (line 358 of /data/wwwroot/test.china-op.cn/modules/image/image.field.inc).
Notice: Undefined offset: 0 in file_field_widget_form () (line 533 of /data/wwwroot/test.china-op.cn/modules/file/file.field.inc).

Before I use field_images upload pictures has been normal, and I did not modify any code, field_images Number of values is Unlimited. My code format is:
        field_images: {
           und: [
             {
               'fid': 'xxxxxxxxxxxx'
             },
             {
               'fid': 'xxxxxxxxxxxx'
              }
           ]
         },

In addition, I set the value of field_images Number of values to 1, I can upload a picture.

Can help me analyze where the problem lies. Thank you.

@fufu7755
Copy link
Author

Thank you very much, I solved, found you get the code.
https://www.drupal.org/node/2224803#comment-8805759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants