node_save is a drupal core function in node module which save the actual node.

learn more… | top users | synonyms

0
votes
0answers
7 views

Node save metatags defaults to english

Between node revisions I lost the metatags of some nodes. They are still there in the old revisions. My idea was to retrieve these metatags from the old revisions and create a new revision. I managed ...
-1
votes
1answer
19 views

How to save a free text views query entered into an exposed filter by the user? [closed]

I would like to save the entered exposed filter text by the user possibly into its own content type. Would I have to look at the url path for this via $_GET vars?
0
votes
1answer
25 views

Duplicate Entry for Video Embed Field which not allow to save node

Content Type : VideoDisplay Fields : Name of Video(Type: String), Video(Type: Video Embed Field), Artist(Type : Node Reference Field) User already created a record of type VideoDisplay. Now ...
0
votes
1answer
20 views

Unable to save textfield on node_save()

$fbuser = new stdClass(); $fbuser->first_name = 'abc'; $fbuser->last_name = 'cde'; $fbuser->location = 'Vas'; $fbuser->link = 'http://www.facebook.com'; ...
0
votes
0answers
19 views

Looking how to update field before node saves

I am looking to update a field with another field before saving or when the node is updated. I want to update a field array's (field_location_test) longitude and latitude values to a field that has ...
1
vote
1answer
52 views

Sanitizing User Input using Form API - Creating Nodes

I'm using D7 Form API to make some custom forms for users that create nodes on submit (using node_submit & node_save functions). This is an example form I'm using: function ...
1
vote
3answers
98 views

set nid manually

I created some nodes, e.g. 100 nodes with corresponding node IDs 1-100. Then some of the nodes are deleted, e.g. nid=50 is deleted. Then I want to create a new node and set its nid=50 – what is best ...
0
votes
1answer
30 views

How to restrict user posting a node in certain circumstances

I've created a new user role (country_admin) and I have created a field for these users called user_country. This can be set when registering a user to UK or USA. I have created a taxonomy ...
0
votes
2answers
45 views

node_save not responding inside module

Drupal: 7.31 Php: 5.5.9-1ubuntu4.3 I am trying to create node type 'recibo_promocion_type', after create nodes of type 'offer_type' (diferent type). I am using hook_node_presave. I run the code in ...
1
vote
1answer
23 views

does node_save wait until end of php session to create db record?

Is it possible/expected that node_save() does not create a new record until the current php session is complete? In other words, if i have a set of nodes to create and i need to check something that ...
0
votes
0answers
44 views

Node save not saving custom fields!

I have scoured this site and tried to find examples that I could use and all seem to show the same thing, the code I am writing fits to the right pattern and yet its just not saving! When submitted ...
1
vote
0answers
20 views

Determine whether a field has changed during hook_node_submit

Basically I need a way of checking whether a node field changed during some event hook...I am using hook_node_submit() but this doesn't seem to work: $form['field_status']['und']['#value'] !== ...
0
votes
1answer
82 views

Why i get the error “Call to undefined function node_object_prepare()” while i try to add a node programmatically in Drupal 7?

i'm trying to add a node content programmatically from a custom module file. I have created the .module file and used this code as suggested: $node = new stdClass(); // We create a new node object ...
0
votes
1answer
529 views

Node add form alter & submit custom field

I have a content type "event" with a field called "field_pricelist". It's a dropdown with no values, I add the values when I alter the form. The values come from a custom table (install / schema) in ...
0
votes
0answers
82 views

Programmatically change date field in hook_cron

I'm trying go buid a node who is updated every day updating a field 'field_data' to the current date. This is my initial code: function actomodule_cron(){ $nid = 58; $node = ...
0
votes
1answer
46 views

why node ref not saved in hook_node_presave

I have a node reference in my custom content type, It can get some content type as reference in unlimited , I want to programmatically add nodes to it , some part of my code is function ...
0
votes
0answers
39 views

node_save throwing PDOException: “Duplicate entry '' for key 'uri'”

I'm working on a script to update some content (no file management) - but when I call node_save($node), it throws this error: [errorInfo] => Array ( [0] => 23000 [1] => ...
1
vote
0answers
89 views

Prevent node being saved + Rules

Is it possible to prevent a node from being saved with Rules? This is what I do now: Create a rule Before saving content of type ''. Condition: IF ... TRUE => Redirect & set message Create ...
0
votes
0answers
77 views

Error while saving a new node of a speific content type

my question is.. I have a business listing content type in my website. When i am creating a new listing i can not save it. It shows error message " Error The website encountered an unexpected error. ...
0
votes
1answer
94 views

Set value field before submit

I'm trying to set a value before the form is submitted. The field is calculated by two other fields. One of them is a property of an entity reference. This is what I do: function ...
-3
votes
1answer
52 views

saving programmatically without changing the author [closed]

I made a script to change some node fields that is run by cron. When it saves the nodes, the author changes and becomes "Anonymous". Is there a way to save programmatically a node without changing ...
0
votes
0answers
121 views

Drupal commerce/inline entity form submit handler

Commerce Kickstart (commerce_kickstart-7.x-2.9) Save Draft I have a complex content type that's associated with a commerce product. When I install save draft and try to "Save as Draft" I get the ...
0
votes
1answer
39 views

How to change the language of a node and all its fields and all related data?

On my multilingual site, I have a content type that is going to be user created. I want to keep it language neutral ('und'). But there already are a couple thousand nodes of that content type and ...
1
vote
1answer
73 views

How do i run node save in background process

I have created drupal website for ecommerce store. Issue: After node save i will redirect to thankyou (destination) page for tracking but it takes long time to complete. Customer may skip if it takes ...
1
vote
1answer
112 views

Boost + Expire: Front Page not expiring from cache

