Git Product home page Git Product logo

Comments (10)

bymayo avatar bymayo commented on June 24, 2024 1

@Christopholus I've just pushed a release that fixes the unreadable errors on upload, but I still don't think it will fix your file_get_contents error. This error is coming from getting the Asset file to then create a temporary file before it transforms it. I've tried loads of scenarios (Aliases in asset volumes, env vars in asset volumes, file not being in the uploads folder etc) but I can't replicate this error at all. It might be good if you send over a DB dump to me and I can test this with your setup if this is okay?

Can you also confirm which PHP version you're using?

Also, note that there is now a new "Transform PDFs on upload" setting that you'll need to switch on (Or keep it off if you don't want this to automatically transform)

Update: Can you also confirm that your files volume has a Base URL and that Assets in this volume have public URLs?

from craft-pdf-transform.

Christopholus avatar Christopholus commented on June 24, 2024 1

@bymayo I think you nailed it! Funny enough, it was your update about the "Base URL" got me thinking. These asset volumes do have base URLs, but they're just set up like so:
image

I wondered if maybe prepending @webroot to the base URL might fix the problem. Aaaaaaand just tried this locally and it works! 🙌 🙌🙌

Darn - I can't believe this was the issue. We haven't had any problems with the Base URLs up until now - so I never would have thought to check here. It is odd that the new update would have been more strict about this. Admittedly my PHP knowledge isn't advanced, but I wonder if the file_get_contents() function may have stricter requirements than the way the PDFs were previously referenced?

In either scenario, thank you again for all of the testing you did. You've been a huge help!

from craft-pdf-transform.

bymayo avatar bymayo commented on June 24, 2024 1

@Christopholus Wahoo! So the thing here is that the file_get_contents() function I'm using in 1.0.8 onwards requires https in the URL to get the image.

The difference between 1.0.7 and 1.0.8 is that I'm now no longer just looking for a file "path", but actually getting the asset via the URL instead (Mainly to fix people using remote asset storage like Amazon S3 where paths aren't available) so this will explain why it worked previously.

I may need to change this slightly in future as it kind of restricts people using this plugin if they want their assets to be private for instance.

I'd probably advise to use @web over @webroot for your base URL setting as well. Or even better, setting them as .env vars

from craft-pdf-transform.

Christopholus avatar Christopholus commented on June 24, 2024 1

Ah yes that totally makes sense - better as a catch-all for cases where the assets may not be hosted locally.

Thank you for the @web tip - we'll work that into our projects! Onwards and upwards 😄

from craft-pdf-transform.

bymayo avatar bymayo commented on June 24, 2024

@Christopholus Going to be looking in to this over the next day or so. Apologies if this holds up your site launch as I've only just seen this issue.

from craft-pdf-transform.

bymayo avatar bymayo commented on June 24, 2024

@Christopholus It seems that if you hit save on the PDF Transform settings page it will then work. It looks like since I've updated this plugin its now working with Project Config. If the plugin settings havent been set/saved then it can't get the Volume ID from the settings - As they don't exist in project config!

Let me know if this fixes the issue for you.

from craft-pdf-transform.

Christopholus avatar Christopholus commented on June 24, 2024

Thank you for the response, @bymayo!

I went into the plugin settings and made a few changes (changed the Image Resolution and adjusted the Output Image Volume) and unfortunately the issue still persists. I then went in and changed the volume back to the original "Thumbnails" volume and saved it, and still seeing the same problem.

I will add that both of these sets of changes appear to have updated the project config file, so it looks like the plugin's settings are indeed taking effect on the YAML files.

Unfortunately still hitting a wall over here :(. Any other ideas? I'm going to try removing the plugin entirely and re-adding it to see if that might prompt a heavier project YAML change/reset. Open to other suggestions if you have any!

Thanks for your continued help,
Chris

from craft-pdf-transform.

Christopholus avatar Christopholus commented on June 24, 2024

Unfortunately removing the plugin and re-installing again netted the same issue. Initially (before I clicked save again on the plugin's settings page) I received this error:
error_new

Once I re-saved the plugin's settings, back to the same error:
error_2

Looking at the project yaml, not much has changed other than my small tweaked settings:
image

Hopefully any of this is helpful! Please let me know if you have any other ideas as to what is going on.

from craft-pdf-transform.

bymayo avatar bymayo commented on June 24, 2024

@Christopholus Thanks for the feedback, i'll do another look at this later on tonight.

The line number it's stating (61) is a reference to it getting the Folder ID for the Volume, so looks like it's still an issue with that. I'll double check to see if there is an issue with you using an alias in the path/url for the volume and see if this pulls up anything.

Can you just confirm which version of Craft your using

from craft-pdf-transform.

Christopholus avatar Christopholus commented on June 24, 2024

Thank you- we really appreciate it.

Note: That initial error (61) was only present until I had actually adjusted the plugin settings for the first time after re-installing. The original error is being thrown again once re-saving the plugin's settings.

We are on Craft version 3.7.61

from craft-pdf-transform.

Related Issues (19)

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.