Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$basePPTX->addSlides($endPPTX->getSlides()); simply not working #15

Open
abondon35 opened this issue Nov 14, 2021 · 2 comments
Open

$basePPTX->addSlides($endPPTX->getSlides()); simply not working #15

abondon35 opened this issue Nov 14, 2021 · 2 comments

Comments

@abondon35
Copy link

Describe the bug
Just tried the "Demo code" to merge 2 files and it doesn't work.

To Reproduce
My code is simple :

(some code before to set variable with file path)
$ppt_transition = $this->ppt_transition;
$basePPTX = new PPTX($ppt_transition);

$ppt_introduction = $this->ppt_introduction;
$endPPTX = new PPTX($ppt_introduction);

$basePPTX->addSlides($endPPTX->getSlides());

Expected behavior
Not throwing erros ...

Screenshots
Error is the following

Fatal error: Uncaught TypeError: Return value of Cristal\Presentation\Resource\XmlResource::getUniqueID() must be of the type integer, float returned in F:\Developpement\Page Oueb\abondonworship\classes\utils\ppt\Cristal\Presentation\Resource\XmlResource.php:229 Stack trace: #0 F:\Developpement\Page Oueb\abondonworship\classes\utils\ppt\Cristal\Presentation\Resource\Presentation.php(39): Cristal\Presentation\Resource\XmlResource::getUniqueID() #1 F:\Developpement\Page Oueb\abondonworship\classes\utils\ppt\Cristal\Presentation\PPTX.php(173): Cristal\Presentation\Resource\Presentation->addResource(Object(Cristal\Presentation\Resource\SlideMaster)) #2 F:\Developpement\Page Oueb\abondonworship\classes\utils\ppt\Cristal\Presentation\PPTX.php(125): Cristal\Presentation\PPTX->addResource(Object(Cristal\Presentation\Resource\Slide)) #3 F:\Developpement\Page Oueb\abondonworship\classes\utils\ppt\Cristal\Presentation\PPTX.php(212): Cristal\Presentation\PPTX->addSlide(Object(Cristal\Presentation\Resource\Slide)) #4 F:\Developpement\ in F:\Developpement\Page Oueb\abondonworship\classes\utils\ppt\Cristal\Presentation\Resource\XmlResource.php on line 229

Desktop (please complete the following information):

  • OS: [Windows]
  • PHP Version: [ PHP 7.1.3 x86]
  • Software used to open the final PPTX [Powerpoint]

Additional context
I can open "template" and save both files, but merging them trows an error that looks like a bug from your project

@abondon35
Copy link
Author

So i changed this to not having the error

    public static function getUniqueID(): int
    {
        // Correction ABN14/11/2021
        return (int)++self::$lastId;
        //return ++self::$lastId;
    }

but basically the merging makes the final pptx to need epair to work ...
Spend 2 days on this plugin ... seems to work as well as it's documented :( thanks anyway

@abondon35
Copy link
Author

I guess this looks like a dead project ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant