Comments

MarcElbichon’s picture

BMS will be port to D7 but i don't know when !
If you want to help me, you are welcome.

MarcElbichon’s picture

StatusFileSize
new14.98 KB

Can you test this version ?

davidzz’s picture

Hi,

Thanks! The functionality seems to be there. There's just three problems I encountered:

1. There is no specific settings in content types that would override the global setting, as the help would suggest (Structure -> Content Types -> Edit shows "BookMadeSimple" at the bottom, but it's not expandable.)

It doesn't seem like there are any global settings that would need overriding, though.

2. When automatically creating a new book using the content type, the following errors appear:

Notice: Undefined index: depth in book_made_simple_node_insert() (line 495 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).

3. When viewing any pages in the new book (parent or child), the following errors appear:

Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).

Finally, all the functionalities seem to be there (on the surface, at least), and I love the "reorder book" link! Having it inside /admin and needing to adjust administration theme is not pleasant, but I guess there's really nothing to do about it.

Thanks for the quick response and please feel free to ask me for more help. I'm not really familiar with drupal development or I would have been much more proactive in patches - sorry...

davidzz’s picture

Hi,

Thanks! The functionality seems to be there. There's just three problems I encountered:

1. There is no specific settings in content types that would override the global setting, as the help would suggest (Structure -> Content Types -> Edit shows "BookMadeSimple" at the bottom, but it's not expandable.)

It doesn't seem like there are any global settings that would need overriding, though.

2. When automatically creating a new book using the content type, the following errors appear:

Notice: Undefined index: depth in book_made_simple_node_insert() (line 495 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).

3. When viewing any pages in the new book (parent or child), the following errors appear:

Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Trying to get property of non-object in book_made_simple_link() (line 407 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).

Finally, all the functionalities seem to be there (on the surface, at least), and I love the "reorder book" link! Having it inside /admin and needing to adjust administration theme is not pleasant, but I guess there's really nothing to do about it.

Thanks for the quick response and please feel free to ask me for more help. I'm not really familiar with drupal development or I would have been much more proactive in patches - sorry...

MarcElbichon’s picture

StatusFileSize
new15.5 KB

Can you try this new version ?
I don't understand "and I love the "reorder book" link! Having it inside /admin and needing to adjust administration theme is not pleasant, but I guess there's really nothing to do about it"

I added two new params in BMS Settings :
1) Position of child list to be first or last in the link area
2) If you don't see fieldset legend in content-type settings, uncheck 'Print titles in fieldsets legend. Uncheck to prefer static text'

davidzz’s picture

The warning messages seem to have disappeared on book pages, and the fieldset legend shows up now - all great!

But the configuration page /admin/config/book_made_simple now shows:

Fatal error: require_once(): Failed opening required '/public_html/sites/all/modules/book_made_simple/system.admin.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /public_html/includes/menu.inc on line 478

And /admin in general shows:

Warning: require_once(/public_html/sites/all/modules/book_made_simple/system.admin.inc): failed to open stream: No such file or directory in menu_execute_active_handler() (line 478 of /public_html/includes/menu.inc).

That's all.

Also, my remark last time was about the fact that the link "reorder the book" leads to /admin/content/book/59?destination=node/59, which is in /admin and uses the administration theme (something that can cause inconsistencies on the user side). I guess it'ld be too hard to change that one though.

MarcElbichon’s picture

Can't reproduce your warning. Can you delete line 38 ('file' => 'system.admin.inc',) in book_made_simple.module, clear caches (or disable/enable the module) and retry ?

For your remark about reorder link, i'll try to find an issue.

davidzz’s picture

Removing line 38 did get rid of all the error messages and allowed me to get into admin/config/book_made_simple.

One more problem, though: if in the configs we choose "unordered list" for style of child list, on book nodes, after the content, there is a giant error box that start off:

Error

The website encountered an unexpected error. Please try again later.

and says:

Error message

Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /public_html/includes/common.inc on line 2134 and defined in drupal_http_build_query() (line 469 of /public_html/includes/common.inc).
MarcElbichon’s picture

StatusFileSize
new15.49 KB

New version (again !!!)

davidzz’s picture

The "unordered list" works now. Two problems, though:

1. Every content type that's not allowed to start a book displays the following error:

