Code Monkey home page Code Monkey logo

pdfshift's People

Contributors

jacobgraf avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pdfshift's Issues

ReflectionException: Class graftechnology\pdfshift\assetbundles\pdfshift\PdfShiftAsset does not exist

Getting an "Internal server error" screen when I go to PDFshift settings.

What's strange is that I don't get this error in my local environment, but I do in production (Arcustech).

This is what the logs show...

2022-07-30 18:52:53 [-][518][ctevjaibrcufns5fk0ro7bkgab][error][yii\di\NotInstantiableException] ReflectionException: Class graftechnology\pdfshift\assetbundles\pdfshift\PdfShiftAsset does not exist in /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php:507
Stack trace:
#0 /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php(507): ReflectionClass->__construct()
#1 /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php(385): yii\di\Container->getDependencies()
#2 /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build()
#3 /storage/av07738/www/public_html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()
#4 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/AssetManager.php(286): yii\BaseYii::createObject()
#5 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/AssetManager.php(259): yii\web\AssetManager->loadBundle()
#6 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/View.php(294): yii\web\AssetManager->getBundle()
#7 /storage/av07738/www/public_html/vendor/twig/twig/src/Extension/CoreExtension.php(1566): yii\web\View->registerAssetBundle()
#8 /storage/av07738/www/public_html/vendor/craftcms/cms/src/helpers/Template.php(106): twig_get_attribute()
#9 /storage/av07738/www/public_html/storage/runtime/compiled_templates/f2/f241a1fc3f998d524637e5720faf7f4cae376c373d1f671a183fc260351361dd.php(46): craft\helpers\Template::attribute()
#10 /storage/av07738/www/public_html/vendor/twig/twig/src/Template.php(405): __TwigTemplate_c39b3b55c03651963f56ca08b2acc5061574c39b0309e1508971b99f46ba20e3->doDisplay()
#11 /storage/av07738/www/public_html/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#12 /storage/av07738/www/public_html/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#13 /storage/av07738/www/public_html/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render()
#14 /storage/av07738/www/public_html/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render()
#15 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/View.php(408): Twig\Environment->render()
#16 /storage/av07738/www/public_html/vendor/graftechnology/pdfshift/src/PdfShift.php(115): craft\web\View->renderTemplate()
#17 /storage/av07738/www/public_html/vendor/craftcms/cms/src/base/Plugin.php(212): graftechnology\pdfshift\PdfShift->settingsHtml()
#18 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/View.php(1529): craft\base\Plugin->craft\base{closure}()
#19 /storage/av07738/www/public_html/vendor/craftcms/cms/src/base/Plugin.php(213): craft\web\View->namespaceInputs()
#20 /storage/av07738/www/public_html/vendor/craftcms/cms/src/controllers/PluginsController.php(114): craft\base\Plugin->getSettingsResponse()
#21 [internal function]: craft\controllers\PluginsController->actionEditPluginSettings()
#22 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#23 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#24 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#25 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction()
#26 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction()
#27 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest()
#28 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()
#29 /storage/av07738/www/public_html/public/index.php(22): yii\base\Application->run()
#30 {main}

