Book module for D7 uses antiquated D6 techniques and just hasn't been updated. We can reduce the code, improve the code, and make a far better example just by reworking a bit of FAPI code.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

katbailey’s picture

Assigned: Unassigned » katbailey

Subscribing. I'll try to get a patch submitted in the next couple of days...

katbailey’s picture

Status: Active » Needs review
FileSize
3.99 KB

OK, here's a first pass at this. The one thing I'm really not sure about is:

if (isset($form_state['values']['book'])) {
  $node->book = $form_state['values']['book'];
}

I'm not sure this is the correct way to do it but haven't been keeping up to speed with the relevant FAPI changes to know any better :-/

rfay’s picture

Very nice - thanks for fixing this up.

This patch just fixes up a bug that's been there for a long time. When you switch the select back to "none" or "create a new book" it didn't remove the book-selection select control. The form was missing the ajax prefix/suffix in that case.

Status: Needs review » Needs work

The last submitted patch, drupal.book_ajax_825330_03.patch, failed testing.

rfay’s picture

Status: Needs work » Needs review
FileSize
4.05 KB

Whoops. Here's the patch I intended for #3.

rfay’s picture

#5: drupal.book_ajax_825330_05.patch queued for re-testing.

katbailey’s picture

Status: Needs review » Reviewed & tested by the community

This is ready to go.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.