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

learn more… | top users | synonyms

0
votes
0answers
20 views

How to save nodes using Drupal::lock() or db_transaction()? [on hold]

I'm wondering if you can save nodes programmatically using a notify endpoint. The idea is that a remote server will hit an endpoint on my Drupal website, and trigger changes to nodes. It's working ...
2
votes
2answers
75 views

Which is the best approach to access post save and post update event of a node ..?

My requirement is to automatically create a PDF after creating a new node with its contents and replace the PDF with a new one while updating the node. Is there any way to access the event post save. ...
0
votes
0answers
11 views

How to break existing node(having data in database) form into multiple steps?

I know this type of question is asked earlier also. But with me, situation is somewhat different. I have a node form with many elements. Earlier it was in a single page to create/edit the same. And ...
1
vote
1answer
48 views

How handle large number of images in gallery node Drupal 7

I have some gallery nodes with a large number of images (100+), the upload with Plupload integration module works fine, but after save the node and edit it again the node edit form loads 20+ seconds! ...
0
votes
0answers
28 views

hook_node_presave() fires twice when adding a new node

In a custom module I use hook_node_presave($node) on node objects with referenced fields. When creating a new node, ddebug_backtrace() shows that entity_save is called first and then node_save. ...
1
vote
2answers
79 views

Can I allow a user to create a Node using only an embeded rich text editor

In Drupal 7, I'd like to present the user with a single text box, that when submitted, creates a new node or entity. I don't want them to have the standard node/add/type link and interface. Rather, ...
0
votes
2answers
35 views

How to add “publish content” to a node view tab

I'm developping a website where I'm asked to add a tab "Publish content" next to the Edit tab. I was told to use the hook_menu, but so far i didn't succeed in showing the tab. Here is what I have ...
0
votes
0answers
68 views

How to save multi select value in list field in node programmatically

I need to programmatically save multi value in list text field in Node. E.g. I am having multi select drop-down of language field, I am getting value in $languages = array('English', 'French', ...
0
votes
1answer
23 views

Check on save if Site already exist

When a new page is created and the path already exists, drupal automatically converts it to path_n . Which behavior I want here instead: A message that the path already exists, with two buttons one to ...
0
votes
1answer
40 views

Redirect to custom error page if node submit fails validation

I've embedded a node/add form on my homepage for submissions but for caching purposes, I need to have any server-side validation occur on a different page instead of itself. I.e. If the form fails ...
1
vote
0answers
126 views

Save Inline entity form-Multiple values for product reference field programmatically

I have product reference field with inline entity form(multiple values) widget in one of my node type. I need to save commerce product via inline entity form to the node programmatically. I tried to ...
0
votes
0answers
42 views

Users create a draft (save draft module) but subsequently can't publish node

Using Drupal 7: users on my site are creating drafts (using the Save Draft module) but subsequently when editing and clicking publish the node never publishes. After clicking publish node remain ...
-2
votes
2answers
71 views

I am unable to save my content

I have created a content type to apply for job. I have two roles, job posting and job hiring. When a user who has the role for job posting enters content, they get the Access Denied message when they ...
0
votes
0answers
13 views

Node ID showing as notice on page

I used node_save function to save nodes (fields) for node on some pages and redirects to another page but when a node is saved, its node id is showing on page as notice. It not exactly the notice ...
0
votes
0answers
37 views

Batch fails with SQL error “String data, right truncated…” for node field

Batch fails with SQL error "String data, right truncated..." for node field_collection field. But when saving node with the same field value there is no errors and Drupal log has no errors ...
0
votes
1answer
95 views

Line breaks are stripped by ckeditor after saving a node programmatically

I'm setting a value to a long text using this code : $node->language = $language->language; // Or e.g. 'en' if locale is enabled $node->field_job_description[$field_langcode][0]['value'] = ...
0
votes
0answers
31 views

Metatag module version 7.x-1.4 generates Meta tags vertical tab disappears

When I updated my contributed module Metatag to the last version some problems happened. Meta tags vertical tab element disappears from new node creation menus. It seems there is some issues with ...
0
votes
2answers
88 views

Change node during saving it

I am using Drupal 7.34 and I have a problem.. My module is reacting on node changes. When a node is updated one or more other nodes are automatically being updated, too. I call a function that ...
0
votes
1answer
83 views

Empty field collection in hook_node_presave with entity_metadata_wrapper

I have a node with a field type field_collection which has 2 items: $node->field_field_collection['und'] = array( 0 => array('value' => 1), 1 => array('value' => 2), ); on the ...
0
votes
1answer
130 views

When programmatically adding conditional element to webform, I get errors

I'm trying to add a new conditional attribute to a bunch of webforms using a script. There are already 12 conditions, and I need to add a 13th one. My code looks like this in a basic script module ...
0
votes
0answers
20 views

Is there any core or module functionality that automatically corrects URLs in node content bodies?

Background I'm investigating some odd behaviour on a Drupal 7 website. We're using the upload replace module to turn Drupal's file versioning on its head. However, there's a bug with this module ...
0
votes
2answers
43 views

How to create a node after one node created

How to create a node after one node created. I have a node type of 'notifications'. I need to create an entry into that after my another content type('policy') created or updated. I tried the ...
0
votes
1answer
78 views

Geofield From another field showing only after saving from form

I am programmatically creating nodes with a Field Collection that contain a geocoded field, the field where i take the data from for the geocoding is a computed field (i have already applied this ...
0
votes
0answers
31 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 ...
0
votes
1answer
34 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
49 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
39 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
42 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 ...
4
votes
1answer
376 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
230 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
39 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
99 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
56 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
169 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
1answer
39 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
251 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
1k 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
142 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
73 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 ...
1
vote
0answers
212 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
283 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
239 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 ...
-2
votes
1answer
77 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
1answer
66 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
104 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
238 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
55 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
115 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
61 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
1k 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 ...