Notice: Undefined index: parent in book_made_simple_form_alter() (line 203 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Use of undefined constant value - assumed 'value' in book_made_simple_form_alter() (line 206 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).
Notice: Undefined index: #tree in form_builder() (line 1673 of /public_html/includes/form.inc).
Notice: Undefined index: process_input in _form_builder_handle_input_element() (line 1834 of /public_html/includes/form.inc).
Notice: Undefined index: #tree in form_builder() (line 1673 of /public_html/includes/form.inc).
Notice: Undefined index: process_input in drupal_process_form() (line 752 of /public_html/includes/form.inc).

2. Link to the config from the sidebar is /admin/config/book_made_simple, which doesn't work. /admin/config/book_made_simple/config does, but displays the following error:

Warning: call_user_func_array(): First argument is expected to be a valid callback, 'system_admin_menu_block_page' was given in menu_execute_active_handler() (line 480 of /public_html/includes/menu.inc).
MarcElbichon’s picture

StatusFileSize
new15.48 KB

New version (thanks for your patience).
For point 2, have you cleared your cache ? What do you mean by 'Link to the config from the sidebar' ? What's your theme ?
Can you post a screenshot ?

davidzz’s picture

StatusFileSize
new144.16 KB
new108.85 KB

1. The error messages disappeared, but there seems to be a communication problem:

Any content type not allowed to start a book gives the following message when clicked on under the "add content" menu:

This content-type cannot be created outside a book. Creation cancelled

I'm not sure if that's intentional or has to do with the way Drupal deals with nodes, but disallowing something to start a book doesn't imply disallowing the content to be created as a stand-alone node by itself. It was a little confusing until I figured it out.

2. Screenshot attached. I'm using the Bartik theme, and the link /admin/config/books_made_simple leads to a blank page. The error message that displays for /admin/config/books_made_simple/config, which does work, is also attached.

MarcElbichon’s picture

Point 1 is #908796: Option to prevent creation of selected content types without a parent book but i can add a param to allow creation with node forced as a single page.
Will verify point 2, but the link in sidebar would be expanded with a menu entry to point to admin/config/books_made_simple/config.
Does configure link in module admin page work ?

davidzz’s picture

Yes the configure link in module admin page work. It's just the sidebar that's not expanding and leading to a blank page.

Other options do expand, though, and I see the same error in Garland theme.

davidzz’s picture

Also, one more problem:

When anonymous users create nodes that are not related to the books_made_simple module (no options checked), the following error message displays in the "create content" page:

Notice: Undefined property: stdClass::$book in book_made_simple_form_alter() (line 224 of /public_html/sites/all/modules/book_made_simple/book_made_simple.module).

This is not the case for registered users - just anonymous ones.

MarcElbichon’s picture

StatusFileSize
new15.61 KB

New version

davidzz’s picture

As far as I can tell this works perfectly. Thank you!!

MarcElbichon’s picture

Many thanks to you.

HylkeVDS’s picture

I'm currently getting:

Notice: Undefined index: #links in book_made_simple_node_view() (line 604 of /var/www/sites7/all/modules/BookMadeSimple/book_made_simple.module).
Warning: array_merge(): Argument #1 is not an array in book_made_simple_node_view() (line 604 of /var/www/sites7/all/modules/BookMadeSimple/book_made_simple.module).

Fatal error: Unsupported operand types in .../drupal-7.0-rc1/includes/common.inc on line 5389
[more stuff skipped]
MarcElbichon’s picture

StatusFileSize
new15.8 KB

Can you try this one ?
ATTENTION :
Permissions have been renamed. Permission "Show (checked) or hide (unchecked) outline section in form elements" have been added.

HylkeVDS’s picture

Version: 6.x-2.x-dev » 7.x-1.0

I first uninstalled BookMadeSimple, then installed that version.

There's no more error, but also no add-child dropdown, and still the standard "add child page" link.

MarcElbichon’s picture

StatusFileSize
new15.64 KB

Can you try this one ?
Seems you have no other links in page view. In my tests, i have always Printer -friendly version link. Don't you ?
How did you remove it ?

MarcElbichon’s picture

StatusFileSize
new15.73 KB

Sorry for new version, but core code have been changed with the last Drupal 7 rc.
This is a version which should work !

HylkeVDS’s picture

Yes, that one works!
Great :)

HylkeVDS’s picture

Here is an interesting notice:

Notice: Undefined index: body in book_made_simple_node_view_alter() (line 696 of /var/www/sites7/all/modules/book_made_simple/book_made_simple.module).

Not all nodes have a body in D7. Looking at the method I'm guessing you should do:

$node = $build['#node'];

Instead of:

$node = $build['body']['#object'];

But I'm not sure :)

MarcElbichon’s picture

StatusFileSize
new25.72 KB

Corrected. rename attchment to book_made_simple.module

HylkeVDS’s picture

Yep, that fixed the problem. :)

Now you just need to run it through the coder module and fix all the coding standards violations. ;)

HylkeVDS’s picture

Found another warning:

Warning: Parameter 1 to book_made_simple_node_insert() expected to be a reference, value given in module_invoke_all() (line 817 of /var/www/drupal-7.0-rc1/includes/module.inc).

The parameter of hook_node_insert($node) should not be a reference.
http://api.drupal.org/api/drupal/modules--node--node.api.php/function/ho...

MarcElbichon’s picture

Can you change line 603

function book_made_simple_node_insert(&$node)

by

function book_made_simple_node_insert($node)
HylkeVDS’s picture

Yep, that fixed it (already did that :))

MarcElbichon’s picture

Status: Active » Closed (fixed)
scottrigby’s picture

Project: Book made simple (Obsolete) » Book made simple
Version: 7.x-1.0 » 7.x-3.x-dev