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

  • Home
  • SEARCH
  • 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 497481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:47:08+00:00 2026-05-13T05:47:08+00:00

Example call to copy a book using the Book Copy module in Drupal 6

  • 0

Example call to copy a book using the Book Copy module in Drupal 6 (assuming a node exists with book id of 142):

http://www.examplesite.com/book_copy/copy/142

When the above site is called and node 142 is copied it then notifies the user that the book was copied, but starts the user out on the Outline tab for the book copy. I think it would be more intuitive to start the user out on the Edit tab for the book copy so the user can immediately start to edit the information for the book. The outline is less important than setting up the actual initial details for the book which are in the Edit tab.

Does anyone know how I could modify the module to forward the user to the Edit tab? I looked through the code and it’s just not clicking. I’m having problems interpreting exactly how this Book Module is working under the hood. Any suggestions will be greatly appreciated. Thanks!

  • 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-13T05:47:08+00:00Added an answer on May 13, 2026 at 5:47 am

    I have no experience with the book_copy module, but looking at the last lines of the book_copy_copy_book() function:

    $book = node_load(array('nid' => $newbid));
    $book->bookcopydata = array();
    $book->bookcopydata['message'] = t('Successfully cloned "%message", now viewing copy.', array('%message' => $message));
    if (_book_outline_access($book)) {
      $book->bookcopydata['url'] = 'node/'. $newbid .'/outline';
    }
    else {
      $book->bookcopydata['url'] = 'node/'. $newbid;
    }
    
    // The function signature is: hook_book_copy_goto_alter(&$data);
    drupal_alter("book_copy_goto", $book);
    drupal_set_message($book->bookcopydata['message']);
    drupal_goto($book->bookcopydata['url']);  // requires user has 'administer book outline' or can access personal books
    

    the user would automatically end on the new book page if he did not have the ‘administer book outlines’ right. If you want the user to always end on the new book edit page, you could just replace the whole if

    if (_book_outline_access($book)) { ... }
    

    clause with the assignment from its else part with an adjusted url:

    $book->bookcopydata['url'] = 'node/'. $newbid . '/edit';
    

    However, changing a modules code directly is not recommended (update clashes), especially if the module provides a hook to achieve the change you need ‘from outside’. So the ‘right’ way in your situation would be to implement the offered hook_book_copy_goto_alter(&$data) in a custom module in order to adjust the redirection URL to your liking:

    function yourModule_book_copy_goto_alter(&$new_book) {
      $new_book->bookcopydata['url'] = 'node/'. $new_book->nid . '/edit';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My domain (let's call it www.example.com) creates a cookie. On another site (let's say,
is there any example on using java method to call rhino-javascript function and return
Given remote page: http://example.com/paged_list.aspx which uses a Javascript function call to display several pages
I am working on a site with the current working copy held at: www.OnlineUticaCollege.com/david
Update: Replaced the destructor example with a straight up method call example. Hi, If
For example when we call say, a recursive function, the successive calls are stored
I want to create a simple menu function which can call it example get_menu()
For example, when I call a method that returns an value, but I'm not
What does it mean to call a class like this: class Example { public:
i am looking for a basic example that shows how i could call a

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.