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 3480594
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:22:07+00:00 2026-05-18T10:22:07+00:00

I have two content types (job_post and application) linked using the node reference +

  • 0

I have two content types (job_post and application) linked using the node reference + node reference url nodes. When I click a link in a job_post node, a new application node is created, so that candidates can fill out their job application. My goal is to automatically copy the content of an cck email field from the referenced job_post node to a cck email field in the application node.

To achieve this,I have created the following module:

// Implementation of hook_perm()
      function mymodule_perm() {
 return array('copy cck field');
    }

 // Implementation of hook_node_api    

function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4  = NULL){
 switch ($op) {

//if the node is inserted in the database

      case 'prepare':
        //if node is a job application
   if($node->type == 'application') {

//get nid from referenced node (using url information    
    $item_nid = arg(3);

//load and build node content
    $item_node = node_load($item_nid);
    $item_node = node_build_content($item_node);

//retrieve data from cck email field in referenced job post node    
                            $item_email = $item_node->field_job_email[0]['view'];

//display result in  website to check if value is correctly loaded
                            dsm($item_email);

Unfortunately when I get this code dsm returns and empty value.

When I make the following changes to the code:

//retrieve data from cck email field in referenced job post node    
                            $item_email = $item_node->field_job_email;

//display result in  website to check if value is correctly loaded
                            dsm($item_email);

I get the following outcome in krumo:

... (Array, 1 element)
     0 (Array, 2 elements)
          email(string, 9 characters) aa@aa.com
          safe (string, 9 characters) aa@aa.com

Any suggestion on how to load the content of the cck email address field (aa@aa.com) into a new field?

Thank you so much!

  • 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-18T10:22:07+00:00Added an answer on May 18, 2026 at 10:22 am

    I might misunderstand something here, but Krumo seems to tell you that $item_node->field_job_email[0] does not have a ‘view’ property.

    Have you tried $item_email = $item_node->field_job_email[0]['safe']; ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two content types, book and chapter. Each chapter node contains a node
Suppose I have two content typs, Job Listing and Job Application. A job application
I have two NSURLConnections. The second one depends on the content of the first,
I have a listview with two columns and I'm using a context menu to
I have two applications written in Java that communicate with each other using XML
I have the following module, which affects how users arrive at two different content
I have the following content types: Camp - the top level type Registration Information
Drupal 7 divides content in two types: Article Use articles for time-sensitive content like
I have two arrays of animals (for example). $array = array( array( 'id' =>
I have two arrays of System.Data.DataRow objects which I want to compare. The rows

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.