Permalinks of table of contents

When I am changing name of the book in book editing section, ‘Book Address (URL)’ field (/wp-admin/network/site-info.php?id=2 link), the permalinks in tables of contents in front-end of web-site remain with the old name of a book, which leads to non-existing web-page of book parts (chapters etc.) after changing name of book. The problem appears in a installation of latests versions of WP and PB, here is the diagnostics output of website:

System Information

Root Blog Info

Root Blog ID: 1
Root Blog URL: http://localhost/wordpressmulti/


Platform: Windows
Browser Name: Chrome
Browser Version: 67.0.3396.99
User Agent String: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

WordPress Configuration

Network URL: http://localhost/wordpressmulti/
Network Type: Subdirectory
Version: 4.9.6
Language: en_US
WP_ENV: Not set
WP_DEBUG: Enabled
Memory Limit: 64M

Pressbooks Configuration

Version: 5.3.4
Root Theme: Aldine
Root Theme Version: 1.3.0

Pressbooks Dependencies

Epubcheck: Not Installed
Kindlegen: Not Installed
xmllint: Not Installed
PrinceXML: Not Installed
Saxon-HE: Not Installed

Must-Use Plugins

hm-autoloader.php: n/a

Network Active Plugins

Pressbooks: 5.3.4

Root Blog Active Plugins

Inactive Plugins

Add featured image from URL to PressBooks CPTs: 0.1
Akismet Anti-Spam: 4.0.3
All In One Metadata: 0.18
Debug Bar: 0.9
Debug Bar Console: 0.3
Hello Dolly: 1.7
My Language Skills Ads: 0.1

Server Configuration

PHP Version: 7.2.2
MySQL Version: 5.5.5
Webserver Info: Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.2

PHP Configuration

Safe Mode: Disabled
Memory Limit: 256M
Upload Max Size: 2M
Post Max Size: 8M
Upload Max Filesize: 2M
Time Limit: 30
Max Input Vars: 1000
URL-aware fopen: On (1)
Display Errors: On (1)

PHP Extensions

OPcache: Disabled
XDebug: Enabled
cURL: Supported
cURL Version: 7.57.0
imagick: Not Installed
xsl: Not Installed

I have checked this situtation with some plugins activated and with all the plugins deactivated(except PB main plugin), the output remains the same.

The problem fixes when I do any update of book parts, even just updating chapter without actually changing anything, so just clicking ‘Save’ button in editor. After that all the links in table of context lead to new name of book.

Could you tell me please, if there is something wrong with my configuration and if it is the reason of this bug?
Thank you a lot in advance.

For performance reasons, the Table of contents of a web book are cached in a transient.

When you save Book Address (URL) Pressbooks doesn’t delete the cache because we are not watching this.

When you do any update of book parts, we are watching this and bust the cache.

I guess this counts a bug.

Code is here:


And here:

We would need to add a hook on the options.php page

If you use WP-CLI you can delete transients like this:

wp transient delete --all --url=https://yoursitename

More info:

1 Like

Thank You a lot! I got it!