Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7166481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:16+00:00 2026-05-28T14:25:16+00:00

I’m trying to insert values for a node field from a custom module. The

  • 0

I’m trying to insert values for a node field from a custom module. The value will only be inserted from that module and then no operation for that node will be performed, so hook is not in my consideration. I’ve tried to directly insert values to the field_data_… and field_revision_… tables. but I’ve found that drupal also saves the values (serialized) in field_config and field_config_instance tables as blob. since I’m only inserting values in two tables drupal is not reading values I’ve inserted for nodes. I couldn’t understand the serialization stored in DB. so I’m searching for a method that will help me to insert values through API or any other neat way.

any help on the thing I’m trying to accomplish would be great. Thank you

EDIT:
after taking look at serialized content of field_config table I understood that the serialized data is just field configuration and get inserted into the table on first save. My problem solved by saving the first value through admin/content and now my direct DB inserted data is available to the node. this is the serialized data I’ve got:

a:7:
   {s:12:"translatable";
    s:1:"0";
    s:12:"entity_types";
    a:0:{}
    s:8:"settings";
    a:3:
       {s:9:"precision";
        s:2:"10";s:5:"scale";
        s:1:"2";
        s:17:"decimal_separator";
        s:1:",";
       }
    s:7:"storage";
    a:5:
       {s:4:"type";
        s:17:"field_sql_storage";
        s:8:"settings";
        a:0:{}
        s:6:"module";
        s:17:"field_sql_storage";
        s:6:"active";
        s:1:"1";
        s:7:"details";
        a:1:
           {s:3:"sql";
            a:2:
               {s:18:"FIELD_LOAD_CURRENT";
                a:1:
                   {s:22:"field_data_field_total";
                    a:1:
                       {s:5:"value";
                        s:17:"field_total_value";
                       }
                   }
                s:19:"FIELD_LOAD_REVISION";
                a:1:
                   {s:26:"field_revision_field_total";
                    a:1:
                       {s:5:"value";
                        s:17:"field_total_value";
                       }
                   }
               }
          }
     }
     s:12:"foreign keys";
     a:0:{}
     s:7:"indexes";
     a:0:{}
     s:2:"id";
     s:2:"34";
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:25:16+00:00Added an answer on May 28, 2026 at 2:25 pm

    Hope this will help you.

    $node = new stdClass();
    $node->uid = 1;
    $node->name = 'admin';
    $node->type = 'page';
    $node->language = 'und';
    $node->title = 'Your title';
    $node->status = 1;
    $node->promote = 0;
    $node->sticky = 0;
    $node->created = timestamp;
    $node->field_description = array(
        'und' => array(
            array(
                'value' => 'asdasd'
            )
        )
    );
    $node->nid = 1; // define nid if you wish to update existing node
    // if you wouldn't define $node->nid then new node would be created,
    // otherwise node would be updated with you data provided for all
    // fields which you'll list here.
    
    ...
    // other node's fields
    
    node_save_action($node);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.