Recursion during exporting PDF (setLocale())
-
I’m using Pressbooks version 2.5
I’m seeing recursion during exporting in PDF format:
In plugins/pressbooks/hook.php:
if ( \PressBooks\Book::isBook() && \PressBooks\l10n\use_book_locale() ) { add_filter( 'locale', '\PressBooks\Export\Export::setLocale' ); } else { add_filter( 'locale', '\PressBooks\L10n\set_locale' ); }
My code executes the ‘if’ portion above, adding the \PressBooks\Export\Export::setLocale to the filters.
Then later, when the filter is applied, the export’s setLocale() calls into getBookInformation() (/plugins/pressbooks/includes/modules/export/class-pb-export() line 713), which then again, applies filters:
plugins/pressbooks/includes/class-pb-book.php line 104:
$val = apply_filters( 'the_content', $val );
And the recursion begins…
My work around is to skip the ‘if’ clause above and just use what’s in the ‘else’ part of. Is there something in our setup that’s causing this recursion?
- The topic ‘Recursion during exporting PDF (setLocale())’ is closed to new replies.