WPChill / download-monitor

A WordPress plugin which provides an intuitive UI for uploading and managing downloadable files (including support for multiple versions), inserting download links into posts & logging downloads.
http://wordpress.org/extend/plugins/download-monitor/
262 stars 117 forks source link

Fatal Error caused by incompatible Container class #1512

Closed codepuncher closed 3 months ago

codepuncher commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Install illuminate/container v8
  2. Install download-monitor v5
  3. Activate the plugin
  4. Load any page

Expected behavior No errors

Screenshots

2024/08/22 07:03:42 [error] 12006#12006: *773074 FastCGI sent in stderr: "PHP message: PHP Fatal error: Declaration of Illuminate\Container\Container::has($id) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool in /path/to/vendor/illuminate/container/Container.php on line 194" while reading response header from upstream, client: 45.76.44.221, server: www.example.org.uk, request: "HEAD / HTTP/2.0", upstream: "fastcgi://unix:/var/run/php8.1-fpm-example.sock:", host: "www.example.org.uk:19391"

Extensions installed and activated:

Additional context

Because your plugin bundles pimple/container and we have illuminate/container on our site, they are conflicting. I see that you have Mozart for prefixing your dependencies but it doesn't seem to be working! Please can this be fixed urgently as it is causing fatal error all over the site.

codepuncher commented 3 months ago

After downgrading the plugin to the last version, downloads are all 404s. Is there any workaround for this? Currently we have multiple customers who's websites are no longer able to serve downloads to their users.

razvanaldea89 commented 3 months ago

Please flush the permalinks and let me know if the problem still occurs with the 404s

codepuncher commented 3 months ago

Hi @razvanaldea89 , yep that fixed it! Thanks.

Let me know if you need a hand with testing a patch for the original issue on our staging sites.

razvanaldea89 commented 3 months ago

Hi @codepuncher , could you please update to the 5.0.3 version and let me know if you are still experiencing problems?

codepuncher commented 3 months ago

Hi @razvanaldea89 latest version solves the original issue. But, now, downloads are 404.

razvanaldea89 commented 3 months ago

Please try again with flushing the permalinks and let me know if the problem is solved.

codepuncher commented 3 months ago

Hi @razvanaldea89, no that didn't help.

We have another customer now also experiencing this same issue. image we use the same file structure on our websites

These are symlinks. Does that change anything? We are using Bedrock and Trellis

razvanaldea89 commented 3 months ago

Hi @codepuncher ,

Are you experiencing 404 or 403? The allowed paths should return 403 Access Denied if the file is not in the allowed paths. Could you add the Bedrock file paths to the Allowed Paths?

Warmly, Razvan

codepuncher commented 3 months ago

Hi @razvanaldea89 I have done that already as per my screenshot above and flushed permalinks but not working.

razvanaldea89 commented 3 months ago

Is it possible to give us a link to a test download page containing downloads? You can use our contact form here if you do not want to give that info here.

codepuncher commented 3 months ago

Hi @razvanaldea89,

That might have been red-herring; most downloads are working fine now actually. The ones that are not have strange file paths in the meta like dlm_2024 instead of dlm_uploads/2024.

I'll fix these myself and happy to close this issue.

Thanks for the help.

razvanaldea89 commented 3 months ago

Good news about the ones that are working, weird news about the dlm_2024 ones. Were them the same before the update? We did not make modifications that could affect the meta.

codepuncher commented 3 months ago

Not sure if they were like that originally but not worried now; all is working.

Thanks again!

razvanaldea89 commented 3 months ago

Awesome :D Have a great day!

codepuncher commented 3 months ago

and you!