I am using Boost and Cache Expiration. My site generates nodes automatically and adds them via node_save(). I have setup Expire to get triggered on node insert, update and delete and to let the front ...
0
votes
0answers
34 views

Drupal sometimes doesn't save or delete node

I have experienced sometimes after few minutes spent on the edit page (to fill the form), I want to save or delete the node, it doesn't work. It redirect to the edit page without any notification or ...
0
votes
1answer
79 views

How to skip client side validation for draft node?

I am using clientside validation module for drupal 7.I have two button for submit node one is for save as draft and other submit so Now my scenario is that if i click on save as draft then it should ...
2
votes
1answer
52 views

how to catch when node is being promoted?

I would like to take some action when node is being promoted. I tried using node_validate or node_presave but none of them is working. What is the quickest way to do this? thanks
2
votes
3answers
739 views

Programmatically create a node with alias and menu item using Entity API

I've seen the excellent documentation on Drupal.org about how to create a node in code, but that documentation doesn't address how to create the node's alias. I've seen code snippets that use ...
2
votes
1answer
198 views

$entity_wrapper->save(true) vs. entity_save('node', $entity)?

Say I've got the following block of code: $language = language_default(); $values = array([...]); $entity = entity_create('node', $values); $entity_wrapper = entity_metadata_wrapper('node', ...
1
vote
2answers
263 views

How to programmatically set a node field as empty?

I have some nodes of a content type with following fields: title body image I want to programmatically (!important) set the body field as empty (to make it like it was never set with any value). ...
0
votes
1answer
66 views

Drupal - Save for Later using Workbench, conditional required fields

I have a node set up with a few workbench states. The first state, "Draft", should be used to allow someone to save the node without any required fields. The second state, "Submitted", should make the ...
0
votes
1answer
70 views

Does not using node_save for updating nodes impact SEO for our site

We changed our node updation process from using node_save() to manually updating the nodes via db queries. What dramatic change we have seen is that number of people coming to us via seo has dropped ...
2
votes
3answers
815 views

Entity Metadata Wrapper Save VS Node Save when invoked from hook_node_insert

Can somebody shine a light into the difference of the two, in terms of their interaction with database when hook_node_insert() is invoked? The documentation explains that Note that when this hook ...
2
votes
2answers
167 views

How to edit a node programatically after it has been created?

My articles have a field 'Ranking' and I'd like to give a value to this field after a node has been created. The value depends on the node's ranking in a view called 'Top 3'. I tried the following in ...
0
votes
0answers
21 views

Product has been created but The post could not be saved. while creating a product in ubercart module

i am trying to create a product in drupal 6 by using ubcart module but this error occurs Product productname has been created. The post could not be saved. can i know what is the problem and how ...
-1
votes
1answer
130 views

Save checkboxes value into another checkbox field

I'd like to save the value of a checkboxes field which is link to a product once I save my content type. I've created the code needed to create the product and the node. When the node is in creation ...
1
vote
1answer
140 views

Is there a way to make a keyboard shortcut for Save on the node edit page?

It would save a lot of time not having to scroll to the bottom of the page to save edits to a node. Are there modules which achieve this?
1
vote
1answer
236 views

Best hook to use to save a new node when a node is saved

I want programatically create a new node of type B (status message), immediately after a node of type A (e.g. gallery post) is added (or updated). Looking at this recipe, I see that I will have to ...
1
vote
1answer
71 views

programmatically saving a node doesn't add any record to dblog

When I call node_save to save a node, no record for "a new node has been saved.." is added to watchdog. Is this normal? If yes, how do I also add a watchdog record? (without calling the watchdog ...
1
vote
2answers
97 views

Create a node Programmatically having Composed Field

I have a content type having composed filed (used Composed Field module for this). How can I create a node programmatically with composed field values?
0
votes
1answer
193 views

Problem with node_save within a loop

Within an instance of hook_submit (for a custom form), I'm trying to iterate over a list of nodes, updating each of them. The general outline is $x = node_load_multiple($nids); $data = array(--some ...
0
votes
1answer
198 views

Validation at node_presave in drupal 6

I received a somewhat complicated Drupal 6 application to maintain and unfortunately I am quite a newbie with Drupal. The task is to verify certain system variable is set before saving the node. Is ...
0
votes
2answers
193 views

Not able to save the selected custom populated option list

I have a cck select list where the options are populated by my custom code. There is no issue for populating the list but after that the selected options are not able to save. Is there any way to fix ...
0
votes
2answers
489 views

Adding a custom path for node

I have enabled the path auto and workbench modules in my drupal installation. I have to set the url alias once only. Once a node is published and url alias is generated, the url alias should not be ...
0
votes
2answers
1k views

Adding a date time field value within a node programmatically

[field_download_time] => Array ( [und] => Array ( [0] => Array ( ...
1
vote
0answers
200 views

Programmatically create node with select List

I'm trying to add nodes via a JSON feed. However, I'm having trouble setting the value of a select list field. I have this at the moment: $node->field_name[0]['nid'] = ...
0
votes
1answer
200 views

How to save autocomplete and date type fields while adding node programmatically?

I am creating a node programmatically and I have a field which is autocomplete and has number of values set to unlimited. In the code for adding the node programmatically ,the code is as given below ...
4
votes
1answer
535 views

What is the purpose of using node_submit() before node_save()?

I am creating a node programmatically , In the code given in the link http://timonweb.com/how-programmatically-create-nodes-comments-and-taxonomies-drupal-7 after creating a node, the code goes as ...
0
votes
1answer
66 views

Drupal 6 - form submission data loss from empty required fields

Scenario: Content profile node-type has new required fields added after many users have already filled out their profile info. (this scenario can work for any node-type). They go back to update ...