Using the latest dev version of the module, the /^book\-toc\-.+/ form element was not saving. I believe this has to do with it being a regular expression. I was able to get the normal behaviour by removing the regex portions of the sting leaving it as 'book-toc'. I got as far as debugging the $form_state variable in the submit function, it consistently shows that the book-toc is not checked when the key is a regex, but works normally if it's a regular string.

Comments

hazah’s picture

Priority: Major » Critical

After fiddling with this for a number of hours I've come to the conclusion that it's the regex format that is at fault. Changing the \- pattern to just be - fixes the problem. Unless I'm missing something (please let me know) I think the correct string should be: '/^book-toc-.+/'

hazah’s picture

Title: Book navigation setting not saving on admin form » Book menu name regex contains extra slash characters
JohnAlbin’s picture

Title: Book menu name regex contains extra slash characters » Book navigation setting not saving on admin form
Status: Active » Postponed (maintainer needs more info)

the /^book\-toc\-.+/ form element was not saving

I don't understand your bug report.

The original regex is syntactically correct. dashes need to be prefixed with backslashes, otherwise they have a special meaning and don't match dashes.

hazah’s picture

Priority: Critical » Minor
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I actually haven't been able to reproduce this since, I'm not entirely sure what failed when it failed on me. If this comes up again, I'll be sure to explain more about my findings. Closing for now, as I no longer believe this is actually an issue.