Use Drupal.behaviors.book_title_override.attach instead of $(document).ready.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

osopolar’s picture

Title: Use Drupal.behaviors.book_title_override.attach instead of $(document).ready » Use Drupal.behaviors instead of $(document).ready
Status: Active » Needs review
FileSize
1.65 KB
btopro’s picture

pinging mark to test, makes sense.

mmilutinovic1313’s picture

Didn't break anything, but saving with an override doesn't do anything and the box becomes unchecked the next time you go into the Book via edit.

btopro’s picture

that sure sounds like something broke...

btopro’s picture

also what theme / jquery stuff are you using? there have been some conflicts reported there in the past unfortunately

mmilutinovic1313’s picture

I noticed this issue in both patches - That's why I assume it is not related, but I will investigate further

mmilutinovic1313’s picture

After further examination, Patch is Verified and working!

Further note: Settings for overrides will only save if the book is in an outline. I don't know if it would be possible, useful, or too confusing to have the override save if the book was not yet in an outline (just as kind of a meta property).

btopro’s picture

it can't save unless its in an outline cause it doesn't have a menu item to associate to. do a PR against the github mirror so we can get this in

mmilutinovic1313’s picture

Which branch for the PR to compare to? And do you want me to apply the patch before I do the PR?

btopro’s picture

7.x-1.x

osopolar’s picture

I am a bit confused about the changes in the last Release 7.x-1.1, where the file book_title_override.js was replaced by book_title_override_ops.js (with a strange namespace Drupal.outline_designer_ops.book_title_override), but I guess this issue is obsolete now, isn't it?

btopro’s picture

so book_title_override was replaced by the core form API function to show and hide based on a checkbox.

The ops file you are referencing should have always been there and is only utilized as part of the https://www.drupal.org/project/outline_designer integration

Also, yes, this thread is most likely resolved since we're using the core method of solving this now which does use behaviors

btopro’s picture

Status: Needs review » Fixed

this was fixed in 1.1 by implementing the core method of opening

Status: Fixed » Closed (fixed)

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