Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have the following code:
Code: Select all
   <cms:set file_url = "<cms:php>echo parse_url('<cms:show event_attachment />', PHP_URL_PATH);</cms:php>" scope="global" />
   <cms:php>
      $externalPdfPath = "<cms:show file_url />";
      $pageCount = $mpdf->SetSourceFile($externalPdfPath);
      echo $pageCount;
   </cms:php>

My event_attachment editable is defined as:
Code: Select all
<cms:editable name="event_attachment" label="Attachment" type="file" max_size="10240" order="4" not_active=my_has_attachment />

It lies in a cms:repeatable region.

I get the following error:
Untitled.png
Untitled.png (5.09 KiB) Viewed 2950 times


As an additional info, I am using the latest CouchCMS version from GitHub and mPDF version 8.2.

Regards,
GXCPL (CTR)
Image
where innovation meets technology
I think the $mpdf variable would be undefined within the <cms:php> block - please try defining it as 'global' and see if that helps.
Code: Select all
<cms:php>
      global $mpdf;

      $externalPdfPath = "<cms:show file_url />";
      $pageCount = $mpdf->SetSourceFile($externalPdfPath);
      echo $pageCount;
</cms:php>
Sir I added the $mpdf variable within the <cms:php> block but it makes no difference. I still get the same error. I checked the XHR response. I am attaching the output of it here.

Regards,
GXCPL (CTR)

output.zip
(1.51 KiB) Downloaded 421 times
Image
where innovation meets technology
3 posts Page 1 of 1