Can't get ePub generated. PHPePub is installed in "sites/all/libraries" and print settings page recognizes it's place at "sites/all/libraries/PHPePub/src/PHPePub/Core". But :
- I get a white screen on my content page (the one to print epub) and
- as well my status page is white also,
- with this error in my logs:
PHP Fatal error: Class 'EPub' not found in /path-to-drupal/sites/all/modules/print/print_epub/lib_handlers/print_epub_phpepub/print_epub_phpepub.module on line 52
and
Fatal error: Class 'EPub' not found in /home/athan/domains/info-grece.com/public_html/info-grece/sites/all/modules/print/print_epub/lib_handlers/print_epub_phpepub/print_epub_phpepub.pages.inc on line 31
I think this is a problem with namespaces of PHPePub defined in PHPePub/src/PHPePub/Core/EPub.php

namespace PHPePub\Core;

use com\grandt\BinStringStatic;
use DOMDocument;
use PHPePub\Core\Structure\Ncx;
use PHPePub\Core\Structure\NCX\NavPoint;
use PHPePub\Core\Structure\Opf;
use PHPePub\Core\Structure\OPF\DublinCore;
use PHPePub\Core\Structure\OPF\MarcCode;
use PHPePub\Core\Structure\OPF\MetaValue;
use PHPePub\Core\Structure\OPF\Reference;
use PHPePub\Helpers\FileHelper;
use PHPePub\Helpers\ImageHelper;
use PHPePub\Helpers\StringHelper;
use PHPePub\Helpers\URLHelper;
use PHPZip\Zip\File\Zip;
use RelativePath;

If I define "namespace PHPePub\Core" at the top of "print_epub_phpepub.module" and "print_epub_phpepub.pages", then on my content page when clicking on the "Epub version" link
- something seems to work but it stops with a redirection to "mysite.com/{node_nid}" and ends with a "page not found",
- print settings page reports that I have no epub generation tool selected
- status report is no more white but says the same "No EPUB tool selected"

Comments

erwangel created an issue. See original summary.

LUTi’s picture

Exactly the same issue for me. PHPePub-4.0.7.1

katski’s picture

I went back to an earlier version of phpepub library to get this working - 3.20 appears to work fine.

Anonymous’s picture

running into the same problem today with the Opigno distro.

  • jcnventura committed a1f0bb2 on 7.x-2.x
    Issue #2629668 by jcnventura: Fix epub generation with PHPePub >= 4.0
    
jcnventura’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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