Download & Extend

Add child page does not respect language url

Project:Book made simple
Version:6.x-2.0
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

If I have a multilingual site and set the display language to de in the url (eg. de/node/nn) and add a child page to the node, the language part of the url gets lost, e.g. node/add/mychild?parent=nn instead of de/node/add/mychild?parent=nn. In conjunction with #474350: Adding child page to book parent in multilingual environment works incorrectly this function looses its comfort (do not worry about "Book outline").

Reason: The url is constructed manually using base_path() and other functions. If you construct the url with $links like in the book.module (line 56 and following), everything would work well.

Comments

#1

Could you test for me with the attached file (rename it to book_made_simple.module) ?

AttachmentSize
book_made_simple.module.txt 11.41 KB

#2

Oh my Goodness, you're faster than the wind!

I checked it, and it works. I did it for myself in another way (you know, I don't like the javascript dropdown-box ;) )

In function book_made_simple_link:

<?php
/*        if (count($allowedTypes) > 0) {
            asort($allowedTypes,SORT_STRING);
            $links['book_made_simple'] = array(
                    'title' => "<span id='book_made_simple'>" . theme('add_child_book_content_types',$allowedTypes, $node)  . "</span>",
                    'html'=>true);
          } */
       
foreach ($allowedTypes as $type => $name ) {
           
$links['book_add_' . $type] = array(
               
'title' => t('Add @type',array('@type' => t($name))),
               
'href' => "node/add/". str_replace('_', '-', $type),
               
'query' => "parent=". $node->book['mlid'],
            );
        }
?>

I think, that's enough, because in most cases the number of child page types is very limited and a dropdown box is superfluous. I only have one type per book and don't want to click twice to add a book page (first click to open the box, second to add the child page). I also like to control-click on links to open the link in a new tab (firefox), which is not possible with your solution. If I go back using history (alt-left on firefox) I have to refresh the page to reset the box. Quite annoying! And, if you do not refresh the page and select "Add child page" the default add page is shown (either the default set with book module or, as I didn't set any default there, the add content page). Quite annoying, too.

Perhaps you can add an option setting to use a dropdown or links instead in bms configuration?

#3

Your wish is fulfiled !

Could you test if it's right ?
Go to BMS settings and choose the child list style.

AttachmentSize
book_made_simple.module.txt 12.48 KB

#4

Status:active» closed (fixed)

#5

fsfadfdfsdfsd

#6

nobody click here