Next yii\di\NotInstantiableException: Failed to instantiate component or class "graftechnology\pdfshift\assetbundles\pdfshift\PdfShiftAsset". in /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php:509
Stack trace:
#0 /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php(385): yii\di\Container->getDependencies()
#1 /storage/av07738/www/public_html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build()
#2 /storage/av07738/www/public_html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()
#3 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/AssetManager.php(286): yii\BaseYii::createObject()
#4 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/AssetManager.php(259): yii\web\AssetManager->loadBundle()
#5 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/View.php(294): yii\web\AssetManager->getBundle()
#6 /storage/av07738/www/public_html/vendor/twig/twig/src/Extension/CoreExtension.php(1566): yii\web\View->registerAssetBundle()
#7 /storage/av07738/www/public_html/vendor/craftcms/cms/src/helpers/Template.php(106): twig_get_attribute()
#8 /storage/av07738/www/public_html/storage/runtime/compiled_templates/f2/f241a1fc3f998d524637e5720faf7f4cae376c373d1f671a183fc260351361dd.php(46): craft\helpers\Template::attribute()
#9 /storage/av07738/www/public_html/vendor/twig/twig/src/Template.php(405): __TwigTemplate_c39b3b55c03651963f56ca08b2acc5061574c39b0309e1508971b99f46ba20e3->doDisplay()
#10 /storage/av07738/www/public_html/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
#11 /storage/av07738/www/public_html/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
#12 /storage/av07738/www/public_html/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render()
#13 /storage/av07738/www/public_html/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render()
#14 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/View.php(408): Twig\Environment->render()
#15 /storage/av07738/www/public_html/vendor/graftechnology/pdfshift/src/PdfShift.php(115): craft\web\View->renderTemplate()
#16 /storage/av07738/www/public_html/vendor/craftcms/cms/src/base/Plugin.php(212): graftechnology\pdfshift\PdfShift->settingsHtml()
#17 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/View.php(1529): craft\base\Plugin->craft\base{closure}()
#18 /storage/av07738/www/public_html/vendor/craftcms/cms/src/base/Plugin.php(213): craft\web\View->namespaceInputs()
#19 /storage/av07738/www/public_html/vendor/craftcms/cms/src/controllers/PluginsController.php(114): craft\base\Plugin->getSettingsResponse()
#20 [internal function]: craft\controllers\PluginsController->actionEditPluginSettings()
#21 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#22 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#23 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#24 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction()
#25 /storage/av07738/www/public_html/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction()
#26 /storage/av07738/www/public_html/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest()
#27 /storage/av07738/www/public_html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()
#28 /storage/av07738/www/public_html/public/index.php(22): yii\base\Application->run()
#29 {main}

APPLICATION INFO
PHP version 7.4.3
OS version Linux 5.4.0-97-generic
Database driver & version MySQL 8.0.29
Image driver & version Imagick 3.4.4 (ImageMagick 6.9.10-23)
Craft edition & version Craft Pro 3.7.50
Yii version 2.0.45
Twig version v2.14.13
Guzzle version 7.4.5

PLUGINS
Inlin 2.1.1
Linkit 3.0.0
Navigation 1.4.28
PdfShift 1.1.1
Reasons 2.3.1
Redactor 2.10.10
Redactor Tweaks 2.0.4
SEOmatic 3.4.37
Site Switcher 2.2.0
vCard 1.2.1

Incredibly slow generation

Very very slow generation of a page. Even has timed out my server. Is this a common occurrence?

Also, is there a way to generate on click instead of as the page loads?

Add error messages

I ran into the same issue as #1 and was able to find a workaround. However, if I exceed my PDFShift API usage (say a PDF is 2MB instead of 1MB) it completely breaks the page and gives a Twig error.

Would it be possible to add some type of error catching? It would be very helpful if I could show an error message to users rather than a broken page.

Thanks!
John

Fix Composer 2 compatibility

When installing this plugin with Composer 1, the following deprecation notice is output:

Deprecation Notice: Class graftechnology\pdfshift\assetbundles\PdfShift\PdfShiftAsset located in ./vendor/graftechnology/pdfshift/src/assetbundles/pdfshift/PdfShiftAsset.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.

Composer 2 was released on October 24, and is now the default version that will be installed, so it’s critical that this gets resolved ASAP, or people will start getting Class not found errors.

To fix, run the following command:

> git mv src/assetbundles/pdfshift src/assetbundles/PdfShift

Then commit your change and tag a new release.

(Note that you must use the git mv command, as Git tends to not notice case-sensitive file renames otherwise.)

Download method not working

I've used the code from the readme exactly and it never seems to work. I've tried putting it in a standalone Twig file, inlining it in HTML, as a link and none of those worked. Any thoughts?

Thanks,
John

Cannot create link from Craft entry

Hi,

I am running the latest plugin release and I am on the latest Craft 3 release.

When I try and get a link to the entry/product I am on I get an error:

{{ craft.pdfShift.link({
        source: product.url,
        filename: 'product.pdf',
        format: 'a4',
        sandbox: true
    }) }}

The error on the front-end is below:

Undefined property: stdClass::$url

Is there a way to fix this or is this something I am doing wrong?

Thanks,
Mark

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.