Did you even test your RC ??

After installing your module, I noticed nothing happens...no links added to if I choose "Link" in the settings. No tabs added if I choose "Tabs". First, there's this problem (easily patched, luckily):

function rearrange_child_pages_access($nid, $type) {
  $has_children = db_result(db_query('SELECT ml.has_children FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid = %d', $node)); 

Your parameter is $nid, but you use $node in your query. Not a big deal, but it breaks your entire module, as the function will always return FALSE.

Then, you call the book_admin_edit function in your hook_menu()...This always triggers an error, because the file that defines this function is not included.

Change your _menu() hook to include book.admin.inc:

$items['node/%node/rearrange'] = array(
    'access callback' => 'rearrange_child_pages_access',
    'access arguments' => array(1, 'tab'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('book_admin_edit', 1),
    'title' => 'Rearrange child pages',
    'file' => 'book.admin.inc',
    'file path' => drupal_get_path('module', 'book'),
    'weight' => 5,
    'type' => MENU_LOCAL_TASK,
);

I'm going to try it one more time, see if it works after patches are applied.

Comments

wadmiraal’s picture

Assigned: wadmiraal » Unassigned
Status: Needs review » Active
StatusFileSize
new1.21 KB

Adding patch

Edit: see #4

wadmiraal’s picture

Assigned: Unassigned » wadmiraal
Status: Active » Needs review

Ok, good. Now it's seems to work fine.

Try applying these changes, as your module does not work without them.

Kind regards

wadmiraal’s picture

StatusFileSize
new1.7 KB

The "Link" option didn't (and couldn't) work either.

Updated the patch. Use this patch instead of #1

And please test your module before making it a RC ! This type of errors can give the whole Drupal project a bad image. This should have been an alpha !

Kind regards

Edit: see #4

wadmiraal’s picture

StatusFileSize
new1.7 KB

And another one...

user_access('administer book outline') should be user_access('administer book outlines').

Sorry, I should have triple checked your code and submitted only one patch. Use this patch instead of the ones in #1 and #3.

nirbhasa’s picture

Title: How is you module supposed to work ? » Rearrange link and tabs not displaying
Assigned: Unassigned » wadmiraal
Status: Active » Needs review

Ill take a look in the next couple of days, and apply the patch. I certainly know the module is working on my production sites. It may be that i somehow accidentally uploaded another pre-release version, because those mistakes are a bit embarrassing :)

nirbhasa’s picture

Status: Needs review » Closed (duplicate)

Actually...this issue is a duplicate of #888878: unable to see the link or tab, lets do the fix there

wadmiraal’s picture

Yep, sorry for the duplication.